D
Dietmar Schindler
Eric said:..., but I agree that all struct pointers have the same
representation (because the Standard says so, in 6.2.5/26).
However, a shared representation does not imply a common
universe of values! The value of a representation depends on
the type of the expression that accesses it. A particular
representation R (a "bit pattern," if that's more down-to-earth)
may be a value for a `struct S*' but a trap representation for a
`struct T*'. A pointer representation that doesn't satisfy the
alignment requirements of the pointed-to type is not a value
(in the sense that C uses the term) but a trap representation.
The statement "All pointers to structure types shall have the same
representation ... as each other" in 6.2.5/26 leaves no room for
restriction to certain values.
Also, I see no wording in the standard which said that a misaligned
pointer would be a trap representation.