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

sizeof(long)


Hi Folks,

Here's another problem for the collective wisdom of the group:

The follow-code

#include <stdio.h>

int main(int argc, char **argv)
{

   printf("int: %d \n",sizeof(int));
   printf("long: %d \n",sizeof(long));

}

returns:

int: 4
long: 4

I'm using gcc version 2.96 with linux 7.2 for i686. My questions:

1) Does this seem right? Shouldn't longs have more bytes?

2) Is this a product of some compile option or something? 

3) How can I fix this? (I need an int with more oomph!)

Thanks,

Jason Foat
UCSD  


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