sizeof bool > sizeof int ?!?
Mark Mitchell
mark@codesourcery.com
Fri Dec 31 23:54:00 GMT 1999
>>>>> "Gerald" == Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> writes:
Gerald> On Thu, 20 Aug 1998, Per Bothner wrote:
>> The last time this came up, I lobbied for making sizeof(bool)
>> be 1 byte. I see little reason for making sizeof(bool) >
>> sizeof(short) [...] Well, guess what? I think most
>> programmers *expect* sizeof(bool) to be 1 - but we are
>> violating their very reasonable expectation.
Gerald> I just checked and GCC 2.95.2 and Alpha still has sizeof
Gerald> bool == 8, even with -fnew-api!
The IA64 C++ ABI specifies that the size and alignment of `bool' are
one. Efficiency aside, that's what everyone expects `bool' to be, and
that's what it will be with -fnew-abi in the very near future.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the Gcc
mailing list