In lint mode, 'assert(cond)' expanded to nothing. This broke code like
sqlite that assumes 'assert(cond)' expands to an expression that can be
used as operand of the comma operator, as in 'return assert(i > 0), i'.
C++ without real static_assert() can be incompatible with the C fallback
as presented in openjdk.
A pre-C11 compiler can be picky on the implementation.
The existing definition caused issues as GCC only provides _Static_assert
when building C11 code.
This follows the C standard: static_assert available since C11.
Fixes https://rt.perl.org/Public/Bug/Display.html?id=134023
This declaration conforms to the C11 standard
Reference: ISO/IEC 9899:201x 7.2 Diagnostics <assert.h>
_Static_assert performs compile-time assertion checking.
According to ISO/IEC 9899:201x (draft) 7.2 Diagnostics <assert.h> defines
the static_assert macro which expands to _Static_assert. It's not
conditionalized by NDEBUG like the assert macro.
According to ISO/IEC N3242=11-0012 (C++1x) the <cassert> header shall
define only the assert macro, but not static_assert as it's already part
of the C++11 language.
Allow to define static_assert in C++ prior the C++11 standard. It might be
broken but a nonstandard C++ compiler might support C11-like _Static_assert
feature. Note that it's fatal for g++ 5.4, but it works for clang++ 3.8.1.
Approved by <joerg>.
only be exposed if _NETBSD_SOURCE is defined. To make life less complicated,
define _assert() in terms of assert(), since they always seem to have identical
definitions.
_assert() was removed back in 1993, but got reinstated with the 4.4Lite
import. Maybe it should go again. Nothing in the tree uses it.
the __assert() helper function is declared once if <assert.h> is included
multiple times.
Don't support the _assert() macro, nothing uses it and it pollutes the
user's namespace.