This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc's <stdbool.h> is broken


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]