7.11 Structures, unions, enumerations, and bitfields
Describes implementation-defined aspects of the Arm® C compiler and C library relating to structures, unions, enumerations, and bitfields, as required by the ISO C standard.
- Whether a plain
int bit-field is treated as a signed
int bit-field or as an unsigned
int bit-field (6.7.2, 220.127.116.11).
int bitfields are signed.
- Allowable bit-field types other than
- Enumeration types,
long (signed and unsigned) are allowed as bitfield
- Whether atomic types are permitted for bit-fields (18.104.22.168).
- Atomic types are not permitted for bitfields.
- Whether a bit-field can straddle a storage-unit boundary (22.214.171.124).
- A bitfield cannot straddle a storage-unit boundary.
- The order of allocation of bit-fields within a unit (126.96.36.199).
- Within a storage unit, successive bit-fields are allocated from low-order
bits towards high-order bits when compiling for little-endian, or from the
high-order bits towards low-order bits when compiling for big-endian.
- The alignment of non-bit-field members of structures (188.8.131.52). This should present no
problem unless binary data written by one implementation is read by
- The non-bitfield members of structures of a scalar type are aligned to their
size. The non-bitfield members of an aggregate type are aligned to the maximum
of the alignments of each top-level member.
- The integer type compatible with each enumerated type (184.108.40.206).
- An enumerated type is compatible with
unsigned int. If both the signed and the
unsigned integer types can represent the values of the enumerators, the unsigned
variant is chosen. If a value of an enumerator cannot be represented with
unsigned int, then
long long or
unsigned long long is