From 2d8eff9b521408505cff83c24cd44eaf6b4c6da0 Mon Sep 17 00:00:00 2001 From: Jonne Ransijn Date: Thu, 14 Nov 2024 23:12:59 +0100 Subject: [PATCH] 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. --- AK/Assertions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/Assertions.h b/AK/Assertions.h index 58583dfc8a1..b83da2269a1 100644 --- a/AK/Assertions.h +++ b/AK/Assertions.h @@ -24,7 +24,7 @@ static constexpr bool TODO = false; extern "C" __attribute__((noreturn)) void ak_assertion_failed(char const*); #ifndef NDEBUG # define ASSERT(expr) \ - (__builtin_expect(!(expr), 0) \ + (__builtin_expect(/* NOLINT(readability-simplify-boolean-expr) */ !(expr), 0) \ ? ak_assertion_failed(#expr " at " __FILE__ ":" __stringify(__LINE__)) \ : (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 */