mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-08-16 01:22:18 +03:00
FreeBSD and Cygwin #define _Noreturn to empty if 'lint' is defined. Problem reported by Ken Brown in: http://bugs.gnu.org/23640 * doc/posix-headers/stdnoreturn.texi (stdnoreturn.h): Document problem with lint and _Noreturn. * lib/diffseq.h (IF_LINT, IF_LINT2): * lib/fts.c (sccsid): * lib/getndelim2.c (IF_LINT): * lib/gl_anylinked_list2.h (gl_linked_iterator) (gl_linked_iterator_from_to): * lib/gl_anytree_list2.h (gl_tree_iterator) (gl_tree_iterator_from_to): * lib/gl_anytree_oset.h (gl_tree_iterator): * lib/gl_array_list.c (gl_array_iterator) (gl_array_iterator_from_to): * lib/gl_array_oset.c (gl_array_iterator): * lib/gl_carray_list.c (gl_carray_iterator) (gl_carray_iterator_from_to): * lib/idcache.c: * lib/inet_ntop.c (IF_LINT): * lib/regcomp.c (build_charclass_op, create_tree): * lib/regex_internal.c (re_acquire_state) (re_acquire_state_context): * lib/trigl.c (rcsid): * lib/trim.c (IF_LINT): * lib/vasnprintf.c (IF_LINT): * lib/verify.h (assume): Treat GCC_LINT like lint.
43 lines
1.5 KiB
Plaintext
43 lines
1.5 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
|
|
When the macro @code{lint} is defined, standard headers define
|
|
@code{_Noreturn} (and therefore @code{noreturn}) to be a macro that
|
|
expands to the empty token sequence on some platforms:
|
|
Cygwin 2.5.1, FreeBSD 10.3.
|
|
@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}.
|
|
@item
|
|
Circa 2012 bleeding-edge GCC with @code{-Werror=old-style-declaration}
|
|
requires @code{_Noreturn} or @code{noreturn} before the returned type
|
|
in a declaration, and therefore rejects valid but unusually-worded
|
|
declarations such as @code{void _Noreturn foo (void);}.
|
|
@end itemize
|