From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2006-09-21 09:39:26
Peter Dimov wrote:
> > Actually that's not correct. The Standard is quite clear when it
> > states [220.127.116.11]:
> > There are four signed integer types: "signed char", "short int",
> > "int", and "long int." In this list, each type provides at least as
> > much storage as those preceding it in the list.
> > And [18.104.22.168]:
> > For each of the signed integer types, there exists a corresponding
> > (but different) unsigned integer type:
> > "unsigned char", "unsigned short int", "unsigned int", and
> > long int," each of which occupies the same amount of
> storage and has
> > the same alignment requirements (3.9) as the corresponding signed
> > integer type)
> You need the C standard to get the complete picture; it
> states that USHRT_MAX is at least 65535.
The corresponding section of the C Standard you're referring to states
[Appendix E:1, implementation limits (informative)]:
The contents of the header <limits.h> are given below, in alphabetical
minimum magnitudes shown shall be replaced by implementation-defined
with the same sign.
So no restriction imposed from the Standard here, AFAIU.
> Unsubscribe & other changes: