C11 6.2.5 P28:
A pointer to void shall 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.
48) The same representation and alignment requirements are meant to imply interchangeability as arguments to functions, return values from functions, and members of unions.
My doubt comes from Note 48.I don’t know what “interchangeability” here refers to and I haven’t found its official definition either.
I especially want to know what exactly is “interchangeability”?
why only the arguments of functions, the return values of functions and the members of unions are mentioned here as having “interchangeability”?
In other words, why doesn’t the standard say :”The same representation and alignment requirements are meant to imply interchangeability as members of structs.“?
To be honest, I have seen some people give examples of this. But basically they all follow this sentence and then give examples of what they think is “interchangeability”, as if you know the result and then make up the result,They didn’t explain why these three are special for “interchangeability”and didn’t explain what “interchangeability” is from the root first.
Can anyone answer my above doubts? If possible, could you give an appropriate example?
Thank you for your reading.