diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-11 18:57:55 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-11 20:29:14 +0200 |
commit | 9ba9228a6bf1387b4b34463ba640b09347d6ae2f (patch) | |
tree | a52fca0900bfa19965ba729e0afdfdfc666694fa /Libraries | |
parent | 797904bafd497c37fd023d8067f7a4fadfbc8298 (diff) | |
download | serenity-9ba9228a6bf1387b4b34463ba640b09347d6ae2f.zip |
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.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibC/assert.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 |