Contents Index Search Previous Next
10.1.5 Pragmas and Program Units
This subclause discusses pragmas related to program
units, library units, and compilations.
Name Resolution Rules
s are defined to be program
given as the argument of a program unit pragma shall resolve to denote
the declarations or renamings of one or more program units that occur
immediately within the declarative region or compilation
in which the pragma
occurs, or it shall resolve to denote the declaration of the immediately
enclosing program unit (if any); the pragma
applies to the denoted program unit(s). If there are no name
given as arguments, the pragma
to the immediately enclosing program unit.
A program unit pragma
shall appear in one of these places:
- At the place of a compilation_unit,
in which case the pragma shall immediately
follow in the same compilation (except
for other pragmas) a library_unit_declaration
that is a subprogram_declaration,
or generic_instantiation, and the
pragma shall have an argument that
is a name denoting that declaration.
- Immediately within the declaration
of a program unit and before any nested declaration (but not within a
generic formal part), in which case the argument, if any, shall be a
direct_name that denotes the immediately
enclosing program unit declaration.
- At the place of a declaration other
than the first, of a declarative_part
or program unit declaration, in which case the pragma
shall have an argument, which shall be a direct_name
that denotes one or more of the following (and nothing else): a subprogram_declaration,
or a generic_instantiation, of the
same declarative_part or program
program unit pragmas are defined to be library unit pragmas
, if any, in a library unit
pragma shall denote the declaration of a library unit.
A library unit pragma that applies to a generic
unit does not apply to its instances, unless a specific rule for the
pragma specifies the contrary.
s are defined to be configuration
; they shall appear before the first compilation_unit
of a compilation
. They are generally
used to select a partition-wide or system-wide option. The pragma
applies to all compilation_unit
appearing in the compilation
there are none, in which case it applies to all future compilation_unit
compiled into the same environment.
An implementation may place restrictions on configuration
pragmas, so long as it allows them when the environment contains no library_items
other than those of the predefined environment.
When applied to a generic unit, a program
unit pragma that is not a library unit pragma should apply to each instance
of the generic unit for which there is not an overriding pragma applied
directly to the instance.
Contents Index Search Previous Next Legal