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, 6.7.2.1).
Plain int bitfields are signed.
Allowable bit-field types other than _Bool, signed int, and unsigned int (6.7.2.1).
Enumeration types, long and long long (signed and unsigned) are allowed as bitfield types.
Whether atomic types are permitted for bit-fields (6.7.2.1).
Atomic types are not permitted for bitfields.
Whether a bit-field can straddle a storage-unit boundary (6.7.2.1).
A bitfield cannot straddle a storage-unit boundary.
The order of allocation of bit-fields within a unit (6.7.2.1).
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 (6.7.2.1). 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 (6.7.2.2).
An enumerated type is compatible with int or 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 int or unsigned int, then long long or unsigned long long is used.
Non-ConfidentialPDF file icon PDF versionDUI0774J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.