Skip to main content

IAR Embedded Workbench for RH850 3.20.x

J.3.9 Structures, unions, enumerations, and bitfields

In this section:
Sign of 'plain' bitfields (6.7.2, 6.7.2.1)

For information about how a 'plain' int bitfield is treated, see Bitfields.

Possible types for bitfields (6.7.2.1)

All integer types can be used as bitfields in the compiler’s extended mode, see -e.

Atomic types for bitfields (6.7.2.1)

Atomic types cannot be used as bitfields.

Bitfields straddling a storage-unit boundary (6.7.2.1)

Unless __attribute__((packed)) (a GNU language extension) is used, a bitfield is always placed in one—and one only—storage unit, and thus does not straddle a storage-unit boundary.

Allocation order of bitfields within a unit (6.7.2.1)

For information about how bitfields are allocated within a storage unit, see Bitfields.

Alignment of non-bitfield structure members (6.7.2.1)

The alignment of non-bitfield members of structures is the same as for the member types, see Alignment.

Integer type used for representing enumeration types (6.7.2.2)

The chosen integer type for a specific enumeration type depends on the enumeration constants defined for the enumeration type. The chosen integer type is the smallest possible.