This is the mail archive of the 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]
Other format: [Raw text]

Re: PATCH to libcpp: Move to the intersection of C90 an C++

Mike Stump <> writes:

| On May 23, 2005, at 9:33 PM, Gabriel Dos Reis wrote:
| >  #define bool unsigned char
| I hope you don't want this to be ABI compatible with C++ or C!  On

The #define has been there unconditionally.  That is wrong if one
builds GCC with a C++ compiler, because for libcpp the function
signatures include (unsigned char), and for the remaining for gcc/ the
include real bool.  So one gets link error between libcpp and the rest
of gcc.

I think it should be undefined when compiling with a C++ compiler.

| darwin _Bool and bool are both 4 bytes.  How about we either use
| stdbool.h, or _Bool or something else, like int?

libcpp/system.h has this comment on top of the (unconditional) define

/* Provide a fake boolean type.  We make no attempt to use the
   C99 _Bool, as it may not be available in the bootstrap compiler,
   and even if it is, it is liable to be buggy.  
   This must be after all inclusion of system headers, as some of
   them will mess us up.  */

If the bootstrapping compiler is a C++ compiler, it will be available
and it is not liable to be buggy.

The other thing here is that libcpp/ has its own system.h and gcc/ has
its own version..  And they do not seem to agree. 

-- Gaby

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