No, that's not a requirement, and I had not intended to imply that it
is one. It is a description of the bit patterns that justify
concluding that the requirement has been met; the description itself
is not part of the requirement.
Call it a description if you prefer, it still doesn't exist in
the standard.
If that were the only applicable requirement, yes. However, it's only
a meaningful requirement when you consider bit patterns where the bits
are actually set,
I would say that it's a meaningful requirement if each value bit
is allowed to take the value 1. If it does then the value it
contributes to the total value equals a power of 2.
and the standard does require the existence of such
bit patterns. The standard defines the meaning of the *_MAX and *_MIN
macros, and imposes minimum values for those which are positive, and
maximum values for those which are negative. This implies that
requirement you're referring to must hold true for all of those
values, not just 0, and for all the bits that need to be non-zero in
order to represent one or more of those values.
Ahhh but which values? Do you think for example that an int
should be able to represent all positive values from 1 to
INT_MAX or is it consistent with the standard that the only
representable positive value is INT_MAX and every other bit
pattern where the sign bit is 0 and at least one value bit is 1
may be a trap representation ? From my interpretation it follows
readily that all positive values from 1 to INT_MAX are
representable but I don't see how it follows from yours.
However, it's not
required to apply for values greater than INT_MAX, and the standard is
not as strict in it's requirements for the ranges of signed integer
types as it for the ranges of unsigned types.
I on the other hand believe that values greater than INT_MAX are
not representable because there aren't enough value bits to
represent them.
[...]
No, I'm saying that it would be redundant if your interpretation were
correct, which I deny.
Yes , that's what I thought you meant. And I was pointing out
that even if my interpretation is correct the only part which
may be redundant is "2**N - 1". Furthermore, regardless of whose
interpretation is correct, the "2**CHAR_BIT - 1" part in
footnote 40 is redundant.
It needs to be said precisely because it is not
redundant, because it implies that all possible combinations of bit
patterns must actually represent valid values, something which is not
otherwise deducible, and which is therefore not required for signed
integer types.
And as I said previously, even with my interpretation,
paragraph 1 still needs to explain how the values of individual
bits combine to give the total value. So the only question is
whether the maximum representable value (2**N - 1) needs to be
mentioned explicitly. It may be actually that even with your
interpretation we can conclude from the "pure binary
representation" part that the maximum representable value is
2**N - 1. So there's no difference in what paragraph 1 should
say regardless of whose interpretation is correct.
I'm drawing conclusions from it's failure to contain a similar
statement for signed integers.
I thought you were making the argument that if my interpretation
is correct then some bit in the standard is redundant therefore
my interpretation is less likely to be correct. And I was
replying to that that if my interpretation is correct the
part which may be redundant consists only of a few characters
(2**N - 1) and in any case a similar redundant part exists in
footnote 40 therefore the probability of my interpretation being
correct is not influenced by any such redundancies.
It doesn't need to say that; it's already been said when the concept
of trap representations were introduced. In the absence of a statement
to the contrary, the fact that trap representations are permitted to
exist implies that they can include value, sign, and padding bits.
Since a trap representation is the whole object representation
it obviously includes everything which may exist in the pattern.
But you are making the additional claim that even in the absence
of padding bits and even if the sign bit is 0 trap
representations are still possible. I would say that definitely
requires an explicit mention, if true.
No, I don't consider that there must be some hidden meaning. It seems
to me a quite open and obvious one. One clause, specifically
restricted to unsigned integer types, imposes a requirement. One
clause, specifically restricted to signed integer types, imposes no
such requirement. I don't see anything hidden about that - the
conclusion that the requirement applies only to unsigned integer types
seems quite natural to me. What would have to count as "hidden" is the
"inheritance" of this requirement by signed integer types.
There's no inheritance involved, only deduction. The hidden part
I referred to is "even in the absence....trap representations
are still possible" I mentioned above.
If you see a sign in an airport which says "Incoming passengers who
are not US citizens: use gates 1-4. You will have to pass through
Customs before you are allowed to leave the airport. Incoming
passengers who are US citizens: use gates 5-8." Would you conclude
that US citizens would have to go through Customs? That seems to me to
be implications of the "logic" you're using.
No I wouldn't conclude that US citizens would have to go through
customs but if the sign said in addition to your part, "Apart
from gates, US citizens must follow the same steps as non-US
citizens" I *would* conclude that US citizens have to go through
customs.