Getting started

Alex Martelli aleax at aleax.it
Thu Sep 26 10:28:11 EDT 2002


Thomas Heller wrote:
        ...
> Hidden fields in a union by the discretion of the compiler?
> Don't think that would be allowed by any C standard.

Could you help me out by pointing to chapter and verse that would
make it disallowed, please?  I can't find anything that would
disallow it, and it appears to me that the sentence:
"""
if the value of a member of a union object is used when the most recent 
store to the object was to a different member, the behavior is 
implementation- defined.
"""
(with the specific exception of unions of structs that share
a common initial sequence).

The specs for sizeof seem to go out of their way to NOT constrain
sizeof(aunion) to be the largest sizeof of union members, so as
to avoid prohibiting such internal tags -- it says the size is
*sufficient* to contain the largest member, NOT *is* that member's
size.


So, what _am_ I missing...?


Thanks,

Alex




More information about the Python-list mailing list