13.12 Pragma Restrictions and Pragma Profile
This Reference Manual output has not been verified, and may contain omissions or errors. Report any problems on the tracking issue
[A pragma
Restrictions expresses the user's intent to abide by certain restrictions. A pragma
Profile expresses the user's intent to abide by a set of Restrictions or other specified run-time policies. These may facilitate the construction of simpler run-time environments.]
Syntax
2The form of a pragma
Restrictions is as follows:
pragma Restrictions(restriction
{, restriction
});
restriction
::=
restriction_identifier
| restriction_parameter_identifier
=> restriction_parameter_argument
4.1/2
restriction_parameter_argument
::=
name
| expression
Name Resolution Rules
5Unless otherwise specified for a particular restriction, the expression
is expected to be of any integer type.
Legality Rules
6Unless otherwise specified for a particular restriction, the expression
shall be static, and its value shall be nonnegative.
Paragraph 7 was deleted.
Post-Compilation Rules
8/3A pragma
Restrictions is a configuration pragma. If a pragma
Restrictions applies to any compilation unit included in the partition, this may impose either (or both) of two kinds of requirements, as specified for the particular restriction:
- A restriction may impose requirements on some or all of the units comprising the partition. Unless otherwise specified for a particular restriction, such a requirement applies to all of the units comprising the partition and is enforced via a post-compilation check.
- A restriction may impose requirements on the run-time behavior of the program, as indicated by the specification of run-time behavior associated with a violation of the requirement.
In this latter case, there is no post-compilation check needed for the requirement.
{8652/0042} For the purpose of checking whether a partition contains constructs that violate any restriction (unless specified otherwise for a particular restriction):
- {8652/0042} Generic instances are logically expanded at the point of instantiation;
- {8652/0042} If an object of a type is declared or allocated and not explicitly initialized, then all expressions appearing in the definition for the type and any of its ancestors are presumed to be used;
- {8652/0042} A
default_expression
for a formal parameter or a generic formal object is considered to be used if and only if the corresponding actual parameter is not provided in a given call or instantiation.
Implementation Permissions
8.7/3An implementation may provide implementation-defined restrictions; the identifier for an implementation-defined restriction shall differ from those of the language-defined restrictions.
An implementation may place limitations on the values of the expression
that are supported, and limitations on the supported combinations of restrictions. The consequences of violating such limitations are implementation defined.
Such limitations may be enforced at compile time or at run time. Alternatively, the implementation is allowed to declare violations of the restrictions to be erroneous, and not enforce them at all.
{8652/0042} An implementation is permitted to omit restriction checks for code that is recognized at compile time to be unreachable and for which no code is generated.
{8652/0043} Whenever enforcement of a restriction is not required prior to execution, an implementation may nevertheless enforce the restriction prior to execution of a partition to which the restriction applies, provided that every execution of the partition would violate the restriction.
Syntax
10/3The form of a pragma
Profile is as follows:
pragma Profile (profile_identifier
{, profile_pragma_argument_association
});
Legality Rules
12/3The profile_identifier
shall be the name of a usage profile. The semantics of any profile_pragma_argument_association
s are defined by the usage profile specified by the profile_identifier
.