G
Guest
Barry said:n1124 says that UCHAR_MAX must be equal to 2^CHAR_BIT-1 which I
mentioned in my question. For SCHAR_MAX, there is no such
requirement. It is required to be at least (minimum value) 127 which
is 2^7-1 but for larger values of CHAR_BIT there is no additional
restriction. Again, if CHAR_BIT is 9, could SCHAR_MAX and CHAR_MAX be
173?
Again, no. The only allowed representation systems for signed integers
are those three. If SCHAR_MAX is 173 (or if INT_MAX is 99999), then
the representation system cannot be one of those three, so the
implementation would violate 6.2.6.2p2. The fact that there is an
explicit statement that UCHAR_MAX must equal 2^CHAR_BIT - 1 doesn't
seem relevant to me, because unsigned char is already a special case
(as the only integer type that may not contain trap representations or
padding bits).