mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-09-02 15:41:25 +03:00
MSVC standard headers use __declspec(noreturn), so #define noreturn to empty on that platform. Reported by Bruno Haible in <http://lists.gnu.org/archive/html/bug-gnulib/2012-02/msg00152.html>. * lib/stdnoreturn.in.h (noreturn): Define to empty on MSVC. * doc/posix-headers/stdnoreturn.texi (stdnoreturn.h): Document this.
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
@node stdnoreturn.h
|
|
@section @file{stdnoreturn.h}
|
|
|
|
POSIX specification:@* Not in POSIX yet, but we expect it will be.
|
|
ISO C11 (latest free draft
|
|
@url{http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf})
|
|
sections 7.23.
|
|
|
|
Gnulib module: stdnoreturn
|
|
|
|
Portability problems fixed by Gnulib:
|
|
@itemize
|
|
@item
|
|
This header file is missing on most circa-2012 platforms.
|
|
@end itemize
|
|
|
|
Portability problems not fixed by Gnulib:
|
|
@itemize
|
|
@item
|
|
@code{<stdnoreturn.h>} should be #included before @samp{_Noreturn} is used.
|
|
@item
|
|
You cannot assume that @code{_Noreturn} is a reserved word;
|
|
it might be a macro.
|
|
@item
|
|
On MSVC 9, @code{noreturn} expands to the empty token sequence, to avoid
|
|
problems with standard headers that use @code{__declspec (noreturn)}
|
|
directly. Although the resulting code operates correctly, the
|
|
compiler is not informed whether @code{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
|
|
@code{_Noreturn}.
|
|
@end itemize
|