2 #define HEADER_DEBUG_H 1
5 #define ATTRIBUTE(X) __attribute__ (X)
10 #define UNUSED ATTRIBUTE ((unused))
11 #define NO_RETURN ATTRIBUTE ((noreturn))
12 #define PRINTF_FORMAT(FMT, FIRST) ATTRIBUTE ((format (printf, FMT, FIRST)))
13 #define SCANF_FORMAT(FMT, FIRST) ATTRIBUTE ((format (scanf, FMT, FIRST)))
15 void panic (const char *, ...)
16 __attribute__ ((format (printf, 1, 2), noreturn));
17 void backtrace (void);
21 /* This is outside the header guard so that debug.h may be
22 included multiple times with different settings of NDEBUG. */
27 #define ASSERT(CONDITION) \
31 panic ("%s:%d: %s(): assertion `%s' failed.", \
32 __FILE__, __LINE__, __func__, #CONDITION); \
34 #define NOT_REACHED() ASSERT (0)
36 #define ASSERT(CONDITION) ((void) 0)
37 #define NOT_REACHED() for (;;)