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]
Other format: [Raw text]

Re: [RFA] Move cpplib to the toplevel



On May 29, 2004, at 08:34, Paolo Bonzini wrote:


Note that sizeof (_Bool) is defined by C99 as at
least the sizeof (char) so it is wrong to check for
to see that the sizeof (_Bool) == 1, in fact there
is one major target/host which defines sizeof(_Bool)==4
and this is powerpc-apple-darwin.

Though, IIRC the C++ ABI mandates that sizeof (bool) == 1, so sizeof (_Bool) > 1 is guaranteed to cause troubles in C/C++ interoperability: in this case, it seems better to me if you say that there is no bool.

Yes the IA64 C++ ABI says that sizeof(bool) should equal to 1. But Apple did not want to break backward compatibility with code written before the ABI was written so they kept the sizeof(bool) and sizeof(_Bool) to equal to 4 instead of 1 like the ABI. So powerpc-apple-darwin does not follow the IA64 C++ ABI to the wire but instead is modified version of it with only the sizeof(bool) being different.

This has been discussed before when the bootstrap of the
tree-ssa was ICEing because it would remove the cast from
int to _Bool.

Thanks,
Andrew Pinski


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