13.12.1 Language-Defined Restrictions and ProfilesLanguage-Defined Restrictions
Static Semantics
{
AI95-00257-01}
The following restriction_identifiers
are language defined (additional restrictions are defined in the Specialized
Needs Annexes):
There are no implementation-defined aspects specified
by an aspect_specification.
This restriction applies only to the current compilation or environment,
not the entire partition.
Discussion: {
AI05-0241-1}
This restriction (as well as others below) applies
only to the current compilation, because it is likely that the runtime
(and possibly user-written low-level code) will need to use implementation-defined
aspects. But a partition-wide restriction applies everywhere, including
the runtime.
There are no implementation-defined attributes.
This restriction applies only to the current compilation or environment,
not the entire partition.
Discussion: {
AI05-0241-1}
This
restriction (as well as No_Implementation_Pragmas) only applies to the
current compilation, because it is likely that the runtime (and possibly
user-written low-level code) will need to use implementation-defined
entities. But a partition-wide restriction applies everywhere, including
the runtime.
There are no usage names that denote declarations
with implementation-defined identifiers that occur within language-defined
packages or instances of language-defined generic packages. Such identifiers
can arise as follows:
The
following language-defined packages and generic packages allow implementation-defined
identifiers:
package System
(see 13.7);
package Standard
(see A.1);
package Ada.Command_Line
(see A.15);
package Interfaces.C
(see B.3);
package Interfaces.C.Strings
(see B.3.1);
package Interfaces.C.Pointers
(see B.3.2);
package Interfaces.COBOL
(see B.4);
package Interfaces.Fortran
(see B.5);
The
following language-defined packages contain only implementation-defined
identifiers:
package System.Machine_Code
(see 13.8);
package Ada.Directories.Information
(see A.16);
nested Implementation
packages of the Queue containers (see A.18.28-31);
package Interfaces
(see B.2);
package Ada.Interrupts.Names
(see C.3.2).
For package Standard,
Standard.Long_Integer and Standard.Long_Float are considered language-defined
identifiers, but identifiers such as Standard.Short_Short_Integer are
considered implementation-defined.
This restriction
applies only to the current compilation or environment, not the entire
partition.
There are no implementation-defined pragmas or
pragma arguments. This restriction applies only to the current compilation
or environment, not the entire partition.
There is no mention in the context_clause
of any implementation-defined descendants of packages Ada, Interfaces,
or System. This restriction applies only to the current compilation or
environment, not the entire partition.
There is no use of language features defined in
Annex J. It is implementation defined whether implementation-defined
if uses of the renamings of J.1
and of the pragmas
of J.15 are detected
by this restriction. This restriction applies only to the current compilation
or environment, not the entire partition.
Reason:
A user could compile a rename like
with Ada.Text_IO;
package Text_IO renames Ada.Text_IO;
Such a rename must not
be disallowed by this restriction, nor should the compilation of such
a rename be restricted by an implementation. Many implementations implement
the renames of J.1 by compiling them normally;
we do not want to require implementations to use a special mechanism
to implement these renames.
{
AI05-0229-1}
The pragmas have the same functionality as the
corresponding aspect (unlike the typical obsolescent feature), and rejecting
them could be a significant portability problem for existing code.
Specifies a library unit on which there are no
semantic dependences.
Identifies an attribute for which no attribute_reference
or attribute_definition_clause
is given.
Identifies a pragma
which is not to be used.
Legality Rules
Ramification: This
name is not
resolved.
Ramification: This
restriction_parameter_argument
is not resolved as it is an identifier specific to a pragma. As for No_Dependence,
there is no check that the aspect identifier
is meaningful; it might refer to an implementation-defined aspect on
one implementation, but nothing at all on another implementation.
Ramification: This
restriction_parameter_argument
is not resolved as it is an identifier specific to a pragma. There is
no check that the attribute identifier refers to a known attribute_designator;
it might refer to an implementation-defined attribute on one implementation,
but nothing at all on another implementation.
Ramification: This
restriction_parameter_argument
is not resolved as it is an identifier specific to a pragma. There is
no check that the pragma identifier refers to a known pragma;
it might refer to an implementation-defined pragma on one implementation,
but nothing at all on another implementation.
Post-Compilation Rules
{
AI95-00381-01}
{
AI05-0241-1}
No compilation unit included in the partition shall
depend semantically on the library unit identified by the name of a No_Dependence restriction.
Ramification: There
is no requirement that the library unit actually exist. One possible
use of the pragma is to prevent the use of implementation-defined units;
when the program is ported to a different compiler, it is perfectly reasonable
that no unit with the name exist.
Static Semantics
{
AI05-0246-1}
The No_Implementation_Extensions usage profile
is equivalent to the following restrictions:
No_Implementation_Aspect_Specifications,
No_Implementation_Attributes,
No_Implementation_Identifiers,
No_Implementation_Pragmas,
No_Implementation_Units.
Extensions to Ada 95
{
AI95-00257-01}
{
AI95-00368-01}
Restrictions No_Implementation_Attributes,
No_Implementation_Pragmas, and No_Obsolescent_Features are new.
Extensions to Ada 2005
{
AI05-0241-1}
{
AI05-0242-1}
{
AI05-0246-1}
{
AI05-0272-1}
Restrictions No_Implementation_Aspect_Specifications,
No_Implementation_Identifiers, No_Implementation_Units, No_Specification_of_Aspect,
No_Use_of_Attribute, and No_Use_of_Pragma are new.
{
AI05-0246-1}
Profile No_Implementation_Extensions is new.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe