diff options
author | Richard Braun <rbraun@sceen.net> | 2017-09-01 23:58:41 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-09-02 15:25:37 +0200 |
commit | d18d0e85596f90e0bd597b33d58209d0b3973c95 (patch) | |
tree | 6c3472f59cf64244ab86d2fc13b220b1c8f61165 /include/assert.h | |
parent | 897ad6a062ea2a32a2759613608faf3271211832 (diff) |
Make assert have no side effects
This makes sure symbols referenced by assert uses may not be generated
if unused. The recently introduced __unused macro is used to suppress
compiler warnings resulting from this change.
Diffstat (limited to 'include/assert.h')
-rw-r--r-- | include/assert.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/assert.h b/include/assert.h index 8fdc2fe..9bf3bdf 100644 --- a/include/assert.h +++ b/include/assert.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Richard Braun. + * Copyright (c) 2010-2017 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ #define static_assert _Static_assert #ifdef NDEBUG -#define assert(expression) ((void)(expression)) +#define assert(expression) #else /* NDEBUG */ #include <kern/macros.h> |