Hash :
6ebad7ab
Author :
Date :
2024-12-28T06:08:15
Rename module stdbool-h to bool. Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00193.html>. * modules/bool: Renamed from modules/stdbool-h. * modules/bool-tests: Renamed from modules/stdbool-h-tests. * modules/bool-c++-tests: Renamed from modules/stdbool-h-c++-tests. * tests/test-bool.c: Renamed from tests/test-stdbool-h.c. * tests/test-bool-c++.cc: Renamed from tests/test-stdbool-h-c++.cc. * tests/test-bool-c++2.cc: Renamed from tests/test-stdbool-h-c++2.cc. * modules/stdbool-h-c99-tests: Update. * modules/stdbool-h-c99-c++-tests: Update. * tests/test-stdbool-h-c99.c: Update. * tests/test-stdbool-h-c99-c++.cc: Update. * doc/posix-headers/stdbool.texi: Update. * doc/gnulib-readme.texi: Update. * doc/gnulib.texi: Update. * modules/* (Depends-on): Update. * modules/stdbool: Update.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
@node stdbool.h
@section @file{stdbool.h}
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/stdbool.h.html}
Gnulib module: stdbool-h-c99
@mindex stdbool-h-c99
@mindex bool
The @code{stdbool-h-c99} module is present only for programs that
formerly used the old @code{stdbool} module for C99 compatibility,
and that for some reason cannot use the current @code{bool} module
for C23 compatibility.
Portability problems fixed by Gnulib:
@itemize
@item
This header file is missing on some platforms:
AIX 5.1, HP-UX 11.
@item
This header file is not usable in C++ mode with the vendor compiler
on Solaris 10.
@item
Some compilers have bugs relating to @samp{bool}.
@item
This header file defines @code{true} incorrectly on some platforms:
OpenBSD 4.7 with gcc 2.95.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
@samp{_Bool} cannot be used before @code{<stdbool.h>} is included, or if
the program is intended to be compiled by a C++ compiler.
(With the advent of C23, @samp{_Bool} is obsolescent anyway.)
@item
You cannot assume that @code{_Bool} is a typedef; it might be a macro.
For example, C23 allows @code{_Bool} to be a macro.
@item
Bit-fields of type @samp{bool} are not supported. Portable code
should use @samp{unsigned int foo : 1;} rather than @samp{bool foo : 1;}.
@item
Casts and automatic conversions to @samp{bool} don't test against the
zero value or the null pointer, as they should. Such casts should only
be used if the value is known to be equal to 0 or 1.
@item
You cannot assume that casting a floating point literal to @samp{bool} will
result in a constant expression.
@end itemize