Keith said:
I would expect, in most implementations, that the pointer passed to
free() will retain its previous representation (it's been argued that
this is required),
The standard explicitly allows representations to change during writes,
but not explicitly during reads, and since every object can be accessed
as an array of unsigned char, where each element is itself an object
which must "[retain] its last-stored value throughout its lifetime", I
would've thought this is required.
However, according to
http://open-std.org/JTC1/SC22/WG14/www/docs/dr_260.htm
it is not. I'm not sure what to say about it, though, other than that
another part of the response already directly contradicts the standard:
"If two objects have identical bit-pattern representations and their
types are the same they may still compare as unequal [...]"
6.2.6.1#4: "Two values (other than NaNs) with the same object
representation compare equal,"
"[...] (for example if one object has an indeterminate value) and if
one is an indeterminate value attempting to read such an object invokes
undefined behavior."
If either is an indeterminate value, the behaviour is undefined before
any comparison is made. This means indeterminate values are not an
example of the above.