78ccfc3fd7ee3ae148c07565b6120b044a125710
[gnulib.git] / doc / posix-headers / stdbool.texi
1 @node stdbool.h
2 @section @file{stdbool.h}
3
4 POSIX specification: @url{http://www.opengroup.org/susv3xbd/stdbool.h.html}
5
6 Gnulib module: stdbool
7
8 Portability problems fixed by Gnulib:
9 @itemize
10 @item
11 This header file is missing on some platforms:
12 AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1.
13 @item
14 Some compilers have bugs relating to @samp{bool}.
15 @end itemize
16
17 Portability problems not fixed by Gnulib:
18 @itemize
19 @item
20 @code{<stdbool.h>} must be #included before @samp{_Bool} can be used.
21 @item
22 You cannot assume that @code{_Bool} is a typedef; it might be a macro.
23 @item
24 Bit-fields of type @samp{bool} are not supported.  Portable code
25 should use @samp{unsigned int foo : 1;} rather than @samp{bool foo : 1;}.
26 @item
27 Casts and automatic conversions to @samp{bool} don't test against the
28 zero value or the null pointer, as they should.  Such casts should only
29 be used if the casted value is known to be equal to 0 or 1.
30 @item
31 You cannot assume that casting a floating point literal to @samp{bool} will
32 result in a constant expression.
33 @end itemize