stddef.h: Add C2x unreachable macro
authorJoseph Myers <joseph@codesourcery.com>
Fri, 9 Sep 2022 14:11:21 +0000 (14:11 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 9 Sep 2022 14:11:21 +0000 (14:11 +0000)
commita1a53dc7d87969d230e9ca51fcab59f3a72e5f6e
tree66d18f84613aafe396a98dd4cd6ec85ed7a1354e
parente230f11e9784eefed316df7dbc5df6ac999841b2
stddef.h: Add C2x unreachable macro

C2x adds a macro unreachable to stddef.h, with the same semantics as
__builtin_unreachable.  Define this macro accordingly.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/
* ginclude/stddef.h [__STDC_VERSION__ > 201710L] (unreachable):
New macro.

gcc/testsuite/
* gcc.dg/c11-unreachable-1.c, gcc.dg/c2x-unreachable-1.c: New
tests.
gcc/ginclude/stddef.h
gcc/testsuite/gcc.dg/c11-unreachable-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-unreachable-1.c [new file with mode: 0644]