R
Richard Heathfield
pete said:
Yes, I think I wrote that one as I was going along, and forgot to go back
to edit out the claim that it is deducible. (It might yet be, but in fact
I failed to do it.)
Let's just say that I would certainly worry about the possibility of a
non-ASCII character set, I have been known to worry about the number of
bits in a byte being greater than 8, I might worry about the endianness of
a machine being different to the endianness of data in a file on that
machine, and I could even conceivably worry about the result of
right-shifting a negative value - but I would not be even slightly
concerned about the possibility of an implementation using more than
INT_MAX value bits in an unsigned int.
Richard Heathfield wrote:
You can't have it both ways.
If you can deduce from the standard that it
is representable as an int type value,
then there can't be an implementation,
psychopathological or otherwise,
where your function won't work.
Yes, I think I wrote that one as I was going along, and forgot to go back
to edit out the claim that it is deducible. (It might yet be, but in fact
I failed to do it.)
Let's just say that I would certainly worry about the possibility of a
non-ASCII character set, I have been known to worry about the number of
bits in a byte being greater than 8, I might worry about the endianness of
a machine being different to the endianness of data in a file on that
machine, and I could even conceivably worry about the result of
right-shifting a negative value - but I would not be even slightly
concerned about the possibility of an implementation using more than
INT_MAX value bits in an unsigned int.