libc: Make no-debug assert() conform to C requirements
The C standard requires assert() to be a void result, so you could write something like: return assert(x), x; From the C11 standard (7.2 Diagnostic <assert.h>): > If NDEBUG is defined as a macro name at the point in the source file > where <assert.h> is included, the assert macro is defined simply as > #define assert(ignore) ((void)0) Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
f677caef2d
commit
eb7848a1df
|
@ -20,7 +20,7 @@ extern "C" {
|
|||
#endif
|
||||
#else
|
||||
#ifndef assert
|
||||
#define assert(test)
|
||||
#define assert(test) ((void)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue