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]

Re: sizeof(long long)


Hi,

On Tue, 19 Nov 2002, Svein E. Seldal wrote:

> Andreas Schwab wrote:
>
> > Since INT_MAX must be at least 32767 this implies that CHAR_BIT is at
> > least 16.  So sizeof(long long) can be 4 to be still compliant.
>
> Unfortunately it isnt. When the mint8 is used CHAR_MAX=SHORT_MAX=INT_MAX
> =127. Thus it wont be compliant on long long, neither is is on the
> others because of this INT_MAX >= 32767 property.

Yep, most of the microcontrollers which are supported by GCC are non
compliant in their 8 bit mode (if any is supported at all).  I think you
are right, that (long long) should also be reduced like the other types to
a 32bit one in this case (although there is no real justification for such
a wish).  I'm not sure why this isn't done.  Either an oversight, or
possibly something to do with having an int type being able to hold
pointer values (although I really doubt those controller support 64 bit
addresses ;-) ).  Ask the AVR maintainer.

> BTW: Where are the min/max requirements for INT_MAX etc. defined?

5.2.4.2.1 in C99 for instance.


Ciao,
Michael.


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