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
intbit-field is treated as a signed
intbit-field or as an unsigned
intbit-field (6.7.2, 184.108.40.206).
intbitfields are signed.
- Allowable bit-field types other than
- Enumeration types,
long long(signed and unsigned) are allowed as bitfield types.
- Whether atomic types are permitted for bit-fields (220.127.116.11).
- Atomic types are not permitted for bitfields.
- Whether a bit-field can straddle a storage-unit boundary (18.104.22.168).
- A bitfield cannot straddle a storage-unit boundary.
- The order of allocation of bit-fields within a unit (22.214.171.124).
- 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 (126.96.36.199). This should present no problem unless binary data written by one implementation is read by another.
- 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 (188.8.131.52).
- 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
unsigned long longis used.