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:
Thiago Macieira 2017-10-24 21:39:21 -07:00 committed by Andrew Boie
parent f677caef2d
commit eb7848a1df
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ extern "C" {
#endif
#else
#ifndef assert
#define assert(test)
#define assert(test) ((void)0)
#endif
#endif