
21 Sep
2006
21 Sep
'06
1:46 p.m.
Peter Dimov wrote:
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 order. The minimum magnitudes shown shall be replaced by implementation-defined magnitudes with the same sign.
So no restriction imposed from the Standard here, AFAIU.
Ok, I found it. You're right. It's in the C Standard: 5.2.4.2.1 Sizes of integer types <limits.h>: maximum value for an object of type unsigned short int USHRT_MAX 65535 // 2^16 - 1 Sorry for the noise. Regards Hartmut