include_next: Change configure message.
[gnulib.git] / doc / posix-headers / assert.texi
blob28ddd1a59260512e6120fc53224094f71304feb7
1 @node assert.h
2 @section @file{assert.h}
4 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html}
6 Gnulib module: assert-h
8 See also the Gnulib modules @code{assert} and @code{verify}.
10 Portability problems fixed by Gnulib:
11 @itemize
12 @item
13 On older platforms @code{static_assert} and @code{_Static_assert} do
14 not allow the second string-literal argument to be omitted.  For
15 example, GCC versions before 9.1 do not support the single-argument
16 @code{static_assert} that was standardized by C2X and C++17.
17 @item
18 Even-older platforms do not support @code{static_assert} or
19 @code{_Static_assert} at all.  For example, GCC versions before 4.6 do
20 not support @code{_Static_assert}, and G++ versions before 4.3 do not
21 support @code{static_assert}, which was standardized by C11 and C++11.
22 @end itemize
24 Portability problems not fixed by Gnulib:
25 @itemize
26 @item
27 C @code{_Static_assert} and C++ @code{static_assert}
28 are keywords that can be used without including @code{<assert.h>}.
29 The Gnulib substitutes are macros that require including @code{<assert.h>}.
30 @item
31 The C @code{static_assert} and @code{_Static_assert} can also
32 be used within a @code{struct} or @code{union} specifier, in place of
33 an ordinary declaration of a member of the struct or union.  The
34 Gnulib substitute can be used only as an ordinary declaration.
35 @item
36 In C99 and later, @code{assert} can be applied to any scalar expression.
37 In C89, the argument to @code{assert} is of type @code{int}.
38 @end itemize