-- reset to reference the value expression of the constant).
begin
- -- See if alignment check needed. Note that we never need a check if the
- -- maximum alignment is one, since the check will always succeed.
+ -- See if alignment check needed
-- Note: we do not check for checks suppressed here, since that check
-- was done in Sem_Ch13 when the address clause was processed. We are
-- check the status of check suppressing at the point of the address
-- clause.
- if No (AC)
- or else not Check_Address_Alignment (AC)
- or else Maximum_Alignment = 1
- then
+ if No (AC) or else not Check_Address_Alignment (AC) then
return;
end if;
.. index:: Maximum_Alignment
-``Standard'Maximum_Alignment`` (``Standard`` is the only
-allowed prefix) provides the maximum useful alignment value for the
-target. This is a static value that can be used to specify the alignment
-for an object, guaranteeing that it is properly aligned in all
-cases.
+``Standard'Maximum_Alignment`` (``Standard`` is the only allowed prefix)
+provides the maximum default alignment value for the target, that is to
+say the maximum alignment that the compiler may choose by default for a
+type or an object. Larger alignments are supported up to some maximum
+value dependent on the target, but may require specific mechanisms that
+are not needed up to ``Standard'Maximum_Alignment``.
Attribute Max_Integer_Size
==========================
For elementary types, the alignment is the minimum of the actual size of
objects of the type divided by ``Storage_Unit``,
- and the maximum alignment supported by the target.
- (This maximum alignment is given by the GNAT-specific attribute
+ and the maximum default alignment supported by the target.
+ (This maximum default alignment is given by the GNAT-specific attribute
``Standard'Maximum_Alignment``; see :ref:`Attribute_Maximum_Alignment`.)
.. index:: Maximum_Alignment attribute
strict alignment.
An alignment clause may specify a larger alignment than the default value
-up to some maximum value dependent on the target (obtainable by using the
-attribute reference ``Standard'Maximum_Alignment``). It may also specify
+up to some maximum value dependent on the target. It may also specify
a smaller alignment than the default value for enumeration, integer and
fixed point types, as well as for record types, for example
@geindex Maximum_Alignment
-@code{Standard'Maximum_Alignment} (@code{Standard} is the only
-allowed prefix) provides the maximum useful alignment value for the
-target. This is a static value that can be used to specify the alignment
-for an object, guaranteeing that it is properly aligned in all
-cases.
+@code{Standard'Maximum_Alignment} (@code{Standard} is the only allowed prefix)
+provides the maximum default alignment value for the target, that is to
+say the maximum alignment that the compiler may choose by default for a
+type or an object. Larger alignments are supported up to some maximum
+value dependent on the target, but may require specific mechanisms that
+are not needed up to @code{Standard'Maximum_Alignment}.
@node Attribute Max_Integer_Size,Attribute Mechanism_Code,Attribute Maximum_Alignment,Implementation Defined Attributes
@anchor{gnat_rm/implementation_defined_attributes attribute-max-integer-size}@anchor{1aa}
For elementary types, the alignment is the minimum of the actual size of
objects of the type divided by @code{Storage_Unit},
-and the maximum alignment supported by the target.
-(This maximum alignment is given by the GNAT-specific attribute
+and the maximum default alignment supported by the target.
+(This maximum default alignment is given by the GNAT-specific attribute
@code{Standard'Maximum_Alignment}; see @ref{1a8,,Attribute Maximum_Alignment}.)
@geindex Maximum_Alignment attribute
@end itemize
An alignment clause may specify a larger alignment than the default value
-up to some maximum value dependent on the target (obtainable by using the
-attribute reference @code{Standard'Maximum_Alignment}). It may also specify
+up to some maximum value dependent on the target. It may also specify
a smaller alignment than the default value for enumeration, integer and
fixed point types, as well as for record types, for example
Set_Has_Alignment_Clause (U_Ent);
-- Tagged type case, check for attempt to set alignment to a
- -- value greater than Max_Align, and reset if so.
+ -- value greater than Maximum_Alignment, and reset if so.
if Is_Tagged_Type (U_Ent) and then Align > Max_Align then
Error_Msg_N
----------------------------------------
Maximum_Alignment : constant Pos := Set_Targ.Maximum_Alignment;
- -- The maximum alignment, in storage units, that an object or type may
- -- require on the target machine.
+ -- The maximum default alignment, in storage units, that an object or type
+ -- may require on the target machine. The implementation must never choose
+ -- a larger alignment on its own, that is to say when it is not explicitly
+ -- requested by an alignment aspect/clause in the source code.
System_Allocator_Alignment : constant Pos :=
Set_Targ.System_Allocator_Alignment;