This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gcc's <stdbool.h> is broken
- To: Zack Weinberg <zackw at Stanford dot EDU>
- Subject: Re: gcc's <stdbool.h> is broken
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Tue, 6 Feb 2001 07:46:29 +0000
- Cc: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>, Bruno Haible <haible at ilog dot fr>,gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <14974.61620.982937.193137@honolulu.ilog.fr> <Pine.LNX.4.32.0102051857240.12371-100000@kern.srcf.societies.cam.ac.uk> <20010205122827.U525@wolery.stanford.edu> <20010205204551.A3104@daikokuya.demon.co.uk> <20010205215237.V525@wolery.stanford.edu>
Zack,
Thanks for the explanation...
Zack Weinberg wrote:-
> GCC's <stdbool.h> has been extended so that it works if included
> from C++ code. Instead of the above definitions, it does
>
> #define _Bool bool
> #define bool bool
> #define true true
> #define false false
> #define __bool_true_false_are_defined 1
Just curious - what's the point of defining them to themselves?
> However, with these definitions, true and false do not work in #if
> expressions in C++ even after including stdbool.h. It is desirable
> that they do work, for maximum compatibility between C99 and C++, and
> there's no reason why they shouldn't be known to the C++ preprocessor
> at all times.
OK. Is it known that the C++ people intend them to work in CPP
expressions in the future? I'm just a bit wary of yet another
extension, particularly in this area, since they are quite different
and ...
> I don't envy the subcommittee charged with merging C99's changes into
> C++0x.
... we don't know what they might decide - it could be incompatible
(e.g. our varargs macros incompatibilities). I don't envy them either
- particularly if they decide they have to support variable-sized
arrays like C99 - that would make the C++ grammar even more grotesque
<g>.
Neil.