34 # define NORETURN __attribute__((noreturn))
47 # if ((__GNUC__ >= 15) || (__clang_major__ >= 21))
48 # define NONSTRING __attribute__((nonstring))
63 # define PURE __attribute__((pure))
76 # define MAYBE_UNUSED __attribute__((unused))
90 #if defined(__llvm__) || defined(__clang__)
91 # define NO_SANITIZE_ARRAY __attribute__((no_sanitize("address")))
93 # define NO_SANITIZE_ARRAY
103 #if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ >= 5) || defined(__clang__)
104 # define UNREACHABLE() __builtin_unreachable()
106 # define UNREACHABLE() do { } while (1)
120 #define WITHOUT_PEDANTIC(...) \
121 _Pragma("GCC diagnostic push") \
122 _Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
124 _Pragma("GCC diagnostic pop")
136 #define DECLARE_CONSTANT(identifier, const_expr) \
137 WITHOUT_PEDANTIC(enum { identifier = const_expr };)
152 # define IS_CT_CONSTANT(expr) <IMPLEMENTATION>
153 #elif defined(__GNUC__)
155 # define IS_CT_CONSTANT(expr) __builtin_constant_p(expr)
157 # define IS_CT_CONSTANT(expr) 0
167 #define likely(x) __builtin_expect((uintptr_t)(x), 1)
176 #define unlikely(x) __builtin_expect((uintptr_t)(x), 0)
189 # define assume(cond) ((cond) ? (void)0 : UNREACHABLE())
191 # 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...