This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bool
>>>>> Per Bothner <bothner@cygnus.com> writes:
> Andrew Borthwick <borthwic@johnson.cs.nyu.edu>:
>> I wrote a little test program and found that with the 1997/11/05 snapshot,
>> a bool has a size of 4 bytes.
> I had thought this was fixed.
> If not, it really should be. sizeof(bool) must be one.
> Any other choice will be "unexpected" by reasonable progragrammers.
> Whether it takes more time to load a one-byte bool than a 4-byte
> or 8-byte bool is irrelevant - otherwise, we should make short
> be 4 bytes as well.
Nonsense. Most uses of bool are to store boolean values. Most of these
values would have been type 'int' if 'bool' were not available. If you
want packed data, you can use a bitvector or 'unsigned char'.
Jason