From 9ba9228a6bf1387b4b34463ba640b09347d6ae2f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 11 Aug 2020 18:57:55 +0200 Subject: [PATCH] LibC: Make sure assert() expands to *something* in non-DEBUG builds Sometimes people write strange things like "assert(x), something();" and this will not work if "assert(x)" expands to "". So make it expand to ((void)0) instead. --- Libraries/LibC/assert.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibC/assert.h b/Libraries/LibC/assert.h index 6045f9d484..84e2d779fc 100644 --- a/Libraries/LibC/assert.h +++ b/Libraries/LibC/assert.h @@ -41,7 +41,7 @@ __attribute__((noreturn)) void __assertion_failed(const char* msg); } while (0) # define ASSERT_NOT_REACHED() assert(false) #else -# define assert(expr) +# define assert(expr) ((void)0) # define ASSERT_NOT_REACHED() CRASH() #endif