Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (8h)  netbsd-10 (6d)  netbsd-9 (6d)  netbsd-8 (11d) 

2024-05-23 01:48:32 UTC Now

2016-10-03 12:08:39 UTC MAIN commitmail json YAML

Add static_assert macro definition in <assert.h>

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

(kamil)