1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:17:35 +00:00

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.
This commit is contained in:
Andreas Kling 2020-08-11 18:57:55 +02:00
parent 797904bafd
commit 9ba9228a6b

View file

@ -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