Contents Index Previous Next
13.12 Pragma Restrictions
1
[A pragma
Restrictions expresses the user's intent to abide by certain restrictions.
This may facilitate the construction of simpler run-time environments.]
Syntax
2
The form of
a pragma Restrictions is as follows:
3
pragma Restrictions(
restriction{,
restriction});
4
restriction
::= restriction_identifier
|
restriction_parameter_identifier =>
expression
Name Resolution Rules
5
{expected type (restriction parameter
expression) [partial]} Unless otherwise
specified for a particular restriction, the
expression
is expected to be of any integer type.
Legality Rules
6
Unless otherwise specified for a particular restriction,
the expression shall be static,
and its value shall be nonnegative.
Static Semantics
7
The set of restrictions
is implementation defined.
7.a
Implementation defined: The
set of restrictions allowed in a
pragma Restrictions.
Post-Compilation Rules
8
{configuration pragma (Restrictions)
[partial]} {pragma, configuration
(Restrictions) [partial]} A
pragma
Restrictions is a configuration pragma; unless otherwise specified for
a particular restriction, a partition shall obey the restriction if a
pragma Restrictions applies to any
compilation unit included in the partition.
8.1/1
{
8652/0042}
For the purpose of checking whether a partition contains constructs that
violate any restriction (unless specified otherwise for a particular restriction):
8.2/1
- {8652/0042} Generic
instances are logically expanded at the point of instantiation;
8.3/1
- {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;
8.4/1
- {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
9
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.
9.a
Implementation defined: The
consequences of violating limitations on Restrictions pragmas.
9.b
Ramification: 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.
9.1/1
{
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.
9.2/1
{
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.
10
28 Restrictions intended to facilitate
the construction of efficient tasking run-time systems are defined in D.7.
Safety- and security-related restrictions are defined in H.4.
11
29 An implementation has
to enforce the restrictions in cases where enforcement is required, even
if it chooses not to take advantage of the restrictions in terms of efficiency.
11.a
Discussion: It is not the
intent that an implementation will support a different run-time system
for every possible combination of restrictions. An implementation might
support only two run-time systems, and document a set of restrictions
that is sufficient to allow use of the more efficient and safe one.
Extensions to Ada 83
11.b
{extensions to Ada 83}
Pragma Restrictions is new to Ada 95.
Contents Index Previous Next Legal