[Bug c/82272] RFE: request a warning for (<nonbool> == <bool>) etc.
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Oct 29 15:06:45 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82272
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joseph Myers <jsm28@gcc.gnu.org>:
https://gcc.gnu.org/g:40749db75caff2fed7b7053e0d1868feaa21bcb4
commit r11-4537-g40749db75caff2fed7b7053e0d1868feaa21bcb4
Author: Joseph Myers <joseph@codesourcery.com>
Date: Thu Oct 29 15:05:33 2020 +0000
stdbool.h: Update true and false expansions for C2x
C2x has changed the expansions of the true and false macros in
<stdbool.h> so that they have type _Bool (including in #if conditions,
i.e. an unsigned type in that context). Use the new expansions in
GCC's <stdbool.h> for C2x.
See bug 82272 for related discussion (but this patch does *not*
implement the warning discussed there).
Note that it's possible there may be a further change to make bool,
true and false keywords (there was support in principle for that at
the April WG14 meeting). But currently these expansions of type _Bool
are what C2x requires and there isn't actually a paper before WG14 at
present that would introduce the new keywords.
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc/
2020-10-29 Joseph Myers <joseph@codesourcery.com>
* ginclude/stdbool.h [__STDC_VERSION__ > 201710L] (true, false):
Define with type _Bool.
gcc/testsuite/
2020-10-29 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/c11-bool-1.c, gcc.dg/c2x-bool-1.c, gcc.dg/c99-bool-4.c:
New tests.
More information about the Gcc-bugs
mailing list