| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.9 Structures, unions, enumerations, and bit-fields
-
A member of a union object is accessed using a member of a
different type (C90 6.3.2.3).
The relevant bytes of the representation of the object are treated as an object of the type used for the access. See Type-punning. This may be a trap representation.
-
Whether a “plain”
intbit-field is treated as asigned intbit-field or as anunsigned intbit-field (C90 6.5.2, C90 6.5.2.1, C99 6.7.2, C99 6.7.2.1).By default it is treated as
signed intbut this may be changed by the ‘-funsigned-bitfields’ option. -
Allowable bit-field types other than
_Bool,signed int, andunsigned int(C99 6.7.2.1).No other types are permitted in strictly conforming mode.
-
Whether a bit-field can straddle a storage-unit boundary (C90
6.5.2.1, C99 6.7.2.1).
Determined by ABI.
-
The order of allocation of bit-fields within a unit (C90
6.5.2.1, C99 6.7.2.1).
Determined by ABI.
-
The alignment of non-bit-field members of structures (C90
6.5.2.1, C99 6.7.2.1).
Determined by ABI.
-
The integer type compatible with each enumerated type (C90
6.5.2.2, C99 6.7.2.2).
Normally, the type is
unsigned intif there are no negative values in the enumeration, otherwiseint. If ‘-fshort-enums’ is specified, then if there are negative values it is the first ofsigned char,shortandintthat can represent all the values, otherwise it is the first ofunsigned char,unsigned shortandunsigned intthat can represent all the values.On some targets, ‘-fshort-enums’ is the default; this is determined by the ABI.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on October 19, 2013 using texi2html 5.0.
