NEWS.stable: log cherry-pick [e446f25]->[c092018] relocatable-shell: Update suggested...
[gnulib.git] / doc / posix-headers / assert.texi
1 @node assert.h
2 @section @file{assert.h}
3
4 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html}
5
6 Gnulib module: assert-h
7
8 See also the Gnulib module @code{assert}.
9
10 Portability problems fixed by Gnulib:
11 @itemize
12 @item
13 The C11 and C++11 @code{static_assert}, and the C11
14 @code{_Static_assert}, are not supported by many platforms.
15 For example, GCC versions before 4.6.0 do not support @code{_Static_assert},
16 and G++ versions through at least 4.6.0 do not support @code{static_assert}.
17 @end itemize
18
19 Portability problems not fixed by Gnulib:
20 @itemize
21 @item
22 C11 @code{_Static_assert} and C++11 @code{static_assert}
23 are keywords that can be used without including @code{<assert.h>}.
24 The Gnulib substitutes are macros that require including @code{<assert.h>}.
25 @item
26 The C11 @code{static_assert} and @code{_Static_assert} can also
27 be used within a @code{struct} or @code{union} specifier, in place of
28 an ordinary declaration of a member of the struct or union.  The
29 Gnulib substitute can be used only as an ordinary declaration.
30 @item
31 In C99, @code{assert} can be applied to any scalar expression.
32 In C89, the argument to @code{assert} is of type @code{int}.
33 @end itemize