This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Peter A. Felvegi wrote:Ian Lance Taylor wrote:
You can avoid this kind of thing by telling gcc that your assert condition does not return.
void assert_failure () __attribute__ ((noreturn, always_inline)); void assert_failure() { __asm__ ("int $0x03"); } #define ASSERT(x) if (x) { } else { assert_failure(); }Now I got 'noreturn function does return' warning/error in assert_failure().
void assert_failure() { for (;;) __asm__ ("int $0x03"); }
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |