This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
sizeof bool > sizeof int ?!?
- To: egcs at cygnus dot com
- Subject: sizeof bool > sizeof int ?!?
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Date: Fri, 3 Jul 1998 15:15:06 +0200 (MET DST)
- cc: Wolfgang Faber <faber at dbai dot tuwien dot ac dot at>
- Reply-To: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
I just compiled
#include <stdio.h>
int main() {
printf( "bool = %u\nshort = %u\nint = %u\nlong = %u\n",
sizeof(bool), sizeof(short), sizeof(int), sizeof(long));
return 0;
}
with egcs-2.90.29 980515 (egcs-1.0.3 release) on alphaev56-dec-osf4.0d
and -- surprise, surprise! -- sizeof bool > sizeof int !?!
bool = 8
short = 2
int = 4
long = 8
I find it _very_ hard calling this a feature!
Even if it may be standards compliant, this is most surprising for
95%[1] of all developers.
If I remember correctly, Jason has suggested to make sizeof bool == 1
with a new API. Does anybody now the timeframe for this?
Gerald
[1] While we are at making up statistics on the egcs*-lists... :-)
--
Gerald Pfeifer (Jerry) Vienna University of Technology
pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/