B
Ben Bacarisse
James Kuyper said:Ben Bacarisse wrote:
...
6.5p4 says "Some operators (the unary operator ~, and the binary
operators <<, >>, &, ^, and |, collectively described as bitwise
operators) are required to have operands that have integer type. These
operators yield values that depend on the internal representations of
integers, and have implementation-defined and undefined aspects for
signed types".
As I understand it, that statement about the "internal
representations" refers to the object representation, and does not
imply that the standard attaches any meaning to the representation of
a value that is not currently stored in any C object.
I can accept that this is the intent, but I do not think it is clear
and unambiguous. Since it can't be detected by a C program, I don't
really care if there is one representation (when a value is stored) or
another, transient one, as well. The latter just seemed to me a
convenient expository device for exactly these cases, but if it is a
fiction of my imagination, so be it!
It merely
requires that the bitwise operators act on values in such a way that
if the resulting value were saved in an object of that value's type,
it would have the correct bit pattern.
...
That's exactly how I understand it. I never denied that the allowed
representations were referenced,
Well that was exactly what I thought you were doing when you said:
"In general, the bitwise operations are defined in terms of their
actions on the values, not the representations."
I just can't square this with your last remark above. For four of the
six, the representation is a required part of the definition.