AK: Remove clang-tidy warnings for ASSERT(a || b) lines

Lines like these were getting a warning to simplify the expanded
boolean expression from `!(a || b)` to `(a && b)`, but since the
`!(...)` is part of the macro, that is never going to happen.
This commit is contained in:
Jonne Ransijn 2024-11-14 23:12:59 +01:00
parent 24a6fd3d76
commit 2d8eff9b52
No known key found for this signature in database
GPG key ID: 49DC70026D2C578C

View file

@ -24,7 +24,7 @@ static constexpr bool TODO = false;
extern "C" __attribute__((noreturn)) void ak_assertion_failed(char const*); extern "C" __attribute__((noreturn)) void ak_assertion_failed(char const*);
#ifndef NDEBUG #ifndef NDEBUG
# define ASSERT(expr) \ # define ASSERT(expr) \
(__builtin_expect(!(expr), 0) \ (__builtin_expect(/* NOLINT(readability-simplify-boolean-expr) */ !(expr), 0) \
? ak_assertion_failed(#expr " at " __FILE__ ":" __stringify(__LINE__)) \ ? ak_assertion_failed(#expr " at " __FILE__ ":" __stringify(__LINE__)) \
: (void)0) : (void)0)
# define ASSERT_NOT_REACHED ASSERT(false) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */ # define ASSERT_NOT_REACHED ASSERT(false) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */