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]
Other format: [Raw text]

sizeof(long long)


Hi,

Is it a strict requirement of C that "long long" is 64-bits? Or is it simply that sizeof(long long)>sizeof(long) (or maybe >=)?

In the AVR target, this the sizeof's are distributed as such: sizeof(char)=1, sizeof(short)=sizeof(int)=2, sizeof(long)=4, sizeof(long long)=8.

Since this is a small microcontroller, it has the -mint8 option, which does the following: sizeof(char)=sizeof(short)=sizeof(int)=1, sizeof(long)=2 and sizeof(long long)=8.

Note that there is a gap between long and long long. No 32-bits types exists for this mode -- this represents surely a problem when 32-bits types are wanted. My idead would then to decrease the long long size to be 32-bit.

I have a patch for it, but I wanted to make sure that this construct is valid..

Regards,
Svein


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