From 1d8e62926f5b42bfefef1697b970e5d8c020799a Mon Sep 17 00:00:00 2001 From: Jonne Ransijn Date: Fri, 1 Nov 2024 20:57:59 +0100 Subject: [PATCH] AK: Remove `clang-tidy` warnings for `VERIFY(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 a40f5899571..58583dfc8a1 100644 --- a/AK/Assertions.h +++ b/AK/Assertions.h @@ -10,7 +10,7 @@ extern "C" __attribute__((noreturn)) void ak_verification_failed(char const*); #define __stringify_helper(x) #x #define __stringify(x) __stringify_helper(x) #define VERIFY(expr) \ - (__builtin_expect(!(expr), 0) \ + (__builtin_expect(/* NOLINT(readability-simplify-boolean-expr) */ !(expr), 0) \ ? ak_verification_failed(#expr " at " __FILE__ ":" __stringify(__LINE__)) \ : (void)0) #define VERIFY_NOT_REACHED() VERIFY(false) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */