Next: Pragma Convention_Identifier, Previous: Pragma Complex_Representation, Up: Implementation Defined Pragmas
pragma Component_Alignment ( [Form =>] ALIGNMENT_CHOICE [, [Name =>] type_LOCAL_NAME]); ALIGNMENT_CHOICE ::= Component_Size | Component_Size_4 | Storage_Unit | Default
Specifies the alignment of components in array or record types. The meaning of the Form argument is as follows:
Component_Size
Component_Size_4
Storage_Unit
System.Storage_Unit
.
Default
Default
choice is the same as
the Storage_Unit
choice (byte alignment). For all other systems,
the Default
choice is the same as Component_Size
(natural
alignment).
If the Name
parameter is present, type_LOCAL_NAME must
refer to a local record or array type, and the specified alignment
choice applies to the specified type. The use of
Component_Alignment
together with a pragma Pack
causes the
Component_Alignment
pragma to be ignored. The use of
Component_Alignment
together with a record representation clause
is only effective for fields not specified by the representation clause.
If the Name
parameter is absent, the pragma can be used as either
a configuration pragma, in which case it applies to one or more units in
accordance with the normal rules for configuration pragmas, or it can be
used within a declarative part, in which case it applies to types that
are declared within this declarative part, or within any nested scope
within this declarative part. In either case it specifies the alignment
to be applied to any record or array type which has otherwise standard
representation.
If the alignment for a record or array type is not specified (using
pragma Pack
, pragma Component_Alignment
, or a record rep
clause), the GNAT uses the default alignment as described previously.