37 # define NORETURN __attribute__((noreturn))
51 # define NONSTRING __attribute__((nonstring))
66 # define PURE __attribute__((pure))
79 # define MAYBE_UNUSED __attribute__((unused))
93 #if defined(__llvm__) || defined(__clang__)
94 # define NO_SANITIZE_ARRAY __attribute__((no_sanitize("address")))
96 # define NO_SANITIZE_ARRAY
106 #if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ >= 5) || defined(__clang__)
107 # define UNREACHABLE() __builtin_unreachable()
109 # define UNREACHABLE() do { } while (1)
123 #define WITHOUT_PEDANTIC(...) \
124 _Pragma("GCC diagnostic push") \
125 _Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
127 _Pragma("GCC diagnostic pop")
139 #define DECLARE_CONSTANT(identifier, const_expr) \
140 WITHOUT_PEDANTIC(enum { identifier = const_expr };)
155 # define IS_CT_CONSTANT(expr) <IMPLEMENTATION>
156 #elif defined(__GNUC__)
158 # define IS_CT_CONSTANT(expr) __builtin_constant_p(expr)
160 # define IS_CT_CONSTANT(expr) 0
170 #define likely(x) __builtin_expect((uintptr_t)(x), 1)
179 #define unlikely(x) __builtin_expect((uintptr_t)(x), 0)
192 # define assume(cond) ((cond) ? (void)0 : UNREACHABLE())
194 # define assume(cond) assert(cond)
POSIX.1-2008 compliant version of the assert macro.
static unsigned may_be_zero(unsigned n)
Wrapper function to silence "comparison is always false due to limited range of data type" t...