The C standard mandates that all pointers to unions have the same representation and alignment requirements.
It mandates the same for all pointers to structs.
Thus my question:
Why does the standard not mandate that pointers to unions have the same representation and alignment requirements as pointers to structs? (I would very much appreciate an example of an implementation taking advantage of this.)
Or did I simply miss the relevant text?
The relevant quote from the draft standard n1570 (C11 final draft):
6.2.5 Types ยง 28
A pointer to
voidshall have the same representation and alignment requirements as a pointer to a character type.48) Similarly, pointers to qualified or unqualified versions of compatible types shall have the same representation and alignment requirements. All pointers to structure types shall have the same representation and alignment requirements as each other. All pointers to union types shall have the same representation and alignment requirements as each other. Pointers to other types need not have the same representation or alignment requirements.
inthave the same representation and alignment requirements as pointers tochar? - CMPS