This is the mail archive of the gcc@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]

sizeof bool > sizeof int ?!?


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/



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