Next: string.h, Previous: stdlib.h, Up: ISO C and POSIX Header File Substitutes [Contents][Index]
POSIX specification:
Not in POSIX yet, but we expect it will be.
ISO C11 (latest free draft
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf)
sections 7.23.
Gnulib module: stdnoreturn
Portability problems fixed by Gnulib:
<stdlib.h>
and
<process.h>
, on some platforms:
MSVC/clang.
Portability problems not fixed by Gnulib:
<stdnoreturn.h>
and the noreturn
macro are obsolescent in C23.
<stdnoreturn.h>
cannot be #included in C++ mode on some platforms:
FreeBSD 13.1.
<stdnoreturn.h>
should be #included before ‘_Noreturn’ is used.
_Noreturn
is a reserved word;
it might be a macro.
lint
is defined, standard headers define
_Noreturn
(and therefore noreturn
) to be a macro that
expands to the empty token sequence on some platforms:
Cygwin 2.5.1, FreeBSD 10.3.
noreturn
expands to the empty token
sequence, to avoid problems with standard headers that use noreturn
in combination with __attribute__
or __declspec
. Although
the resulting code operates correctly, the compiler is not informed whether
noreturn
functions do not return, so it may generate incorrect
warnings at compile-time, or code that is slightly less optimized. This
problem does not occur with _Noreturn
.
-Werror=old-style-declaration
requires _Noreturn
or noreturn
before the returned type
in a declaration, and therefore rejects valid but unusually-worded
declarations such as void _Noreturn foo (void);
.
Next: string.h, Previous: stdlib.h, Up: ISO C and POSIX Header File Substitutes [Contents][Index]