gcc: Structures unions enumerations and bit-fields implementation
1
1 4.9 Structures, Unions, Enumerations, and Bit-Fields
1 ====================================================
1
1 * 'A member of a union object is accessed using a member of a
1 different type (C90 6.3.2.3).'
1
1 The relevant bytes of the representation of the object are treated
11 as an object of the type used for the access. ⇒
Type-punning. This may be a trap representation.
1
1 * 'Whether a "plain" 'int' bit-field is treated as a 'signed int'
1 bit-field or as an 'unsigned int' bit-field (C90 6.5.2, C90
1 6.5.2.1, C99 and C11 6.7.2, C99 and C11 6.7.2.1).'
1
1 By default it is treated as 'signed int' but this may be changed by
1 the '-funsigned-bitfields' option.
1
1 * 'Allowable bit-field types other than '_Bool', 'signed int', and
1 'unsigned int' (C99 and C11 6.7.2.1).'
1
1 Other integer types, such as 'long int', and enumerated types are
1 permitted even in strictly conforming mode.
1
1 * 'Whether atomic types are permitted for bit-fields (C11 6.7.2.1).'
1
1 Atomic types are not permitted for bit-fields.
1
1 * 'Whether a bit-field can straddle a storage-unit boundary (C90
1 6.5.2.1, C99 and C11 6.7.2.1).'
1
1 Determined by ABI.
1
1 * 'The order of allocation of bit-fields within a unit (C90 6.5.2.1,
1 C99 and C11 6.7.2.1).'
1
1 Determined by ABI.
1
1 * 'The alignment of non-bit-field members of structures (C90 6.5.2.1,
1 C99 and C11 6.7.2.1).'
1
1 Determined by ABI.
1
1 * 'The integer type compatible with each enumerated type (C90
1 6.5.2.2, C99 and C11 6.7.2.2).'
1
1 Normally, the type is 'unsigned int' if there are no negative
1 values in the enumeration, otherwise 'int'. If '-fshort-enums' is
1 specified, then if there are negative values it is the first of
1 'signed char', 'short' and 'int' that can represent all the values,
1 otherwise it is the first of 'unsigned char', 'unsigned short' and
1 'unsigned int' that can represent all the values.
1
1 On some targets, '-fshort-enums' is the default; this is determined
1 by the ABI.
1