James Kuyper
2024-11-23 14:43:37 UTC
...
quoted above that says, "the entire range values is expressible
in a signed int." This implies UCHAR_MAX <= INT_MAX. (By
"values" I meant, "values of that type", not specific values in
any given program).
You paired that assertion with "`unsigned char` has _rank_
lower than _int_", which is a fact guaranteed by the standard, which
could easily give the impression that the comment about the range of
values was either explicitly stated in the standard, or correctly
inferrable from the statement about the ranks.
...
promotions is being unnecessarily vague. Your description only covers
the integer promotions, it doesn't cover any of the other usual
arithmetic conversions.
The integer promotions were the only relevant part in context.
Perhaps it would have allayed your concerns to say, "part of"?
Partially. However since you described the integer promotions, and the
description you provided didn't fit any other part of the usual
arithmetic conversions, and the part you described has it's own special
name, and the integer promotions can occur without the usual arithmetic
conversions, it still seems to me more appropriate to say that what you
described were the integer promotions.
Your wording could easily give the false impression, to anyone who
didn't already know better, that promotion of unsigned char to signed
int is required by the standard, rather than it being dependent upon
whether UCHAR_MAX > INT_MAX.
Actually I'm not sure that it did. Note the part that youdidn't already know better, that promotion of unsigned char to signed
int is required by the standard, rather than it being dependent upon
whether UCHAR_MAX > INT_MAX.
quoted above that says, "the entire range values is expressible
in a signed int." This implies UCHAR_MAX <= INT_MAX. (By
"values" I meant, "values of that type", not specific values in
any given program).
lower than _int_", which is a fact guaranteed by the standard, which
could easily give the impression that the comment about the range of
values was either explicitly stated in the standard, or correctly
inferrable from the statement about the ranks.
...
... Since we're talking about operands to
a binary operator, 6.3.1.8 applies. 6.3.1.8 is why converting
one side to unsigned is sufficient to get an unsigned result.
Calling them the usual arithmetic conversions rather than the integera binary operator, 6.3.1.8 applies. 6.3.1.8 is why converting
one side to unsigned is sufficient to get an unsigned result.
promotions is being unnecessarily vague. Your description only covers
the integer promotions, it doesn't cover any of the other usual
arithmetic conversions.
Perhaps it would have allayed your concerns to say, "part of"?
description you provided didn't fit any other part of the usual
arithmetic conversions, and the part you described has it's own special
name, and the integer promotions can occur without the usual arithmetic
conversions, it still seems to me more appropriate to say that what you
described were the integer promotions.