aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/doc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2017-09-08 12:34:54 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2017-09-08 14:34:54 +0200
commit08705a15833a3df17b372fcf2a03ea9b017b2453 (patch)
tree52e5a3645dd1fa186152c67d947a9f736b5b6827 /gcc/ada/doc
parent9651fbafd1d66bd4ca357387e9e33991907b2509 (diff)
downloadgcc-08705a15833a3df17b372fcf2a03ea9b017b2453.zip
gcc-08705a15833a3df17b372fcf2a03ea9b017b2453.tar.gz
gcc-08705a15833a3df17b372fcf2a03ea9b017b2453.tar.bz2
gnat_rm.texi, [...]: Update documentation.
* gnat_rm.texi, gnat_ugn.texi, doc/gnat_ugn/the_gnat_compilation_model.rst, doc/gnat_ugn/getting_started_with_gnat.rst, doc/gnat_ugn/inline_assembler.rst, doc/gnat_ugn/building_executable_programs_with_gnat.rst, doc/gnat_ugn/elaboration_order_handling_in_gnat.rst, doc/gnat_ugn/about_this_guide.rst, doc/gnat_ugn/platform_specific_information.rst, doc/gnat_ugn/example_of_binder_output.rst, doc/gnat_ugn/gnat_and_program_execution.rst, doc/gnat_ugn/gnat_utility_programs.rst, doc/gnat_rm/implementation_of_specific_ada_features.rst, doc/gnat_rm/interfacing_to_other_languages.rst, doc/gnat_rm/implementation_defined_aspects.rst, doc/gnat_rm/intrinsic_subprograms.rst, doc/gnat_rm/implementation_defined_characteristics.rst, doc/gnat_rm/implementation_advice.rst, doc/gnat_rm/implementation_defined_attributes.rst, doc/gnat_rm/compatibility_and_porting_guide.rst, doc/gnat_rm/standard_library_routines.rst, doc/gnat_rm/the_gnat_library.rst, doc/gnat_rm/implementation_defined_pragmas.rst, doc/gnat_rm/representation_clauses_and_pragmas.rst, doc/gnat_rm/standard_and_implementation_defined_restrictions.rst, doc/gnat_rm/obsolescent_features.rst, doc/gnat_rm/about_this_guide.rst, doc/gnat_rm/the_implementation_of_standard_i_o.rst, doc/gnat_rm/implementation_of_ada_2012_features.rst, doc/gnat_ugn.rst, doc/gnat_rm.rst: Update documentation. From-SVN: r251889
Diffstat (limited to 'gcc/ada/doc')
-rw-r--r--gcc/ada/doc/gnat_rm.rst42
-rw-r--r--gcc/ada/doc/gnat_rm/about_this_guide.rst8
-rw-r--r--gcc/ada/doc/gnat_rm/compatibility_and_porting_guide.rst114
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_advice.rst364
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst84
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst477
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst318
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst1494
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_of_ada_2012_features.rst244
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_of_specific_ada_features.rst107
-rw-r--r--gcc/ada/doc/gnat_rm/interfacing_to_other_languages.rst42
-rw-r--r--gcc/ada/doc/gnat_rm/intrinsic_subprograms.rst50
-rw-r--r--gcc/ada/doc/gnat_rm/obsolescent_features.rst30
-rw-r--r--gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst329
-rw-r--r--gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst92
-rw-r--r--gcc/ada/doc/gnat_rm/standard_library_routines.rst94
-rw-r--r--gcc/ada/doc/gnat_rm/the_gnat_library.rst856
-rw-r--r--gcc/ada/doc/gnat_rm/the_implementation_of_standard_i_o.rst202
-rw-r--r--gcc/ada/doc/gnat_ugn.rst44
-rw-r--r--gcc/ada/doc/gnat_ugn/about_this_guide.rst14
-rw-r--r--gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst2805
-rw-r--r--gcc/ada/doc/gnat_ugn/elaboration_order_handling_in_gnat.rst470
-rw-r--r--gcc/ada/doc/gnat_ugn/example_of_binder_output.rst6
-rw-r--r--gcc/ada/doc/gnat_ugn/getting_started_with_gnat.rst60
-rw-r--r--gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst1082
-rw-r--r--gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst1820
-rw-r--r--gcc/ada/doc/gnat_ugn/inline_assembler.rst218
-rw-r--r--gcc/ada/doc/gnat_ugn/platform_specific_information.rst552
-rw-r--r--gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst1086
29 files changed, 6745 insertions, 6359 deletions
diff --git a/gcc/ada/doc/gnat_rm.rst b/gcc/ada/doc/gnat_rm.rst
index e18d178..9360a8f 100644
--- a/gcc/ada/doc/gnat_rm.rst
+++ b/gcc/ada/doc/gnat_rm.rst
@@ -1,37 +1,39 @@
GNAT Reference Manual
=====================
-*GNAT, The GNU Ada Development Environment*
+.. only:: not latex
-.. only:: PRO
+ *GNAT, The GNU Ada Development Environment*
- *GNAT Pro Edition*
+ .. only:: PRO
- | Version |version|
- | Date: |today|
+ *GNAT Pro Edition*
-.. only:: GPL
+ | Version |version|
+ | Date: |today|
- *GNAT GPL Edition*
+ .. only:: GPL
- | Version |version|
- | Date: |today|
+ *GNAT GPL Edition*
-.. only:: FSF
+ | Version |version|
+ | Date: |today|
- .. raw:: texinfo
+ .. only:: FSF
- @include gcc-common.texi
- GCC version @value{version-GCC}@*
+ .. raw:: texinfo
-AdaCore
+ @include gcc-common.texi
+ GCC version @value{version-GCC}@*
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, with the Front-Cover Texts being "GNAT Reference
-Manual", and with no Back-Cover Texts. A copy of the license is
-included in the section entitled :ref:`gnu_fdl`.
+ AdaCore
+
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3 or
+ any later version published by the Free Software Foundation; with no
+ Invariant Sections, with the Front-Cover Texts being "GNAT Reference
+ Manual", and with no Back-Cover Texts. A copy of the license is
+ included in the section entitled :ref:`gnu_fdl`.
.. toctree::
:numbered:
diff --git a/gcc/ada/doc/gnat_rm/about_this_guide.rst b/gcc/ada/doc/gnat_rm/about_this_guide.rst
index 8071b42..b48785e 100644
--- a/gcc/ada/doc/gnat_rm/about_this_guide.rst
+++ b/gcc/ada/doc/gnat_rm/about_this_guide.rst
@@ -130,14 +130,14 @@ Conventions
Following are examples of the typographical and graphic conventions used
in this guide:
-* `Functions`, `utility program names`, `standard names`,
- and `classes`.
+* ``Functions``, ``utility program names``, ``standard names``,
+ and ``classes``.
-* `Option flags`
+* ``Option flags``
* :file:`File names`
-* `Variables`
+* ``Variables``
* *Emphasis*
diff --git a/gcc/ada/doc/gnat_rm/compatibility_and_porting_guide.rst b/gcc/ada/doc/gnat_rm/compatibility_and_porting_guide.rst
index a859761..5a20995 100644
--- a/gcc/ada/doc/gnat_rm/compatibility_and_porting_guide.rst
+++ b/gcc/ada/doc/gnat_rm/compatibility_and_porting_guide.rst
@@ -16,7 +16,7 @@ Writing Portable Fixed-Point Declarations
=========================================
The Ada Reference Manual gives an implementation freedom to choose bounds
-that are narrower by `Small` from the given bounds.
+that are narrower by ``Small`` from the given bounds.
For example, if we write
.. code-block:: ada
@@ -31,7 +31,7 @@ look at this, and figure out how to avoid these problems.
First, why does this freedom exist, and why would an implementation
take advantage of it? To answer this, take a closer look at the type
-declaration for `F1` above. If the compiler uses the given bounds,
+declaration for ``F1`` above. If the compiler uses the given bounds,
it would need 9 bits to hold the largest positive value (and typically
that means 16 bits on all machines). But if the implementation chooses
the +127.0 bound then it can fit values of the type in 8 bits.
@@ -67,7 +67,7 @@ We could imagine three types of implementation:
(a) those that narrow the range automatically if they can figure
out that the narrower range will allow storage in a smaller machine unit,
-(b) those that will narrow only if forced to by a `'Size` clause, and
+(b) those that will narrow only if forced to by a ``'Size`` clause, and
(c) those that will never narrow.
@@ -90,9 +90,9 @@ and no real compiler would do this. All real compilers will fall into one of
the categories (a), (b) or (c) above.
So, how do you get the compiler to do what you want? The answer is give the
-actual bounds you want, and then use a `'Small` clause and a
-`'Size` clause to absolutely pin down what the compiler does.
-E.g., for `F2` above, we will write:
+actual bounds you want, and then use a ``'Small`` clause and a
+``'Size`` clause to absolutely pin down what the compiler does.
+E.g., for ``F2`` above, we will write:
.. code-block:: ada
@@ -161,7 +161,7 @@ Ada 95 and later versions of the standard:
* *Character literals*
Some uses of character literals are ambiguous. Since Ada 95 has introduced
- `Wide_Character` as a new predefined character type, some uses of
+ ``Wide_Character`` as a new predefined character type, some uses of
character literals that were legal in Ada 83 are illegal in Ada 95.
For example:
@@ -170,7 +170,7 @@ Ada 95 and later versions of the standard:
for Char in 'A' .. 'Z' loop ... end loop;
The problem is that 'A' and 'Z' could be from either
- `Character` or `Wide_Character`. The simplest correction
+ ``Character`` or ``Wide_Character``. The simplest correction
is to make the type explicit; e.g.:
.. code-block:: ada
@@ -179,8 +179,8 @@ Ada 95 and later versions of the standard:
* *New reserved words*
- The identifiers `abstract`, `aliased`, `protected`,
- `requeue`, `tagged`, and `until` are reserved in Ada 95.
+ The identifiers ``abstract``, ``aliased``, ``protected``,
+ ``requeue``, ``tagged``, and ``until`` are reserved in Ada 95.
Existing Ada 83 code using any of these identifiers must be edited to
use some alternative name.
@@ -207,38 +207,38 @@ Ada 95 and later versions of the standard:
body if it is empty, or, if it is non-empty, introduce a dummy declaration
into the spec that makes the body required. One approach is to add a private
part to the package declaration (if necessary), and define a parameterless
- procedure called `Requires_Body`, which must then be given a dummy
+ procedure called ``Requires_Body``, which must then be given a dummy
procedure body in the package body, which then becomes required.
Another approach (assuming that this does not introduce elaboration
- circularities) is to add an `Elaborate_Body` pragma to the package spec,
+ circularities) is to add an ``Elaborate_Body`` pragma to the package spec,
since one effect of this pragma is to require the presence of a package body.
* *Numeric_Error is the same exception as Constraint_Error*
- In Ada 95, the exception `Numeric_Error` is a renaming of `Constraint_Error`.
+ In Ada 95, the exception ``Numeric_Error`` is a renaming of ``Constraint_Error``.
This means that it is illegal to have separate exception handlers for
the two exceptions. The fix is simply to remove the handler for the
- `Numeric_Error` case (since even in Ada 83, a compiler was free to raise
- `Constraint_Error` in place of `Numeric_Error` in all cases).
+ ``Numeric_Error`` case (since even in Ada 83, a compiler was free to raise
+ ``Constraint_Error`` in place of ``Numeric_Error`` in all cases).
* *Indefinite subtypes in generics*
- In Ada 83, it was permissible to pass an indefinite type (e.g, `String`)
+ In Ada 83, it was permissible to pass an indefinite type (e.g, ``String``)
as the actual for a generic formal private type, but then the instantiation
would be illegal if there were any instances of declarations of variables
of this type in the generic body. In Ada 95, to avoid this clear violation
of the methodological principle known as the 'contract model',
the generic declaration explicitly indicates whether
or not such instantiations are permitted. If a generic formal parameter
- has explicit unknown discriminants, indicated by using `(<>)` after the
+ has explicit unknown discriminants, indicated by using ``(<>)`` after the
subtype name, then it can be instantiated with indefinite types, but no
stand-alone variables can be declared of this type. Any attempt to declare
such a variable will result in an illegality at the time the generic is
- declared. If the `(<>)` notation is not used, then it is illegal
+ declared. If the ``(<>)`` notation is not used, then it is illegal
to instantiate the generic with an indefinite type.
This is the potential incompatibility issue when porting Ada 83 code to Ada 95.
It will show up as a compile time error, and
- the fix is usually simply to add the `(<>)` to the generic declaration.
+ the fix is usually simply to add the ``(<>)`` to the generic declaration.
.. _More_deterministic_semantics:
@@ -273,21 +273,21 @@ The worst kind of incompatibility is one where a program that is legal in
Ada 83 is also legal in Ada 95 but can have an effect in Ada 95 that was not
possible in Ada 83. Fortunately this is extremely rare, but the one
situation that you should be alert to is the change in the predefined type
-`Character` from 7-bit ASCII to 8-bit Latin-1.
+``Character`` from 7-bit ASCII to 8-bit Latin-1.
.. index:: Latin-1
-* *Range of type `Character`*
+* *Range of type ``Character``*
- The range of `Standard.Character` is now the full 256 characters
+ The range of ``Standard.Character`` is now the full 256 characters
of Latin-1, whereas in most Ada 83 implementations it was restricted
to 128 characters. Although some of the effects of
this change will be manifest in compile-time rejection of legal
Ada 83 programs it is possible for a working Ada 83 program to have
a different effect in Ada 95, one that was not permitted in Ada 83.
As an example, the expression
- `Character'Pos(Character'Last)` returned `127` in Ada 83 and now
- delivers `255` as its value.
+ ``Character'Pos(Character'Last)`` returned ``127`` in Ada 83 and now
+ delivers ``255`` as its value.
In general, you should look at the logic of any
character-processing Ada 83 program and see whether it needs to be adapted
to work correctly with Latin-1. Note that the predefined Ada 95 API has a
@@ -313,7 +313,7 @@ Other language compatibility issues
as identifiers as in Ada 83. However,
in practice, it is usually advisable to make the necessary modifications
to the program to remove the need for using this switch.
- See the `Compiling Different Versions of Ada` section in
+ See the ``Compiling Different Versions of Ada`` section in
the :title:`GNAT User's Guide`.
@@ -324,8 +324,8 @@ Other language compatibility issues
compilers are allowed, but not required, to implement these missing
elements. In contrast with some other compilers, GNAT implements all
such pragmas and attributes, eliminating this compatibility concern. These
- include `pragma Interface` and the floating point type attributes
- (`Emax`, `Mantissa`, etc.), among other items.
+ include ``pragma Interface`` and the floating point type attributes
+ (``Emax``, ``Mantissa``, etc.), among other items.
.. _Compatibility_between_Ada_95_and_Ada_2005:
@@ -343,7 +343,7 @@ for a complete description please see the
* *New reserved words.*
- The words `interface`, `overriding` and `synchronized` are
+ The words ``interface``, ``overriding`` and ``synchronized`` are
reserved in Ada 2005.
A pre-Ada 2005 program that uses any of these as an identifier will be
illegal.
@@ -351,12 +351,12 @@ for a complete description please see the
* *New declarations in predefined packages.*
A number of packages in the predefined environment contain new declarations:
- `Ada.Exceptions`, `Ada.Real_Time`, `Ada.Strings`,
- `Ada.Strings.Fixed`, `Ada.Strings.Bounded`,
- `Ada.Strings.Unbounded`, `Ada.Strings.Wide_Fixed`,
- `Ada.Strings.Wide_Bounded`, `Ada.Strings.Wide_Unbounded`,
- `Ada.Tags`, `Ada.Text_IO`, and `Interfaces.C`.
- If an Ada 95 program does a `with` and `use` of any of these
+ ``Ada.Exceptions``, ``Ada.Real_Time``, ``Ada.Strings``,
+ ``Ada.Strings.Fixed``, ``Ada.Strings.Bounded``,
+ ``Ada.Strings.Unbounded``, ``Ada.Strings.Wide_Fixed``,
+ ``Ada.Strings.Wide_Bounded``, ``Ada.Strings.Wide_Unbounded``,
+ ``Ada.Tags``, ``Ada.Text_IO``, and ``Interfaces.C``.
+ If an Ada 95 program does a ``with`` and ``use`` of any of these
packages, the new declarations may cause name clashes.
* *Access parameters.*
@@ -382,7 +382,7 @@ for a complete description please see the
are now ambiguous.
The ambiguity may be resolved either by applying a type conversion to the
expression, or by explicitly invoking the operation from package
- `Standard`.
+ ``Standard``.
* *Return-by-reference types.*
@@ -411,17 +411,17 @@ Implementation-defined pragmas
Ada compilers are allowed to supplement the language-defined pragmas, and
these are a potential source of non-portability. All GNAT-defined pragmas
-are described in the `Implementation Defined Pragmas` chapter of the
-:title:`GNAT Reference Manual`, and these include several that are specifically
+are described in :ref:`Implementation_Defined_Pragmas`,
+and these include several that are specifically
intended to correspond to other vendors' Ada 83 pragmas.
-For migrating from VADS, the pragma `Use_VADS_Size` may be useful.
+For migrating from VADS, the pragma ``Use_VADS_Size`` may be useful.
For compatibility with HP Ada 83, GNAT supplies the pragmas
-`Extend_System`, `Ident`, `Inline_Generic`,
-`Interface_Name`, `Passive`, `Suppress_All`,
-and `Volatile`.
-Other relevant pragmas include `External` and `Link_With`.
+``Extend_System``, ``Ident``, ``Inline_Generic``,
+``Interface_Name``, ``Passive``, ``Suppress_All``,
+and ``Volatile``.
+Other relevant pragmas include ``External`` and ``Link_With``.
Some vendor-specific
-Ada 83 pragmas (`Share_Generic`, `Subtitle`, and `Title`) are
+Ada 83 pragmas (``Share_Generic``, ``Subtitle``, and ``Title``) are
recognized, thus
avoiding compiler rejection of units that contain such pragmas; they are not
relevant in a GNAT context and hence are not otherwise implemented.
@@ -434,12 +434,12 @@ Implementation-defined attributes
Analogous to pragmas, the set of attributes may be extended by an
implementation. All GNAT-defined attributes are described in
-`Implementation Defined Attributes` section of the
-:title:`GNAT Reference Manual`, and these include several that are specifically intended
+:ref:`Implementation_Defined_Attributes`,
+and these include several that are specifically intended
to correspond to other vendors' Ada 83 attributes. For migrating from VADS,
-the attribute `VADS_Size` may be useful. For compatibility with HP
-Ada 83, GNAT supplies the attributes `Bit`, `Machine_Size` and
-`Type_Class`.
+the attribute ``VADS_Size`` may be useful. For compatibility with HP
+Ada 83, GNAT supplies the attributes ``Bit``, ``Machine_Size`` and
+``Type_Class``.
.. _Libraries:
@@ -474,11 +474,11 @@ Program_Error being raised due to an 'Access Before Elaboration': an attempt
to invoke a subprogram before its body has been elaborated, or to instantiate
a generic before the generic body has been elaborated. By default GNAT
attempts to choose a safe order (one that will not encounter access before
-elaboration problems) by implicitly inserting `Elaborate` or
-`Elaborate_All` pragmas where
+elaboration problems) by implicitly inserting ``Elaborate`` or
+``Elaborate_All`` pragmas where
needed. However, this can lead to the creation of elaboration circularities
and a resulting rejection of the program by gnatbind. This issue is
-thoroughly described in the `Elaboration Order Handling in GNAT` appendix
+thoroughly described in the *Elaboration Order Handling in GNAT* appendix
in the :title:`GNAT User's Guide`.
In brief, there are several
ways to deal with this situation:
@@ -486,12 +486,12 @@ ways to deal with this situation:
* Modify the program to eliminate the circularities, e.g., by moving
elaboration-time code into explicitly-invoked procedures
-* Constrain the elaboration order by including explicit `Elaborate_Body` or
- `Elaborate` pragmas, and then inhibit the generation of implicit
- `Elaborate_All`
+* Constrain the elaboration order by including explicit ``Elaborate_Body`` or
+ ``Elaborate`` pragmas, and then inhibit the generation of implicit
+ ``Elaborate_All``
pragmas either globally (as an effect of the *-gnatE* switch) or locally
(by selectively suppressing elaboration checks via pragma
- `Suppress(Elaboration_Check)` when it is safe to do so).
+ ``Suppress(Elaboration_Check)`` when it is safe to do so).
.. _Target-specific_aspects:
@@ -581,14 +581,14 @@ the cases most likely to arise in existing Ada 83 code.
Reference Manuals as implementation advice that is followed by GNAT.
The problem will show up as an error
message rejecting the size clause. The fix is simply to provide
- the explicit pragma `Pack`, or for more fine tuned control, provide
+ the explicit pragma ``Pack``, or for more fine tuned control, provide
a Component_Size clause.
* *Meaning of Size Attribute*
The Size attribute in Ada 95 (and Ada 2005) for discrete types is defined as
the minimal number of bits required to hold values of the type. For example,
- on a 32-bit machine, the size of `Natural` will typically be 31 and not
+ on a 32-bit machine, the size of ``Natural`` will typically be 31 and not
32 (since no sign bit is required). Some Ada 83 compilers gave 31, and
some 32 in this situation. This problem will usually show up as a compile
time error, but not always. It is a good idea to check all uses of the
diff --git a/gcc/ada/doc/gnat_rm/implementation_advice.rst b/gcc/ada/doc/gnat_rm/implementation_advice.rst
index c505e31..b006f32 100644
--- a/gcc/ada/doc/gnat_rm/implementation_advice.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_advice.rst
@@ -32,7 +32,7 @@ RM 1.1.3(20): Error Detection
=============================
"If an implementation detects the use of an unsupported Specialized Needs
- Annex feature at run time, it should raise `Program_Error` if
+ Annex feature at run time, it should raise ``Program_Error`` if
feasible."
Not relevant. All specialized needs annex features are either supported,
@@ -56,7 +56,7 @@ RM 1.1.5(12): Bounded Errors
============================
"If an implementation detects a bounded error or erroneous
- execution, it should raise `Program_Error`."
+ execution, it should raise ``Program_Error``."
Followed in all cases in which the implementation detects a bounded
error or erroneous execution. Not all such situations are detected at
@@ -111,10 +111,10 @@ RM 2.8(17-19): Pragmas
"Normally, an implementation should not define pragmas that can
make an illegal program legal, except as follows:
- * A pragma used to complete a declaration, such as a pragma `Import`;
+ * A pragma used to complete a declaration, such as a pragma ``Import``;
* A pragma used to configure the environment by adding, removing, or
- replacing `library_items`."
+ replacing ``library_items``."
See :ref:`RM_2_8_16_Pragmas`.
@@ -126,15 +126,15 @@ RM 3.5.2(5): Alternative Character Sets
=======================================
"If an implementation supports a mode with alternative interpretations
- for `Character` and `Wide_Character`, the set of graphic
- characters of `Character` should nevertheless remain a proper
- subset of the set of graphic characters of `Wide_Character`. Any
+ for ``Character`` and ``Wide_Character``, the set of graphic
+ characters of ``Character`` should nevertheless remain a proper
+ subset of the set of graphic characters of ``Wide_Character``. Any
character set 'localizations' should be reflected in the results of
the subprograms defined in the language-defined package
- `Characters.Handling` (see A.3) available in such a mode. In a mode with
- an alternative interpretation of `Character`, the implementation should
+ ``Characters.Handling`` (see A.3) available in such a mode. In a mode with
+ an alternative interpretation of ``Character``, the implementation should
also support a corresponding change in what is a legal
- `identifier_letter`."
+ ``identifier_letter``."
Not all wide character modes follow this advice, in particular the JIS
and IEC modes reflect standard usage in Japan, and in these encoding,
@@ -148,13 +148,13 @@ there is no such restriction.
RM 3.5.4(28): Integer Types
===========================
- "An implementation should support `Long_Integer` in addition to
- `Integer` if the target machine supports 32-bit (or longer)
+ "An implementation should support ``Long_Integer`` in addition to
+ ``Integer`` if the target machine supports 32-bit (or longer)
arithmetic. No other named integer subtypes are recommended for package
- `Standard`. Instead, appropriate named integer subtypes should be
- provided in the library package `Interfaces` (see B.2)."
+ ``Standard``. Instead, appropriate named integer subtypes should be
+ provided in the library package ``Interfaces`` (see B.2)."
-`Long_Integer` is supported. Other standard integer types are supported
+``Long_Integer`` is supported. Other standard integer types are supported
so this advice is not fully followed. These types
are supported for convenient interface to C, and so that all hardware
types of the machine are easily available.
@@ -164,7 +164,7 @@ RM 3.5.4(29): Integer Types
"An implementation for a two's complement machine should support
modular types with a binary modulus up to ``System.Max_Int*2+2``. An
- implementation should support a non-binary modules up to `Integer'Last`."
+ implementation should support a non-binary modules up to ``Integer'Last``."
Followed.
@@ -177,7 +177,7 @@ RM 3.5.5(8): Enumeration Values
subtype, if the value of the operand does not correspond to the internal
code for any enumeration literal of its type (perhaps due to an
un-initialized variable), then the implementation should raise
- `Program_Error`. This is particularly important for enumeration
+ ``Program_Error``. This is particularly important for enumeration
types with noncontiguous internal codes specified by an
enumeration_representation_clause."
@@ -188,19 +188,19 @@ Followed.
RM 3.5.7(17): Float Types
=========================
- "An implementation should support `Long_Float` in addition to
- `Float` if the target machine supports 11 or more digits of
+ "An implementation should support ``Long_Float`` in addition to
+ ``Float`` if the target machine supports 11 or more digits of
precision. No other named floating point subtypes are recommended for
- package `Standard`. Instead, appropriate named floating point subtypes
- should be provided in the library package `Interfaces` (see B.2)."
+ package ``Standard``. Instead, appropriate named floating point subtypes
+ should be provided in the library package ``Interfaces`` (see B.2)."
-`Short_Float` and `Long_Long_Float` are also provided. The
+``Short_Float`` and ``Long_Long_Float`` are also provided. The
former provides improved compatibility with other implementations
supporting this type. The latter corresponds to the highest precision
floating-point type supported by the hardware. On most machines, this
-will be the same as `Long_Float`, but on some machines, it will
+will be the same as ``Long_Float``, but on some machines, it will
correspond to the IEEE extended form. The notable case is all ia32
-(x86) implementations, where `Long_Long_Float` corresponds to
+(x86) implementations, where ``Long_Long_Float`` corresponds to
the 80-bit extended precision format supported in hardware on this
processor. Note that the 128-bit format on SPARC is not supported,
since this is a software rather than a hardware format.
@@ -214,9 +214,9 @@ RM 3.6.2(11): Multidimensional Arrays
"An implementation should normally represent multidimensional arrays in
row-major order, consistent with the notation used for multidimensional
- array aggregates (see 4.3.3). However, if a pragma `Convention`
- (`Fortran`, ...) applies to a multidimensional array type, then
- column-major order should be used instead (see B.5, `Interfacing with Fortran`)."
+ array aggregates (see 4.3.3). However, if a pragma ``Convention``
+ (``Fortran``, ...) applies to a multidimensional array type, then
+ column-major order should be used instead (see B.5, *Interfacing with Fortran*)."
Followed.
@@ -225,13 +225,13 @@ Followed.
RM 9.6(30-31): Duration'Small
=============================
- "Whenever possible in an implementation, the value of `Duration'Small`
+ "Whenever possible in an implementation, the value of ``Duration'Small``
should be no greater than 100 microseconds."
-Followed. (`Duration'Small` = 10**(-9)).
+Followed. (``Duration'Small`` = 10**(-9)).
- "The time base for `delay_relative_statements` should be monotonic;
- it need not be the same time base as used for `Calendar.Clock`."
+ "The time base for ``delay_relative_statements`` should be monotonic;
+ it need not be the same time base as used for ``Calendar.Clock``."
Followed.
@@ -255,23 +255,23 @@ advice without severely impacting efficiency of execution.
RM 11.4.1(19): Exception Information
====================================
- "`Exception_Message` by default and `Exception_Information`
+ "``Exception_Message`` by default and ``Exception_Information``
should produce information useful for
- debugging. `Exception_Message` should be short, about one
- line. `Exception_Information` can be long. `Exception_Message`
+ debugging. ``Exception_Message`` should be short, about one
+ line. ``Exception_Information`` can be long. ``Exception_Message``
should not include the
- `Exception_Name`. `Exception_Information` should include both
- the `Exception_Name` and the `Exception_Message`."
+ ``Exception_Name``. ``Exception_Information`` should include both
+ the ``Exception_Name`` and the ``Exception_Message``."
Followed. For each exception that doesn't have a specified
-`Exception_Message`, the compiler generates one containing the location
+``Exception_Message``, the compiler generates one containing the location
of the raise statement. This location has the form 'file_name:line', where
file_name is the short file name (without path information) and line is the line
number in the file. Note that in the case of the Zero Cost Exception
mechanism, these messages become redundant with the Exception_Information that
contains a full backtrace of the calling sequence, so they are disabled.
To disable explicitly the generation of the source location message, use the
-Pragma `Discard_Names`.
+Pragma ``Discard_Names``.
.. index:: Suppression of checks
@@ -312,7 +312,7 @@ For example:
for Y'Address use X'Address;>>
- "An implementation need not support a specification for the `Size`
+ "An implementation need not support a specification for the ``Size``
for a given composite subtype, nor the size or storage place for an
object (including a component) of a given composite subtype, unless the
constraints on the subtype and its composite subcomponents (if any) are
@@ -337,13 +337,13 @@ RM 13.2(6-8): Packed Types
speed of accessing components, subject to reasonable complexity in
addressing calculations.
- The recommended level of support pragma `Pack` is:
+ The recommended level of support pragma ``Pack`` is:
For a packed record type, the components should be packed as tightly as
possible subject to the Sizes of the component subtypes, and subject to
- any `record_representation_clause` that applies to the type; the
+ any *record_representation_clause* that applies to the type; the
implementation may, but need not, reorder components or cross aligned
- word boundaries to improve the packing. A component whose `Size` is
+ word boundaries to improve the packing. A component whose ``Size`` is
greater than the word size may be allocated an integral number of words."
Followed. Tight packing of arrays is supported for all component sizes
@@ -364,22 +364,22 @@ Followed.
RM 13.3(14-19): Address Clauses
===============================
- "For an array `X`, ``X'Address`` should point at the first
+ "For an array ``X``, ``X'Address`` should point at the first
component of the array, and not at the array bounds."
Followed.
- "The recommended level of support for the `Address` attribute is:
+ "The recommended level of support for the ``Address`` attribute is:
- ``X'Address`` should produce a useful result if `X` is an
+ ``X'Address`` should produce a useful result if ``X`` is an
object that is aliased or of a by-reference type, or is an entity whose
- `Address` has been specified."
+ ``Address`` has been specified."
Followed. A valid address will be produced even if none of those
conditions have been met. If necessary, the object is forced into
memory to ensure the address is valid.
- "An implementation should support `Address` clauses for imported
+ "An implementation should support ``Address`` clauses for imported
subprograms."
Followed.
@@ -389,7 +389,7 @@ Followed.
Followed.
- "If the `Address` of an object is specified, or it is imported or exported,
+ "If the ``Address`` of an object is specified, or it is imported or exported,
then the implementation should not perform optimizations based on
assumptions of no aliases."
@@ -400,7 +400,7 @@ Followed.
RM 13.3(29-35): Alignment Clauses
=================================
- "The recommended level of support for the `Alignment` attribute for
+ "The recommended level of support for the ``Alignment`` attribute for
subtypes is:
An implementation should support specified Alignments that are factors
@@ -416,12 +416,12 @@ Followed.
Followed.
"An implementation need not support specified Alignments that are
- greater than the maximum `Alignment` the implementation ever returns by
+ greater than the maximum ``Alignment`` the implementation ever returns by
default."
Followed.
- "The recommended level of support for the `Alignment` attribute for
+ "The recommended level of support for the ``Alignment`` attribute for
objects is:
Same as above, for subtypes, but in addition:"
@@ -440,23 +440,23 @@ Followed.
RM 13.3(42-43): Size Clauses
============================
- "The recommended level of support for the `Size` attribute of
+ "The recommended level of support for the ``Size`` attribute of
objects is:
- A `Size` clause should be supported for an object if the specified
- `Size` is at least as large as its subtype's `Size`, and
+ A ``Size`` clause should be supported for an object if the specified
+ ``Size`` is at least as large as its subtype's ``Size``, and
corresponds to a size in storage elements that is a multiple of the
- object's `Alignment` (if the `Alignment` is nonzero)."
+ object's ``Alignment`` (if the ``Alignment`` is nonzero)."
Followed.
RM 13.3(50-56): Size Clauses
============================
- "If the `Size` of a subtype is specified, and allows for efficient
+ "If the ``Size`` of a subtype is specified, and allows for efficient
independent addressability (see 9.10) on the target architecture, then
- the `Size` of the following objects of the subtype should equal the
- `Size` of the subtype:
+ the ``Size`` of the following objects of the subtype should equal the
+ ``Size`` of the subtype:
Aliased objects (including components)."
@@ -468,18 +468,18 @@ Followed.
Followed. But note that this can be overridden by use of the implementation
pragma Implicit_Packing in the case of packed arrays.
- "The recommended level of support for the `Size` attribute of subtypes is:
+ "The recommended level of support for the ``Size`` attribute of subtypes is:
- The `Size` (if not specified) of a static discrete or fixed point
+ The ``Size`` (if not specified) of a static discrete or fixed point
subtype should be the number of bits needed to represent each value
belonging to the subtype using an unbiased representation, leaving space
for a sign bit only if the subtype contains negative values. If such a
subtype is a first subtype, then an implementation should support a
- specified `Size` for it that reflects this representation."
+ specified ``Size`` for it that reflects this representation."
Followed.
- "For a subtype implemented with levels of indirection, the `Size`
+ "For a subtype implemented with levels of indirection, the ``Size``
should include the size of the pointers, but not the size of what they
point at."
@@ -490,11 +490,11 @@ Followed.
RM 13.3(71-73): Component Size Clauses
======================================
- "The recommended level of support for the `Component_Size`
+ "The recommended level of support for the ``Component_Size``
attribute is:
- An implementation need not support specified `Component_Sizes` that are
- less than the `Size` of the component subtype."
+ An implementation need not support specified ``Component_Sizes`` that are
+ less than the ``Size`` of the component subtype."
Followed.
@@ -520,7 +520,7 @@ RM 13.4(9-10): Enumeration Representation Clauses
An implementation need not support enumeration representation clauses
for boolean types, but should at minimum support the internal codes in
- the range `System.Min_Int .. System.Max_Int`."
+ the range ``System.Min_Int .. System.Max_Int``."
Followed.
@@ -532,7 +532,7 @@ RM 13.5.1(17-22): Record Representation Clauses
===============================================
"The recommended level of support for
- `record_representation_clauses` is:
+ *record_representation_clause*\ s is:
An implementation should support storage places that can be extracted
with a load, mask, shift sequence of machine code, and set with a load,
@@ -542,13 +542,13 @@ RM 13.5.1(17-22): Record Representation Clauses
Followed.
"A storage place should be supported if its size is equal to the
- `Size` of the component subtype, and it starts and ends on a
- boundary that obeys the `Alignment` of the component subtype."
+ ``Size`` of the component subtype, and it starts and ends on a
+ boundary that obeys the ``Alignment`` of the component subtype."
Followed.
"If the default bit ordering applies to the declaration of a given type,
- then for a component whose subtype's `Size` is less than the word
+ then for a component whose subtype's ``Size`` is less than the word
size, any storage place that does not cross an aligned word boundary
should be supported."
@@ -561,7 +561,7 @@ Followed. The storage place for the tag field is the beginning of the tagged
record, and its size is Address'Size. GNAT will reject an explicit component
clause for the tag field.
- "An implementation need not support a `component_clause` for a
+ "An implementation need not support a *component_clause* for a
component of an extension part if the storage place is not after the
storage places of all components of the parent type, whether or not
those storage places had been specified."
@@ -591,7 +591,7 @@ RM 13.5.3(7-8): Bit Ordering
"The recommended level of support for the non-default bit ordering is:
- If `Word_Size` = `Storage_Unit`, then the implementation
+ If ``Word_Size`` = ``Storage_Unit``, then the implementation
should support the non-default bit ordering in addition to the default
bit ordering."
@@ -607,33 +607,33 @@ RM 13.7(37): Address as Private
Followed.
-.. index:: Operations, on `Address`
+.. index:: Operations, on ``Address``
.. index:: Address, operations of
RM 13.7.1(16): Address Operations
=================================
- "Operations in `System` and its children should reflect the target
+ "Operations in ``System`` and its children should reflect the target
environment semantics as closely as is reasonable. For example, on most
machines, it makes sense for address arithmetic to 'wrap around'.
- Operations that do not make sense should raise `Program_Error`."
+ Operations that do not make sense should raise ``Program_Error``."
Followed. Address arithmetic is modular arithmetic that wraps around. No
-operation raises `Program_Error`, since all operations make sense.
+operation raises ``Program_Error``, since all operations make sense.
.. index:: Unchecked conversion
RM 13.9(14-17): Unchecked Conversion
====================================
- "The `Size` of an array object should not include its bounds; hence,
+ "The ``Size`` of an array object should not include its bounds; hence,
the bounds should not be part of the converted data."
Followed.
"The implementation should not generate unnecessary run-time checks to
- ensure that the representation of `S` is a representation of the
+ ensure that the representation of ``S`` is a representation of the
target type. It should take advantage of the permission to return by
reference when possible. Restrictions on unchecked conversions should be
avoided unless required by the target environment."
@@ -696,7 +696,7 @@ Followed.
RM 13.11.2(17): Unchecked Deallocation
======================================
- "For a standard storage pool, `Free` should actually reclaim the
+ "For a standard storage pool, ``Free`` should actually reclaim the
storage."
Followed.
@@ -707,8 +707,8 @@ RM 13.13.2(17): Stream Oriented Attributes
==========================================
"If a stream element is the same size as a storage element, then the
- normal in-memory representation should be used by `Read` and
- `Write` for scalar objects. Otherwise, `Read` and `Write`
+ normal in-memory representation should be used by ``Read`` and
+ ``Write`` for scalar objects. Otherwise, ``Read`` and ``Write``
should use the smallest number of stream elements needed to represent
all values in the base range of the scalar type."
@@ -717,7 +717,7 @@ which specifies using the size of the first subtype.
However, such an implementation is based on direct binary
representations and is therefore target- and endianness-dependent.
To address this issue, GNAT also supplies an alternate implementation
-of the stream attributes `Read` and `Write`,
+of the stream attributes ``Read`` and ``Write``,
which uses the target-independent XDR standard representation
for scalar types.
@@ -730,13 +730,13 @@ for scalar types.
.. index:: Stream oriented attributes
The XDR implementation is provided as an alternative body of the
-`System.Stream_Attributes` package, in the file
+``System.Stream_Attributes`` package, in the file
:file:`s-stratt-xdr.adb` in the GNAT library.
There is no :file:`s-stratt-xdr.ads` file.
In order to install the XDR implementation, do the following:
* Replace the default implementation of the
- `System.Stream_Attributes` package with the XDR implementation.
+ ``System.Stream_Attributes`` package with the XDR implementation.
For example on a Unix platform issue the commands:
.. code-block:: sh
@@ -747,7 +747,7 @@ In order to install the XDR implementation, do the following:
*
Rebuild the GNAT run-time library as documented in
- the `GNAT and Libraries` section of the :title:`GNAT User's Guide`.
+ the *GNAT and Libraries* section of the :title:`GNAT User's Guide`.
RM A.1(52): Names of Predefined Numeric Types
=============================================
@@ -762,12 +762,12 @@ Followed.
.. index:: Ada.Characters.Handling
-RM A.3.2(49): `Ada.Characters.Handling`
-=======================================
+RM A.3.2(49): ``Ada.Characters.Handling``
+=========================================
- "If an implementation provides a localized definition of `Character`
- or `Wide_Character`, then the effects of the subprograms in
- `Characters.Handling` should reflect the localizations.
+ "If an implementation provides a localized definition of ``Character``
+ or ``Wide_Character``, then the effects of the subprograms in
+ ``Characters.Handling`` should reflect the localizations.
See also 3.5.2."
Followed. GNAT provides no such localized definitions.
@@ -787,14 +787,14 @@ Followed. No implicit pointers or dynamic allocation are used.
RM A.5.2(46-47): Random Number Generation
=========================================
- "Any storage associated with an object of type `Generator` should be
+ "Any storage associated with an object of type ``Generator`` should be
reclaimed on exit from the scope of the object."
Followed.
"If the generator period is sufficiently long in relation to the number
of distinct initiator values, then each possible value of
- `Initiator` passed to `Reset` should initiate a sequence of
+ ``Initiator`` passed to ``Reset`` should initiate a sequence of
random numbers that does not, in a practical sense, overlap the sequence
initiated by any other value. If this is not possible, then the mapping
between initiator values and generator states should be a rapidly
@@ -805,55 +805,55 @@ condition here to hold true.
.. index:: Get_Immediate
-RM A.10.7(23): `Get_Immediate`
-==============================
+RM A.10.7(23): ``Get_Immediate``
+================================
- "The `Get_Immediate` procedures should be implemented with
+ "The ``Get_Immediate`` procedures should be implemented with
unbuffered input. For a device such as a keyboard, input should be
available if a key has already been typed, whereas for a disk
file, input should always be available except at end of file. For a file
associated with a keyboard-like device, any line-editing features of the
underlying operating system should be disabled during the execution of
- `Get_Immediate`."
+ ``Get_Immediate``."
Followed on all targets except VxWorks. For VxWorks, there is no way to
provide this functionality that does not result in the input buffer being
-flushed before the `Get_Immediate` call. A special unit
-`Interfaces.Vxworks.IO` is provided that contains routines to enable
+flushed before the ``Get_Immediate`` call. A special unit
+``Interfaces.Vxworks.IO`` is provided that contains routines to enable
this functionality.
.. index:: Export
-RM B.1(39-41): Pragma `Export`
-==============================
+RM B.1(39-41): Pragma ``Export``
+================================
- "If an implementation supports pragma `Export` to a given language,
+ "If an implementation supports pragma ``Export`` to a given language,
then it should also allow the main subprogram to be written in that
language. It should support some mechanism for invoking the elaboration
of the Ada library units included in the system, and for invoking the
finalization of the environment task. On typical systems, the
recommended mechanism is to provide two subprograms whose link names are
- `adainit` and `adafinal`. `adainit` should contain the
- elaboration code for library units. `adafinal` should contain the
+ ``adainit`` and ``adafinal``. ``adainit`` should contain the
+ elaboration code for library units. ``adafinal`` should contain the
finalization code. These subprograms should have no effect the second
and subsequent time they are called."
Followed.
"Automatic elaboration of pre-elaborated packages should be
- provided when pragma `Export` is supported."
+ provided when pragma ``Export`` is supported."
Followed when the main program is in Ada. If the main program is in a
foreign language, then
-`adainit` must be called to elaborate pre-elaborated
+``adainit`` must be called to elaborate pre-elaborated
packages.
- "For each supported convention `L` other than `Intrinsic`, an
- implementation should support `Import` and `Export` pragmas
- for objects of `L`-compatible types and for subprograms, and pragma
- `Convention` for `L`-eligible types and for subprograms,
+ "For each supported convention *L* other than ``Intrinsic``, an
+ implementation should support ``Import`` and ``Export`` pragmas
+ for objects of *L*\ -compatible types and for subprograms, and pragma
+ `Convention` for *L*\ -eligible types and for subprograms,
presuming the other language has corresponding features. Pragma
- `Convention` need not be supported for scalar types."
+ ``Convention`` need not be supported for scalar types."
Followed.
@@ -861,8 +861,8 @@ Followed.
.. index:: Interfaces
-RM B.2(12-13): Package `Interfaces`
-===================================
+RM B.2(12-13): Package ``Interfaces``
+=====================================
"For each implementation-defined convention identifier, there should be a
child package of package Interfaces with the corresponding name. This
@@ -870,7 +870,7 @@ RM B.2(12-13): Package `Interfaces`
interfacing to the language (implementation) represented by the
convention. Any declarations useful for interfacing to any language on
the given hardware architecture should be provided directly in
- `Interfaces`."
+ ``Interfaces``."
Followed.
@@ -898,37 +898,37 @@ Followed.
Followed.
- "An Ada `in` scalar parameter is passed as a scalar argument to a C
+ "An Ada ``in`` scalar parameter is passed as a scalar argument to a C
function."
Followed.
- "An Ada `in` parameter of an access-to-object type with designated
- type `T` is passed as a ``t*`` argument to a C function,
- where ``t`` is the C type corresponding to the Ada type `T`."
+ "An Ada ``in`` parameter of an access-to-object type with designated
+ type ``T`` is passed as a ``t*`` argument to a C function,
+ where ``t`` is the C type corresponding to the Ada type ``T``."
Followed.
- "An Ada access `T` parameter, or an Ada `out` or `in out`
- parameter of an elementary type `T`, is passed as a ``t*``
+ "An Ada access ``T`` parameter, or an Ada ``out`` or ``in out``
+ parameter of an elementary type ``T``, is passed as a ``t*``
argument to a C function, where ``t`` is the C type corresponding to
- the Ada type `T`. In the case of an elementary `out` or
- `in out` parameter, a pointer to a temporary copy is used to
+ the Ada type ``T``. In the case of an elementary ``out`` or
+ ``in out`` parameter, a pointer to a temporary copy is used to
preserve by-copy semantics."
Followed.
- "An Ada parameter of a record type `T`, of any mode, is passed as a
+ "An Ada parameter of a record type ``T``, of any mode, is passed as a
``t*`` argument to a C function, where ``t`` is the C
- structure corresponding to the Ada type `T`."
+ structure corresponding to the Ada type ``T``."
Followed. This convention may be overridden by the use of the C_Pass_By_Copy
pragma, or Convention, or by explicitly specifying the mechanism for a given
call using an extended import or export pragma.
- "An Ada parameter of an array type with component type `T`, of any
+ "An Ada parameter of an array type with component type ``T``, of any
mode, is passed as a ``t*`` argument to a C function, where
- ``t`` is the C type corresponding to the Ada type `T`."
+ ``t`` is the C type corresponding to the Ada type ``T``."
Followed.
@@ -948,8 +948,8 @@ RM B.4(95-98): Interfacing with COBOL
Followed.
- "An Ada access `T` parameter is passed as a ``BY REFERENCE`` data item of
- the COBOL type corresponding to `T`."
+ "An Ada access ``T`` parameter is passed as a ``BY REFERENCE`` data item of
+ the COBOL type corresponding to ``T``."
Followed.
@@ -982,9 +982,9 @@ Followed.
Followed.
- "An Ada parameter of an elementary, array, or record type `T` is
- passed as a `T` argument to a Fortran procedure, where `T` is
- the Fortran type corresponding to the Ada type `T`, and where the
+ "An Ada parameter of an elementary, array, or record type ``T`` is
+ passed as a ``T`` argument to a Fortran procedure, where ``T`` is
+ the Fortran type corresponding to the Ada type ``T``, and where the
INTENT attribute of the corresponding dummy argument matches the Ada
formal parameter mode; the Fortran implementation's parameter passing
conventions are used. For elementary types, a local copy is used if
@@ -1011,7 +1011,7 @@ Followed.
"The interfacing pragmas (see Annex B) should support interface to
assembler; the default assembler should be associated with the
- convention identifier `Assembler`."
+ convention identifier ``Assembler``."
Followed.
@@ -1065,7 +1065,7 @@ Followed on any target supporting such operations.
RM C.3(28): Interrupt Support
=============================
- "If the `Ceiling_Locking` policy is not in effect, the
+ "If the ``Ceiling_Locking`` policy is not in effect, the
implementation should provide means for the application to specify which
interrupts are to be blocked during protected actions, if the underlying
system allows for a finer-grain control of interrupt blocking."
@@ -1089,17 +1089,17 @@ such direct calls.
Followed. Compile time warnings are given when possible.
-.. index:: Package `Interrupts`
+.. index:: Package ``Interrupts``
.. index:: Interrupts
-RM C.3.2(25): Package `Interrupts`
-==================================
+RM C.3.2(25): Package ``Interrupts``
+====================================
"If implementation-defined forms of interrupt handler procedures are
supported, such as protected procedures with parameters, then for each
- such form of a handler, a type analogous to `Parameterless_Handler`
- should be specified in a child package of `Interrupts`, with the
+ such form of a handler, a type analogous to ``Parameterless_Handler``
+ should be specified in a child package of ``Interrupts``, with the
same operations as in the predefined package Interrupts."
Followed.
@@ -1117,8 +1117,8 @@ RM C.4(14): Pre-elaboration Requirements
Followed. Executable code is generated in some cases, e.g., loops
to initialize large arrays.
-RM C.5(8): Pragma `Discard_Names`
-=================================
+RM C.5(8): Pragma ``Discard_Names``
+===================================
"If the pragma applies to an entity, then the implementation should
reduce the amount of storage used for storing names associated with that
@@ -1138,9 +1138,9 @@ RM C.7.2(30): The Package Task_Attributes
recommended that the storage for task attributes will be pre-allocated
statically and not from the heap. This can be accomplished by either
placing restrictions on the number and the size of the task's
- attributes, or by using the pre-allocated storage for the first `N`
+ attributes, or by using the pre-allocated storage for the first ``N``
attribute objects, and the heap for the others. In the latter case,
- `N` should be documented."
+ ``N`` should be documented."
Not followed. This implementation is not targeted to such a domain.
@@ -1153,8 +1153,8 @@ RM D.3(17): Locking Policies
locking policies defined by the implementation."
Followed. Two implementation-defined locking policies are defined,
-whose names (`Inheritance_Locking` and
-`Concurrent_Readers_Locking`) follow this suggestion.
+whose names (``Inheritance_Locking`` and
+``Concurrent_Readers_Locking``) follow this suggestion.
.. index:: Entry queuing policies
@@ -1171,10 +1171,10 @@ Followed. No such implementation-defined queuing policies exist.
RM D.6(9-10): Preemptive Abort
==============================
- "Even though the `abort_statement` is included in the list of
+ "Even though the *abort_statement* is included in the list of
potentially blocking operations (see 9.5.1), it is recommended that this
statement be implemented in a way that never requires the task executing
- the `abort_statement` to block."
+ the *abort_statement* to block."
Followed.
@@ -1194,8 +1194,8 @@ RM D.7(21): Tasking Restrictions
GNAT currently takes advantage of these restrictions by providing an optimized
run time when the Ravenscar profile and the GNAT restricted run time set
-of restrictions are specified. See pragma `Profile (Ravenscar)` and
-pragma `Profile (Restricted)` for more details.
+of restrictions are specified. See pragma ``Profile (Ravenscar)`` and
+pragma ``Profile (Restricted)`` for more details.
.. index:: Time, monotonic
@@ -1203,12 +1203,12 @@ RM D.8(47-49): Monotonic Time
=============================
"When appropriate, implementations should provide configuration
- mechanisms to change the value of `Tick`."
+ mechanisms to change the value of ``Tick``."
Such configuration mechanisms are not appropriate to this implementation
and are thus not supported.
- "It is recommended that `Calendar.Clock` and `Real_Time.Clock`
+ "It is recommended that ``Calendar.Clock`` and ``Real_Time.Clock``
be implemented as transformations of the same time base."
Followed.
@@ -1216,7 +1216,7 @@ Followed.
"It is recommended that the best time base which exists in
the underlying system be available to the application through
- `Clock`. `Best` may mean highest accuracy or largest range."
+ ``Clock``. `Best` may mean highest accuracy or largest range."
Followed.
@@ -1235,9 +1235,9 @@ RM E.5(28-29): Partition Communication Subsystem
Followed by GLADE, a separately supplied PCS that can be used with
GNAT.
- "The `Write` operation on a stream of type `Params_Stream_Type`
- should raise `Storage_Error` if it runs out of space trying to
- write the `Item` into the stream."
+ "The ``Write`` operation on a stream of type ``Params_Stream_Type``
+ should raise ``Storage_Error`` if it runs out of space trying to
+ write the ``Item`` into the stream."
Followed by GLADE, a separately supplied PCS that can be used with
GNAT.
@@ -1249,9 +1249,9 @@ RM F(7): COBOL Support
"If COBOL (respectively, C) is widely supported in the target
environment, implementations supporting the Information Systems Annex
- should provide the child package `Interfaces.COBOL` (respectively,
- `Interfaces.C`) specified in Annex B and should support a
- `convention_identifier` of COBOL (respectively, C) in the interfacing
+ should provide the child package ``Interfaces.COBOL`` (respectively,
+ ``Interfaces.C``) specified in Annex B and should support a
+ ``convention_identifier`` of COBOL (respectively, C) in the interfacing
pragmas (see Annex B), thus allowing Ada programs to interface with
programs written in that language."
@@ -1263,9 +1263,9 @@ RM F.1(2): Decimal Radix Support
================================
"Packed decimal should be used as the internal representation for objects
- of subtype `S` when `S`'Machine_Radix = 10."
+ of subtype ``S`` when ``S``'Machine_Radix = 10."
-Not followed. GNAT ignores `S`'Machine_Radix and always uses binary
+Not followed. GNAT ignores ``S``'Machine_Radix and always uses binary
representations.
.. index:: Numerics
@@ -1275,9 +1275,9 @@ RM G: Numerics
"If Fortran (respectively, C) is widely supported in the target
environment, implementations supporting the Numerics Annex
- should provide the child package `Interfaces.Fortran` (respectively,
- `Interfaces.C`) specified in Annex B and should support a
- `convention_identifier` of Fortran (respectively, C) in the interfacing
+ should provide the child package ``Interfaces.Fortran`` (respectively,
+ ``Interfaces.C``) specified in Annex B and should support a
+ ``convention_identifier`` of Fortran (respectively, C) in the interfacing
pragmas (see Annex B), thus allowing Ada programs to interface with
programs written in that language."
@@ -1308,8 +1308,8 @@ Not followed.
complex operand and a real operand is that the imaginary operand remains
unchanged, an implementation should not perform this operation by first
promoting the real operand to complex type and then performing a full
- complex addition. In implementations in which the `Signed_Zeros`
- attribute of the component type is `True` (and which therefore
+ complex addition. In implementations in which the ``Signed_Zeros``
+ attribute of the component type is ``True`` (and which therefore
conform to IEC 559:1989 in regard to the handling of the sign of zero in
predefined arithmetic operations), the latter technique will not
generate the required result when the imaginary component of the complex
@@ -1321,15 +1321,15 @@ Not followed.
Not followed.
- "Implementations in which `Real'Signed_Zeros` is `True` should
+ "Implementations in which ``Real'Signed_Zeros`` is ``True`` should
attempt to provide a rational treatment of the signs of zero results and
- result components. As one example, the result of the `Argument`
+ result components. As one example, the result of the ``Argument``
function should have the sign of the imaginary component of the
- parameter `X` when the point represented by that parameter lies on
+ parameter ``X`` when the point represented by that parameter lies on
the positive real axis; as another, the sign of the imaginary component
- of the `Compose_From_Polar` function should be the same as
- (respectively, the opposite of) that of the `Argument` parameter when that
- parameter has a value of zero and the `Modulus` parameter has a
+ of the ``Compose_From_Polar`` function should be the same as
+ (respectively, the opposite of) that of the ``Argument`` parameter when that
+ parameter has a value of zero and the ``Modulus`` parameter has a
nonnegative (respectively, negative) value."
Followed.
@@ -1339,8 +1339,8 @@ Followed.
RM G.1.2(49): Complex Elementary Functions
==========================================
- "Implementations in which `Complex_Types.Real'Signed_Zeros` is
- `True` should attempt to provide a rational treatment of the signs
+ "Implementations in which ``Complex_Types.Real'Signed_Zeros`` is
+ ``True`` should attempt to provide a rational treatment of the signs
of zero results and result components. For example, many of the complex
elementary functions have components that are odd functions of one of
the parameter components; in these cases, the result component should
@@ -1357,13 +1357,13 @@ RM G.2.4(19): Accuracy Requirements
===================================
"The versions of the forward trigonometric functions without a
- `Cycle` parameter should not be implemented by calling the
- corresponding version with a `Cycle` parameter of
- `2.0*Numerics.Pi`, since this will not provide the required
+ ``Cycle`` parameter should not be implemented by calling the
+ corresponding version with a ``Cycle`` parameter of
+ ``2.0*Numerics.Pi``, since this will not provide the required
accuracy in some portions of the domain. For the same reason, the
- version of `Log` without a `Base` parameter should not be
- implemented by calling the corresponding version with a `Base`
- parameter of `Numerics.e`."
+ version of ``Log`` without a ``Base`` parameter should not be
+ implemented by calling the corresponding version with a ``Base``
+ parameter of ``Numerics.e``."
Followed.
@@ -1374,10 +1374,10 @@ Followed.
RM G.2.6(15): Complex Arithmetic Accuracy
=========================================
- "The version of the `Compose_From_Polar` function without a
- `Cycle` parameter should not be implemented by calling the
- corresponding version with a `Cycle` parameter of
- `2.0*Numerics.Pi`, since this will not provide the required
+ "The version of the ``Compose_From_Polar`` function without a
+ ``Cycle`` parameter should not be implemented by calling the
+ corresponding version with a ``Cycle`` parameter of
+ ``2.0*Numerics.Pi``, since this will not provide the required
accuracy in some portions of the domain."
Followed.
@@ -1387,7 +1387,7 @@ Followed.
RM H.6(15/2): Pragma Partition_Elaboration_Policy
=================================================
- "If the partition elaboration policy is `Sequential` and the
+ "If the partition elaboration policy is ``Sequential`` and the
Environment task becomes permanently blocked during elaboration then the
partition is deadlocked and it is recommended that the partition be
immediately terminated."
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst
index 0fd528d..be7338f 100644
--- a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst
@@ -78,15 +78,15 @@ corresponding to :ref:`pragma Annotate<Pragma-Annotate>`.
*Annotate => ID*
- Equivalent to `pragma Annotate (ID, Entity => Name);`
+ Equivalent to ``pragma Annotate (ID, Entity => Name);``
*Annotate => (ID)*
- Equivalent to `pragma Annotate (ID, Entity => Name);`
+ Equivalent to ``pragma Annotate (ID, Entity => Name);``
*Annotate => (ID ,ID {, ARG})*
- Equivalent to `pragma Annotate (ID, ID {, ARG}, Entity => Name);`
+ Equivalent to ``pragma Annotate (ID, ID {, ARG}, Entity => Name);``
Aspect Async_Readers
====================
@@ -130,7 +130,7 @@ Aspect Dimension
================
.. index:: Dimension
-The `Dimension` aspect is used to specify the dimensions of a given
+The ``Dimension`` aspect is used to specify the dimensions of a given
subtype of a dimensioned numeric type. The aspect also specifies a symbol
used when doing formatted output of dimensioned quantities. The syntax is::
@@ -148,13 +148,13 @@ used when doing formatted output of dimensioned quantities. The syntax is::
This aspect can only be applied to a subtype whose parent type has
-a `Dimension_System` aspect. The aspect must specify values for
+a ``Dimension_System`` aspect. The aspect must specify values for
all dimensions of the system. The rational values are the powers of the
corresponding dimensions that are used by the compiler to verify that
physical (numeric) computations are dimensionally consistent. For example,
the computation of a force must result in dimensions (L => 1, M => 1, T => -2).
For further examples of the usage
-of this aspect, see package `System.Dim.Mks`.
+of this aspect, see package ``System.Dim.Mks``.
Note that when the dimensioned type is an integer type, then any
dimension value must be an integer literal.
@@ -162,9 +162,9 @@ Aspect Dimension_System
=======================
.. index:: Dimension_System
-The `Dimension_System` aspect is used to define a system of
+The ``Dimension_System`` aspect is used to define a system of
dimensions that will be used in subsequent subtype declarations with
-`Dimension` aspects that reference this system. The syntax is::
+``Dimension`` aspects that reference this system. The syntax is::
with Dimension_System => (DIMENSION {, DIMENSION});
@@ -177,20 +177,20 @@ dimensions that will be used in subsequent subtype declarations with
This aspect is applied to a type, which must be a numeric derived type
(typically a floating-point type), that
-will represent values within the dimension system. Each `DIMENSION`
+will represent values within the dimension system. Each ``DIMENSION``
corresponds to one particular dimension. A maximum of 7 dimensions may
-be specified. `Unit_Name` is the name of the dimension (for example
-`Meter`). `Unit_Symbol` is the shorthand used for quantities
-of this dimension (for example `m` for `Meter`).
-`Dim_Symbol` gives
+be specified. ``Unit_Name`` is the name of the dimension (for example
+``Meter``). ``Unit_Symbol`` is the shorthand used for quantities
+of this dimension (for example ``m`` for ``Meter``).
+``Dim_Symbol`` gives
the identification within the dimension system (typically this is a
-single letter, e.g. `L` standing for length for unit name `Meter`).
-The `Unit_Symbol` is used in formatted output of dimensioned quantities.
-The `Dim_Symbol` is used in error messages when numeric operations have
+single letter, e.g. ``L`` standing for length for unit name ``Meter``).
+The ``Unit_Symbol`` is used in formatted output of dimensioned quantities.
+The ``Dim_Symbol`` is used in error messages when numeric operations have
inconsistent dimensions.
GNAT provides the standard definition of the International MKS system in
-the run-time package `System.Dim.Mks`. You can easily define
+the run-time package ``System.Dim.Mks``. You can easily define
similar packages for cgs units or British units, and define conversion factors
between values in different systems. The MKS system is characterized by the
following aspect:
@@ -208,7 +208,7 @@ following aspect:
(Unit_Name => Candela, Unit_Symbol => "cd", Dim_Symbol => 'J'));
-Note that in the above type definition, we use the `at` symbol (``@``) to
+Note that in the above type definition, we use the ``at`` symbol (``@``) to
represent a theta character (avoiding the use of extended Latin-1
characters in this context).
@@ -219,9 +219,9 @@ Aspect Disable_Controlled
=========================
.. index:: Disable_Controlled
-The aspect `Disable_Controlled` is defined for controlled record types. If
-active, this aspect causes suppression of all related calls to `Initialize`,
-`Adjust`, and `Finalize`. The intended use is for conditional compilation,
+The aspect ``Disable_Controlled`` is defined for controlled record types. If
+active, this aspect causes suppression of all related calls to ``Initialize``,
+``Adjust``, and ``Finalize``. The intended use is for conditional compilation,
where for example you might want a record to be controlled or not depending on
whether some run-time check is enabled or suppressed.
@@ -284,16 +284,16 @@ Aspect Invariant
.. index:: Invariant
This aspect is equivalent to :ref:`pragma Invariant<Pragma-Invariant>`. It is a
-synonym for the language defined aspect `Type_Invariant` except
-that it is separately controllable using pragma `Assertion_Policy`.
+synonym for the language defined aspect ``Type_Invariant`` except
+that it is separately controllable using pragma ``Assertion_Policy``.
Aspect Invariant'Class
======================
.. index:: Invariant'Class
This aspect is equivalent to :ref:`pragma Type_Invariant_Class<Pragma-Type_Invariant_Class>`. It is a
-synonym for the language defined aspect `Type_Invariant'Class` except
-that it is separately controllable using pragma `Assertion_Policy`.
+synonym for the language defined aspect ``Type_Invariant'Class`` except
+that it is separately controllable using pragma ``Assertion_Policy``.
Aspect Iterable
===============
@@ -302,10 +302,10 @@ Aspect Iterable
This aspect provides a light-weight mechanism for loops and quantified
expressions over container types, without the overhead imposed by the tampering
checks of standard Ada 2012 iterators. The value of the aspect is an aggregate
-with four named components: `First`, `Next`, `Has_Element`, and `Element` (the
+with four named components: ``First``, ``Next``, ``Has_Element``, and ``Element`` (the
last one being optional). When only 3 components are specified, only the
-`for .. in` form of iteration over cursors is available. When all 4 components
-are specified, both this form and the `for .. of` form of iteration over
+``for .. in`` form of iteration over cursors is available. When all 4 components
+are specified, both this form and the ``for .. of`` form of iteration over
elements are available. The following is a typical example of use:
.. code-block:: ada
@@ -316,30 +316,30 @@ elements are available. The following is a typical example of use:
Has_Element => Cursor_Has_Element,
[Element => Get_Element]);
-* The value denoted by `First` must denote a primitive operation of the
- container type that returns a `Cursor`, which must a be a type declared in
+* The value denoted by ``First`` must denote a primitive operation of the
+ container type that returns a ``Cursor``, which must a be a type declared in
the container package or visible from it. For example:
.. code-block:: ada
function First_Cursor (Cont : Container) return Cursor;
-* The value of `Next` is a primitive operation of the container type that takes
+* The value of ``Next`` is a primitive operation of the container type that takes
both a container and a cursor and yields a cursor. For example:
.. code-block:: ada
function Advance (Cont : Container; Position : Cursor) return Cursor;
-* The value of `Has_Element` is a primitive operation of the container type
+* The value of ``Has_Element`` is a primitive operation of the container type
that takes both a container and a cursor and yields a boolean. For example:
.. code-block:: ada
function Cursor_Has_Element (Cont : Container; Position : Cursor) return Boolean;
-* The value of `Element` is a primitive operation of the container type that
- takes both a container and a cursor and yields an `Element_Type`, which must
+* The value of ``Element`` is a primitive operation of the container type that
+ takes both a container and a cursor and yields an ``Element_Type``, which must
be a type declared in the container package or visible from it. For example:
.. code-block:: ada
@@ -373,6 +373,12 @@ Aspect No_Elaboration_Code_All
This aspect is equivalent to :ref:`pragma No_Elaboration_Code_All<Pragma-No_Elaboration_Code_All>`
for a program unit.
+Aspect No_Inline
+================
+.. index:: No_Inline
+
+This boolean aspect is equivalent to :ref:`pragma No_Inline<Pragma-No_Inline>`.
+
Aspect No_Tagged_Streams
========================
.. index:: No_Tagged_Streams
@@ -412,11 +418,11 @@ Aspect Predicate
.. index:: Predicate
This aspect is equivalent to :ref:`pragma Predicate<Pragma-Predicate>`. It is thus
-similar to the language defined aspects `Dynamic_Predicate`
-and `Static_Predicate` except that whether the resulting
+similar to the language defined aspects ``Dynamic_Predicate``
+and ``Static_Predicate`` except that whether the resulting
predicate is static or dynamic is controlled by the form of the
expression. It is also separately controllable using pragma
-`Assertion_Policy`.
+``Assertion_Policy``.
Aspect Pure_Function
====================
@@ -473,7 +479,7 @@ Aspect Shared
.. index:: Shared
This boolean aspect is equivalent to :ref:`pragma Shared<Pragma-Shared>`
-and is thus a synonym for aspect `Atomic`.
+and is thus a synonym for aspect ``Atomic``.
Aspect Simple_Storage_Pool
==========================
@@ -574,5 +580,5 @@ Aspect Warnings
.. index:: Warnings
This aspect is equivalent to the two argument form of :ref:`pragma Warnings<Pragma_Warnings>`,
-where the first argument is `ON` or `OFF` and the second argument
+where the first argument is ``ON`` or ``OFF`` and the second argument
is the entity.
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst
index 38731f3..6f03223 100644
--- a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst
@@ -27,7 +27,7 @@ Attribute Abort_Signal
======================
.. index:: Abort_Signal
-`Standard'Abort_Signal` (`Standard` is the only allowed
+``Standard'Abort_Signal`` (``Standard`` is the only allowed
prefix) provides the entity for the special exception used to signal
task abort or asynchronous transfer of control. Normally this attribute
should only be used in the tasking runtime (it is highly peculiar, and
@@ -36,13 +36,13 @@ intercept the abort exception).
Attribute Address_Size
======================
-.. index:: Size of `Address`
+.. index:: Size of ``Address``
.. index:: Address_Size
-`Standard'Address_Size` (`Standard` is the only allowed
+``Standard'Address_Size`` (``Standard`` is the only allowed
prefix) is a static constant giving the number of bits in an
-`Address`. It is the same value as System.Address'Size,
+``Address``. It is the same value as System.Address'Size,
but has the advantage of being static, while a direct
reference to System.Address'Size is nonstatic because Address
is a private type.
@@ -51,7 +51,7 @@ Attribute Asm_Input
===================
.. index:: Asm_Input
-The `Asm_Input` attribute denotes a function that takes two
+The ``Asm_Input`` attribute denotes a function that takes two
parameters. The first is a string, the second is an expression of the
type designated by the prefix. The first (string) argument is required
to be a static expression, and is the constraint for the parameter,
@@ -65,7 +65,7 @@ Attribute Asm_Output
====================
.. index:: Asm_Output
-The `Asm_Output` attribute denotes a function that takes two
+The ``Asm_Output`` attribute denotes a function that takes two
parameters. The first is a string, the second is the name of a variable
of the type designated by the attribute prefix. The first (string)
argument is required to be a static expression and designates the
@@ -74,14 +74,14 @@ required). The second argument is the variable to be updated with the
result. The possible values for constraint are the same as those used in
the RTL, and are dependent on the configuration file used to build the
GCC back end. If there are no output operands, then this argument may
-either be omitted, or explicitly given as `No_Output_Operands`.
+either be omitted, or explicitly given as ``No_Output_Operands``.
:ref:`Machine_Code_Insertions`
Attribute Atomic_Always_Lock_Free
=================================
.. index:: Atomic_Always_Lock_Free
-The prefix of the `Atomic_Always_Lock_Free` attribute is a type.
+The prefix of the ``Atomic_Always_Lock_Free`` attribute is a type.
The result is a Boolean value which is True if the type has discriminants,
and False otherwise. The result indicate whether atomic operations are
supported by the target for the given type.
@@ -90,11 +90,11 @@ Attribute Bit
=============
.. index:: Bit
-``obj'Bit``, where `obj` is any object, yields the bit
+``obj'Bit``, where ``obj`` is any object, yields the bit
offset within the storage unit (byte) that contains the first bit of
storage allocated for the object. The value of this attribute is of the
-type `Universal_Integer`, and is always a non-negative number not
-exceeding the value of `System.Storage_Unit`.
+type *universal_integer*, and is always a non-negative number not
+exceeding the value of ``System.Storage_Unit``.
For an object that is a variable or a constant allocated in a register,
the value is zero. (The use of this attribute does not force the
@@ -105,26 +105,26 @@ to either the matching actual parameter or to a copy of the
matching actual parameter.
For an access object the value is zero. Note that
-``obj.all'Bit`` is subject to an `Access_Check` for the
+``obj.all'Bit`` is subject to an ``Access_Check`` for the
designated object. Similarly for a record component
``X.C'Bit`` is subject to a discriminant check and
``X(I).Bit`` and ``X(I1..I2)'Bit``
are subject to index checks.
This attribute is designed to be compatible with the DEC Ada 83 definition
-and implementation of the `Bit` attribute.
+and implementation of the ``Bit`` attribute.
Attribute Bit_Position
======================
.. index:: Bit_Position
-``R.C'Bit_Position``, where `R` is a record object and `C` is one
+``R.C'Bit_Position``, where ``R`` is a record object and ``C`` is one
of the fields of the record type, yields the bit
offset within the record contains the first bit of
storage allocated for the object. The value of this attribute is of the
-type `Universal_Integer`. The value depends only on the field
-`C` and is independent of the alignment of
-the containing record `R`.
+type *universal_integer*. The value depends only on the field
+``C`` and is independent of the alignment of
+the containing record ``R``.
Attribute Code_Address
======================
@@ -133,7 +133,7 @@ Attribute Code_Address
.. index:: Address of subprogram code
-The `'Address`
+The ``'Address``
attribute may be applied to subprograms in Ada 95 and Ada 2005, but the
intended effect seems to be to provide
an address value which can be used to call the subprogram by means of
@@ -148,29 +148,29 @@ an address clause as in the following example:
pragma Import (Ada, L);
-A call to `L` is then expected to result in a call to `K`.
+A call to ``L`` is then expected to result in a call to ``K``.
In Ada 83, where there were no access-to-subprogram values, this was
a common work-around for getting the effect of an indirect call.
-GNAT implements the above use of `Address` and the technique
+GNAT implements the above use of ``Address`` and the technique
illustrated by the example code works correctly.
However, for some purposes, it is useful to have the address of the start
of the generated code for the subprogram. On some architectures, this is
-not necessarily the same as the `Address` value described above.
-For example, the `Address` value may reference a subprogram
+not necessarily the same as the ``Address`` value described above.
+For example, the ``Address`` value may reference a subprogram
descriptor rather than the subprogram itself.
-The `'Code_Address` attribute, which can only be applied to
+The ``'Code_Address`` attribute, which can only be applied to
subprogram entities, always returns the address of the start of the
generated code of the specified subprogram, which may or may not be
-the same value as is returned by the corresponding `'Address`
+the same value as is returned by the corresponding ``'Address``
attribute.
Attribute Compiler_Version
==========================
.. index:: Compiler_Version
-`Standard'Compiler_Version` (`Standard` is the only allowed
+``Standard'Compiler_Version`` (``Standard`` is the only allowed
prefix) yields a static string identifying the version of the compiler
being used to compile the unit containing the attribute reference.
@@ -178,12 +178,12 @@ Attribute Constrained
=====================
.. index:: Constrained
-In addition to the usage of this attribute in the Ada RM, `GNAT`
-also permits the use of the `'Constrained` attribute
+In addition to the usage of this attribute in the Ada RM, GNAT
+also permits the use of the ``'Constrained`` attribute
in a generic template
for any type, including types without discriminants. The value of this
attribute in the generic instance when applied to a scalar type or a
-record type without discriminants is always `True`. This usage is
+record type without discriminants is always ``True``. This usage is
compatible with older Ada compilers, including notably DEC Ada.
@@ -195,11 +195,11 @@ Attribute Default_Bit_Order
.. index:: Default_Bit_Order
-`Standard'Default_Bit_Order` (`Standard` is the only
-permissible prefix), provides the value `System.Default_Bit_Order`
-as a `Pos` value (0 for `High_Order_First`, 1 for
-`Low_Order_First`). This is used to construct the definition of
-`Default_Bit_Order` in package `System`.
+``Standard'Default_Bit_Order`` (``Standard`` is the only
+permissible prefix), provides the value ``System.Default_Bit_Order``
+as a ``Pos`` value (0 for ``High_Order_First``, 1 for
+``Low_Order_First``). This is used to construct the definition of
+``Default_Bit_Order`` in package ``System``.
Attribute Default_Scalar_Storage_Order
======================================
@@ -209,19 +209,19 @@ Attribute Default_Scalar_Storage_Order
.. index:: Default_Scalar_Storage_Order
-`Standard'Default_Scalar_Storage_Order` (`Standard` is the only
+``Standard'Default_Scalar_Storage_Order`` (``Standard`` is the only
permissible prefix), provides the current value of the default scalar storage
-order (as specified using pragma `Default_Scalar_Storage_Order`, or
-equal to `Default_Bit_Order` if unspecified) as a
-`System.Bit_Order` value. This is a static attribute.
+order (as specified using pragma ``Default_Scalar_Storage_Order``, or
+equal to ``Default_Bit_Order`` if unspecified) as a
+``System.Bit_Order`` value. This is a static attribute.
Attribute Deref
===============
.. index:: Deref
-The attribute `typ'Deref(expr)` where `expr` is of type `System.Address` yields
-the variable of type `typ` that is located at the given address. It is similar
-to `(totyp (expr).all)`, where `totyp` is an unchecked conversion from address to
+The attribute ``typ'Deref(expr)`` where ``expr`` is of type ``System.Address`` yields
+the variable of type ``typ`` that is located at the given address. It is similar
+to ``(totyp (expr).all)``, where ``totyp`` is an unchecked conversion from address to
a named access-to-`typ` type, except that it yields a variable, so it can be
used on the left side of an assignment.
@@ -233,7 +233,7 @@ Attribute Descriptor_Size
.. index:: Descriptor_Size
-Nonstatic attribute `Descriptor_Size` returns the size in bits of the
+Nonstatic attribute ``Descriptor_Size`` returns the size in bits of the
descriptor allocated for a type. The result is non-zero only for unconstrained
array types and the returned value is of type universal integer. In GNAT, an
array descriptor contains bounds information and is located immediately before
@@ -247,14 +247,14 @@ the first element of the array.
The attribute takes into account any additional padding due to type alignment.
In the example above, the descriptor contains two values of type
-`Positive` representing the low and high bound. Since `Positive` has
-a size of 31 bits and an alignment of 4, the descriptor size is `2 * Positive'Size + 2` or 64 bits.
+``Positive`` representing the low and high bound. Since ``Positive`` has
+a size of 31 bits and an alignment of 4, the descriptor size is ``2 * Positive'Size + 2`` or 64 bits.
Attribute Elaborated
====================
.. index:: Elaborated
-The prefix of the `'Elaborated` attribute must be a unit name. The
+The prefix of the ``'Elaborated`` attribute must be a unit name. The
value is a Boolean which indicates whether or not the given unit has been
elaborated. This attribute is primarily intended for internal use by the
generated code for dynamic elaboration checking, but it can also be used
@@ -305,7 +305,7 @@ Attribute Emax
.. index:: Emax
-The `Emax` attribute is provided for compatibility with Ada 83. See
+The ``Emax`` attribute is provided for compatibility with Ada 83. See
the Ada 83 reference manual for an exact description of the semantics of
this attribute.
@@ -313,21 +313,21 @@ Attribute Enabled
=================
.. index:: Enabled
-The `Enabled` attribute allows an application program to check at compile
+The ``Enabled`` attribute allows an application program to check at compile
time to see if the designated check is currently enabled. The prefix is a
simple identifier, referencing any predefined check name (other than
-`All_Checks`) or a check name introduced by pragma Check_Name. If
+``All_Checks``) or a check name introduced by pragma Check_Name. If
no argument is given for the attribute, the check is for the general state
of the check, if an argument is given, then it is an entity name, and the
-check indicates whether an `Suppress` or `Unsuppress` has been
+check indicates whether an ``Suppress`` or ``Unsuppress`` has been
given naming the entity (if not, then the argument is ignored).
Note that instantiations inherit the check status at the point of the
instantiation, so a useful idiom is to have a library package that
-introduces a check name with `pragma Check_Name`, and then contains
-generic packages or subprograms which use the `Enabled` attribute
+introduces a check name with ``pragma Check_Name``, and then contains
+generic packages or subprograms which use the ``Enabled`` attribute
to see if the check is enabled. A user of this package can then issue
-a `pragma Suppress` or `pragma Unsuppress` before instantiating
+a ``pragma Suppress`` or ``pragma Unsuppress`` before instantiating
the package or subprogram, controlling whether the check will be present.
Attribute Enum_Rep
@@ -336,7 +336,7 @@ Attribute Enum_Rep
.. index:: Enum_Rep
-For every enumeration subtype `S`, ``S'Enum_Rep`` denotes a
+For every enumeration subtype ``S``, ``S'Enum_Rep`` denotes a
function with the following spec:
.. code-block:: ada
@@ -344,26 +344,26 @@ function with the following spec:
function S'Enum_Rep (Arg : S'Base) return <Universal_Integer>;
-It is also allowable to apply `Enum_Rep` directly to an object of an
+It is also allowable to apply ``Enum_Rep`` directly to an object of an
enumeration type or to a non-overloaded enumeration
literal. In this case ``S'Enum_Rep`` is equivalent to
-``typ'Enum_Rep(S)`` where `typ` is the type of the
+``typ'Enum_Rep(S)`` where ``typ`` is the type of the
enumeration literal or object.
The function returns the representation value for the given enumeration
-value. This will be equal to value of the `Pos` attribute in the
+value. This will be equal to value of the ``Pos`` attribute in the
absence of an enumeration representation clause. This is a static
attribute (i.e.,:the result is static if the argument is static).
``S'Enum_Rep`` can also be used with integer types and objects,
in which case it simply returns the integer value. The reason for this
-is to allow it to be used for `(<>)` discrete formal arguments in
+is to allow it to be used for ``(<>)`` discrete formal arguments in
a generic unit that can be instantiated with either enumeration types
-or integer types. Note that if `Enum_Rep` is used on a modular
+or integer types. Note that if ``Enum_Rep`` is used on a modular
type whose upper bound exceeds the upper bound of the largest signed
integer type, and the argument is a variable, so that the universal
-integer calculation is done at run time, then the call to `Enum_Rep`
-may raise `Constraint_Error`.
+integer calculation is done at run time, then the call to ``Enum_Rep``
+may raise ``Constraint_Error``.
Attribute Enum_Val
==================
@@ -371,7 +371,7 @@ Attribute Enum_Val
.. index:: Enum_Val
-For every enumeration subtype `S`, ``S'Enum_Val`` denotes a
+For every enumeration subtype ``S``, ``S'Enum_Val`` denotes a
function with the following spec:
.. code-block:: ada
@@ -382,7 +382,7 @@ function with the following spec:
The function returns the enumeration value whose representation matches the
argument, or raises Constraint_Error if no enumeration literal of the type
has the matching value.
-This will be equal to value of the `Val` attribute in the
+This will be equal to value of the ``Val`` attribute in the
absence of an enumeration representation clause. This is a static
attribute (i.e., the result is static if the argument is static).
@@ -392,7 +392,7 @@ Attribute Epsilon
.. index:: Epsilon
-The `Epsilon` attribute is provided for compatibility with Ada 83. See
+The ``Epsilon`` attribute is provided for compatibility with Ada 83. See
the Ada 83 reference manual for an exact description of the semantics of
this attribute.
@@ -400,20 +400,20 @@ Attribute Fast_Math
===================
.. index:: Fast_Math
-`Standard'Fast_Math` (`Standard` is the only allowed
+``Standard'Fast_Math`` (``Standard`` is the only allowed
prefix) yields a static Boolean value that is True if pragma
-`Fast_Math` is active, and False otherwise.
+``Fast_Math`` is active, and False otherwise.
Attribute Finalization_Size
===========================
.. index:: Finalization_Size
-The prefix of attribute `Finalization_Size` must be an object or
+The prefix of attribute ``Finalization_Size`` must be an object or
a non-class-wide type. This attribute returns the size of any hidden data
reserved by the compiler to handle finalization-related actions. The type of
-the attribute is `universal_integer`.
+the attribute is *universal_integer*.
-`Finalization_Size` yields a value of zero for a type with no controlled
+``Finalization_Size`` yields a value of zero for a type with no controlled
parts, an object whose type has no controlled parts, or an object of a
class-wide type whose tag denotes a type with no controlled parts.
@@ -423,20 +423,20 @@ Attribute Fixed_Value
=====================
.. index:: Fixed_Value
-For every fixed-point type `S`, ``S'Fixed_Value`` denotes a
+For every fixed-point type ``S``, ``S'Fixed_Value`` denotes a
function with the following specification:
.. code-block:: ada
function S'Fixed_Value (Arg : <Universal_Integer>) return S;
-The value returned is the fixed-point value `V` such that::
+The value returned is the fixed-point value ``V`` such that::
V = Arg * S'Small
The effect is thus similar to first converting the argument to the
-integer type used to represent `S`, and then doing an unchecked
+integer type used to represent ``S``, and then doing an unchecked
conversion to the fixed-point type. The difference is
that there are full range checks, to ensure that the result is in range.
This attribute is primarily intended for use in implementation of the
@@ -455,7 +455,7 @@ Attribute Has_Access_Values
.. index:: Has_Access_Values
-The prefix of the `Has_Access_Values` attribute is a type. The result
+The prefix of the ``Has_Access_Values`` attribute is a type. The result
is a Boolean value which is True if the is an access type, or is a composite
type with a component (at any nesting depth) that is an access type, and is
False otherwise.
@@ -469,7 +469,7 @@ Attribute Has_Discriminants
.. index:: Has_Discriminants
-The prefix of the `Has_Discriminants` attribute is a type. The result
+The prefix of the ``Has_Discriminants`` attribute is a type. The result
is a Boolean value which is True if the type has discriminants, and False
otherwise. The intended use of this attribute is in conjunction with generic
definitions. If the attribute is applied to a generic private type, it
@@ -479,9 +479,9 @@ Attribute Img
=============
.. index:: Img
-The `Img` attribute differs from `Image` in that it is applied
+The ``Img`` attribute differs from ``Image`` in that it is applied
directly to an object, and yields the same result as
-`Image` for the subtype of the object. This is convenient for
+``Image`` for the subtype of the object. This is convenient for
debugging:
.. code-block:: ada
@@ -495,31 +495,31 @@ has the same meaning as the more verbose:
Put_Line ("X = " & T'Image (X));
-where `T` is the (sub)type of the object `X`.
+where ``T`` is the (sub)type of the object ``X``.
-Note that technically, in analogy to `Image`,
-`X'Img` returns a parameterless function
+Note that technically, in analogy to ``Image``,
+``X'Img`` returns a parameterless function
that returns the appropriate string when called. This means that
-`X'Img` can be renamed as a function-returning-string, or used
+``X'Img`` can be renamed as a function-returning-string, or used
in an instantiation as a function parameter.
Attribute Integer_Value
=======================
.. index:: Integer_Value
-For every integer type `S`, ``S'Integer_Value`` denotes a
+For every integer type ``S``, ``S'Integer_Value`` denotes a
function with the following spec:
.. code-block:: ada
function S'Integer_Value (Arg : <Universal_Fixed>) return S;
-The value returned is the integer value `V`, such that::
+The value returned is the integer value ``V``, such that::
Arg = V * T'Small
-where `T` is the type of `Arg`.
+where ``T`` is the type of ``Arg``.
The effect is thus similar to first doing an unchecked conversion from
the fixed-point type to its corresponding implementation type, and then
converting the result to the target integer type. The difference is
@@ -550,7 +550,7 @@ Attribute Large
.. index:: Large
-The `Large` attribute is provided for compatibility with Ada 83. See
+The ``Large`` attribute is provided for compatibility with Ada 83. See
the Ada 83 reference manual for an exact description of the semantics of
this attribute.
@@ -558,7 +558,7 @@ Attribute Library_Level
=======================
.. index:: Library_Level
-`P'Library_Level`, where P is an entity name,
+``P'Library_Level``, where P is an entity name,
returns a Boolean value which is True if the entity is declared
at the library level, and False otherwise. Note that within a
generic instantition, the name of the generic unit denotes the
@@ -582,8 +582,8 @@ Attribute Lock_Free
===================
.. index:: Lock_Free
-`P'Lock_Free`, where P is a protected object, returns True if a
-pragma `Lock_Free` applies to P.
+``P'Lock_Free``, where P is a protected object, returns True if a
+pragma ``Lock_Free`` applies to P.
Attribute Loop_Entry
====================
@@ -594,20 +594,20 @@ Syntax::
X'Loop_Entry [(loop_name)]
-The `Loop_Entry` attribute is used to refer to the value that an
+The ``Loop_Entry`` attribute is used to refer to the value that an
expression had upon entry to a given loop in much the same way that the
-`Old` attribute in a subprogram postcondition can be used to refer
+``Old`` attribute in a subprogram postcondition can be used to refer
to the value an expression had upon entry to the subprogram. The
relevant loop is either identified by the given loop name, or it is the
innermost enclosing loop when no loop name is given.
-A `Loop_Entry` attribute can only occur within a
-`Loop_Variant` or `Loop_Invariant` pragma. A common use of
-`Loop_Entry` is to compare the current value of objects with their
-initial value at loop entry, in a `Loop_Invariant` pragma.
+A ``Loop_Entry`` attribute can only occur within a
+``Loop_Variant`` or ``Loop_Invariant`` pragma. A common use of
+``Loop_Entry`` is to compare the current value of objects with their
+initial value at loop entry, in a ``Loop_Invariant`` pragma.
-The effect of using `X'Loop_Entry` is the same as declaring
-a constant initialized with the initial value of `X` at loop
+The effect of using ``X'Loop_Entry`` is the same as declaring
+a constant initialized with the initial value of ``X`` at loop
entry. This copy is not performed if the loop is not entered, or if the
corresponding pragmas are ignored or disabled.
@@ -615,7 +615,7 @@ Attribute Machine_Size
======================
.. index:: Machine_Size
-This attribute is identical to the `Object_Size` attribute. It is
+This attribute is identical to the ``Object_Size`` attribute. It is
provided for compatibility with the DEC Ada 83 attribute of this name.
Attribute Mantissa
@@ -624,7 +624,7 @@ Attribute Mantissa
.. index:: Mantissa
-The `Mantissa` attribute is provided for compatibility with Ada 83. See
+The ``Mantissa`` attribute is provided for compatibility with Ada 83. See
the Ada 83 reference manual for an exact description of the semantics of
this attribute.
@@ -636,7 +636,7 @@ Attribute Maximum_Alignment
.. index:: Maximum_Alignment
-`Standard'Maximum_Alignment` (`Standard` is the only
+``Standard'Maximum_Alignment`` (``Standard`` is the only
permissible 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
@@ -650,11 +650,11 @@ Attribute Mechanism_Code
.. index:: Mechanism_Code
-``function'Mechanism_Code`` yields an integer code for the
-mechanism used for the result of function, and
-``subprogram'Mechanism_Code (n)`` yields the mechanism
-used for formal parameter number `n` (a static integer value with 1
-meaning the first parameter) of `subprogram`. The code returned is:
+``func'Mechanism_Code`` yields an integer code for the
+mechanism used for the result of function ``func``, and
+``subprog'Mechanism_Code (n)`` yields the mechanism
+used for formal parameter number *n* (a static integer value, with 1
+meaning the first parameter) of subprogram ``subprog``. The code returned is:
@@ -671,7 +671,7 @@ Attribute Null_Parameter
.. index:: Null_Parameter
A reference ``T'Null_Parameter`` denotes an imaginary object of
-type or subtype `T` allocated at machine address zero. The attribute
+type or subtype ``T`` allocated at machine address zero. The attribute
is allowed only as the default expression of a formal parameter, or as
an actual expression of a subprogram call. In either case, the
subprogram must be imported.
@@ -682,7 +682,7 @@ default).
This capability is needed to specify that a zero address should be
passed for a record or other composite object passed by reference.
-There is no way of indicating this without the `Null_Parameter`
+There is no way of indicating this without the ``Null_Parameter``
attribute.
.. _Attribute-Object_Size:
@@ -696,8 +696,8 @@ Attribute Object_Size
The size of an object is not necessarily the same as the size of the type
of an object. This is because by default object sizes are increased to be
a multiple of the alignment of the object. For example,
-`Natural'Size` is
-31, but by default objects of type `Natural` will have a size of 32 bits.
+``Natural'Size`` is
+31, but by default objects of type ``Natural`` will have a size of 32 bits.
Similarly, a record containing an integer and a character:
.. code-block:: ada
@@ -708,7 +708,7 @@ Similarly, a record containing an integer and a character:
end record;
-will have a size of 40 (that is `Rec'Size` will be 40). The
+will have a size of 40 (that is ``Rec'Size`` will be 40). The
alignment will be 4, because of the
integer field, and so the default size of record objects for this type
will be 64 (8 bytes).
@@ -720,7 +720,7 @@ an object size of 40 can be explicitly specified in this case.
A consequence of this capability is that different object sizes can be
given to subtypes that would otherwise be considered in Ada to be
statically matching. But it makes no sense to consider such subtypes
-as statically matching. Consequently, in `GNAT` we add a rule
+as statically matching. Consequently, GNAT adds a rule
to the static matching rules that requires object sizes to match.
Consider this example:
@@ -746,10 +746,10 @@ Consider this example:
In the absence of lines 5 and 6,
-types `R1` and `R2` statically match and
+types ``R1`` and ``R2`` statically match and
hence the conversion on line 12 is legal. But since lines 5 and 6
-cause the object sizes to differ, `GNAT` considers that types
-`R1` and `R2` are not statically matching, and line 12
+cause the object sizes to differ, GNAT considers that types
+``R1`` and ``R2`` are not statically matching, and line 12
generates the diagnostic shown above.
Similar additional checks are performed in other contexts requiring
@@ -759,13 +759,13 @@ Attribute Old
=============
.. index:: Old
-In addition to the usage of `Old` defined in the Ada 2012 RM (usage
-within `Post` aspect), GNAT also permits the use of this attribute
-in implementation defined pragmas `Postcondition`,
-`Contract_Cases` and `Test_Case`. Also usages of
-`Old` which would be illegal according to the Ada 2012 RM
+In addition to the usage of ``Old`` defined in the Ada 2012 RM (usage
+within ``Post`` aspect), GNAT also permits the use of this attribute
+in implementation defined pragmas ``Postcondition``,
+``Contract_Cases`` and ``Test_Case``. Also usages of
+``Old`` which would be illegal according to the Ada 2012 RM
definition are allowed under control of
-implementation defined pragma `Unevaluated_Use_Of_Old`.
+implementation defined pragma ``Unevaluated_Use_Of_Old``.
Attribute Passed_By_Reference
=============================
@@ -773,10 +773,10 @@ Attribute Passed_By_Reference
.. index:: Passed_By_Reference
-``type'Passed_By_Reference`` for any subtype `type` returns
-a value of type `Boolean` value that is `True` if the type is
-normally passed by reference and `False` if the type is normally
-passed by copy in calls. For scalar types, the result is always `False`
+``typ'Passed_By_Reference`` for any subtype `typ` returns
+a value of type ``Boolean`` value that is ``True`` if the type is
+normally passed by reference and ``False`` if the type is normally
+passed by copy in calls. For scalar types, the result is always ``False``
and is static. For non-scalar types, the result is nonstatic.
Attribute Pool_Address
@@ -785,7 +785,7 @@ Attribute Pool_Address
.. index:: Pool_Address
-``X'Pool_Address`` for any object `X` returns the address
+``X'Pool_Address`` for any object ``X`` returns the address
of X within its storage pool. This is the same as
``X'Address``, except that for an unconstrained array whose
bounds are allocated just before the first component,
@@ -797,18 +797,18 @@ Here, we are interpreting 'storage pool' broadly to mean
``wherever the object is allocated``, which could be a
user-defined storage pool,
the global heap, on the stack, or in a static memory area.
-For an object created by `new`, ``Ptr.all'Pool_Address`` is
-what is passed to `Allocate` and returned from `Deallocate`.
+For an object created by ``new``, ``Ptr.all'Pool_Address`` is
+what is passed to ``Allocate`` and returned from ``Deallocate``.
Attribute Range_Length
======================
.. index:: Range_Length
-``type'Range_Length`` for any discrete type `type` yields
+``typ'Range_Length`` for any discrete type `typ` yields
the number of values represented by the subtype (zero for a null
-range). The result is static for static subtypes. `Range_Length`
+range). The result is static for static subtypes. ``Range_Length``
applied to the index subtype of a one dimensional array always gives the
-same result as `Length` applied to the array itself.
+same result as ``Length`` applied to the array itself.
Attribute Restriction_Set
=========================
@@ -832,7 +832,7 @@ There are two forms:
In the case of the first form, the only restriction names
allowed are parameterless restrictions that are checked
for consistency at bind time. For a complete list see the
-subtype `System.Rident.Partition_Boolean_Restrictions`.
+subtype ``System.Rident.Partition_Boolean_Restrictions``.
The result returned is True if the restriction is known to
be in effect, and False if the restriction is known not to
@@ -894,7 +894,7 @@ Attribute Safe_Emax
.. index:: Safe_Emax
-The `Safe_Emax` attribute is provided for compatibility with Ada 83. See
+The ``Safe_Emax`` attribute is provided for compatibility with Ada 83. See
the Ada 83 reference manual for an exact description of the semantics of
this attribute.
@@ -904,7 +904,7 @@ Attribute Safe_Large
.. index:: Safe_Large
-The `Safe_Large` attribute is provided for compatibility with Ada 83. See
+The ``Safe_Large`` attribute is provided for compatibility with Ada 83. See
the Ada 83 reference manual for an exact description of the semantics of
this attribute.
@@ -914,7 +914,7 @@ Attribute Safe_Small
.. index:: Safe_Small
-The `Safe_Small` attribute is provided for compatibility with Ada 83. See
+The ``Safe_Small`` attribute is provided for compatibility with Ada 83. See
the Ada 83 reference manual for an exact description of the semantics of
this attribute.
@@ -928,8 +928,8 @@ Attribute Scalar_Storage_Order
.. index:: Scalar_Storage_Order
-For every array or record type `S`, the representation attribute
-`Scalar_Storage_Order` denotes the order in which storage elements
+For every array or record type ``S``, the representation attribute
+``Scalar_Storage_Order`` denotes the order in which storage elements
that make up scalar components are ordered within S. The value given must
be a static expression of type System.Bit_Order. The following is an example
of the use of this feature:
@@ -967,13 +967,13 @@ of the use of this feature:
-- the former is used.
-Other properties are as for standard representation attribute `Bit_Order`,
-as defined by Ada RM 13.5.3(4). The default is `System.Default_Bit_Order`.
+Other properties are as for standard representation attribute ``Bit_Order``,
+as defined by Ada RM 13.5.3(4). The default is ``System.Default_Bit_Order``.
-For a record type `T`, if ``T'Scalar_Storage_Order`` is
+For a record type ``T``, if ``T'Scalar_Storage_Order`` is
specified explicitly, it shall be equal to ``T'Bit_Order``. Note:
-this means that if a `Scalar_Storage_Order` attribute definition
-clause is not confirming, then the type's `Bit_Order` shall be
+this means that if a ``Scalar_Storage_Order`` attribute definition
+clause is not confirming, then the type's ``Bit_Order`` shall be
specified explicitly and set to the same value.
Derived types inherit an explicitly set scalar storage order from their parent
@@ -981,18 +981,19 @@ types. This may be overridden for the derived type by giving an explicit scalar
storage order for the derived type. For a record extension, the derived type
must have the same scalar storage order as the parent type.
-A component of a record or array type that is a bit-packed array, or that
-does not start on a byte boundary, must have the same scalar storage order
-as the enclosing record or array type.
+A component of a record type that is itself a record or an array and that does
+not start and end on a byte boundary must have have the same scalar storage
+order as the record type. A component of a bit-packed array type that is itself
+a record or an array must have the same scalar storage order as the array type.
-No component of a type that has an explicit `Scalar_Storage_Order`
+No component of a type that has an explicit ``Scalar_Storage_Order``
attribute definition may be aliased.
-A confirming `Scalar_Storage_Order` attribute definition clause (i.e.
-with a value equal to `System.Default_Bit_Order`) has no effect.
+A confirming ``Scalar_Storage_Order`` attribute definition clause (i.e.
+with a value equal to ``System.Default_Bit_Order``) has no effect.
If the opposite storage order is specified, then whenever the value of
-a scalar component of an object of type `S` is read, the storage
+a scalar component of an object of type ``S`` is read, the storage
elements of the enclosing machine scalar are first reversed (before
retrieving the component value, possibly applying some shift and mask
operatings on the enclosing machine scalar), and the opposite operation
@@ -1002,23 +1003,23 @@ In that case, the restrictions set forth in 13.5.1(10.3/2) for scalar components
are relaxed. Instead, the following rules apply:
* the underlying storage elements are those at positions
- `(position + first_bit / storage_element_size) .. (position + (last_bit + storage_element_size - 1) / storage_element_size)`
+ ``(position + first_bit / storage_element_size) .. (position + (last_bit + storage_element_size - 1) / storage_element_size)``
* the sequence of underlying storage elements shall have
a size no greater than the largest machine scalar
* the enclosing machine scalar is defined as the smallest machine
scalar starting at a position no greater than
- `position + first_bit / storage_element_size` and covering
- storage elements at least up to `position + (last_bit + storage_element_size - 1) / storage_element_size`
+ ``position + first_bit / storage_element_size`` and covering
+ storage elements at least up to ``position + (last_bit + storage_element_size - 1) / storage_element_size```
* the position of the component is interpreted relative to that machine
scalar.
If no scalar storage order is specified for a type (either directly, or by
inheritance in the case of a derived type), then the default is normally
the native ordering of the target, but this default can be overridden using
-pragma `Default_Scalar_Storage_Order`.
+pragma ``Default_Scalar_Storage_Order``.
-Note that if a component of `T` is itself of a record or array type,
-the specfied `Scalar_Storage_Order` does *not* apply to that nested type:
+Note that if a component of ``T`` is itself of a record or array type,
+the specfied ``Scalar_Storage_Order`` does *not* apply to that nested type:
an explicit attribute definition clause must be provided for the component
type as well if desired.
@@ -1036,8 +1037,8 @@ Attribute Simple_Storage_Pool
.. index:: Simple_Storage_Pool
-For every nonformal, nonderived access-to-object type `Acc`, the
-representation attribute `Simple_Storage_Pool` may be specified
+For every nonformal, nonderived access-to-object type ``Acc``, the
+representation attribute ``Simple_Storage_Pool`` may be specified
via an attribute_definition_clause (or by specifying the equivalent aspect):
.. code-block:: ada
@@ -1051,7 +1052,7 @@ via an attribute_definition_clause (or by specifying the equivalent aspect):
The name given in an attribute_definition_clause for the
-`Simple_Storage_Pool` attribute shall denote a variable of
+``Simple_Storage_Pool`` attribute shall denote a variable of
a 'simple storage pool type' (see pragma `Simple_Storage_Pool_Type`).
The use of this attribute is only allowed for a prefix denoting a type
@@ -1059,35 +1060,35 @@ for which it has been specified. The type of the attribute is the type
of the variable specified as the simple storage pool of the access type,
and the attribute denotes that variable.
-It is illegal to specify both `Storage_Pool` and `Simple_Storage_Pool`
+It is illegal to specify both ``Storage_Pool`` and ``Simple_Storage_Pool``
for the same access type.
-If the `Simple_Storage_Pool` attribute has been specified for an access
-type, then applying the `Storage_Pool` attribute to the type is flagged
-with a warning and its evaluation raises the exception `Program_Error`.
+If the ``Simple_Storage_Pool`` attribute has been specified for an access
+type, then applying the ``Storage_Pool`` attribute to the type is flagged
+with a warning and its evaluation raises the exception ``Program_Error``.
If the Simple_Storage_Pool attribute has been specified for an access
-type `S`, then the evaluation of the attribute ``S'Storage_Size``
+type ``S``, then the evaluation of the attribute ``S'Storage_Size``
returns the result of calling ``Storage_Size (S'Simple_Storage_Pool)``,
which is intended to indicate the number of storage elements reserved for
the simple storage pool. If the Storage_Size function has not been defined
for the simple storage pool type, then this attribute returns zero.
-If an access type `S` has a specified simple storage pool of type
-`SSP`, then the evaluation of an allocator for that access type calls
-the primitive `Allocate` procedure for type `SSP`, passing
+If an access type ``S`` has a specified simple storage pool of type
+``SSP``, then the evaluation of an allocator for that access type calls
+the primitive ``Allocate`` procedure for type ``SSP``, passing
``S'Simple_Storage_Pool`` as the pool parameter. The detailed
semantics of such allocators is the same as those defined for allocators
in section 13.11 of the :title:`Ada Reference Manual`, with the term
-`simple storage pool` substituted for `storage pool`.
+*simple storage pool* substituted for *storage pool*.
-If an access type `S` has a specified simple storage pool of type
-`SSP`, then a call to an instance of the `Ada.Unchecked_Deallocation`
-for that access type invokes the primitive `Deallocate` procedure
-for type `SSP`, passing ``S'Simple_Storage_Pool`` as the pool
+If an access type ``S`` has a specified simple storage pool of type
+``SSP``, then a call to an instance of the ``Ada.Unchecked_Deallocation``
+for that access type invokes the primitive ``Deallocate`` procedure
+for type ``SSP``, passing ``S'Simple_Storage_Pool`` as the pool
parameter. The detailed semantics of such unchecked deallocations is the same
as defined in section 13.11.2 of the Ada Reference Manual, except that the
-term 'simple storage pool' is substituted for 'storage pool'.
+term *simple storage pool* is substituted for *storage pool*.
Attribute Small
===============
@@ -1095,7 +1096,7 @@ Attribute Small
.. index:: Small
-The `Small` attribute is defined in Ada 95 (and Ada 2005) only for
+The ``Small`` attribute is defined in Ada 95 (and Ada 2005) only for
fixed-point types.
GNAT also allows this attribute to be applied to floating-point types
for compatibility with Ada 83. See
@@ -1106,8 +1107,8 @@ Attribute Storage_Unit
======================
.. index:: Storage_Unit
-`Standard'Storage_Unit` (`Standard` is the only permissible
-prefix) provides the same value as `System.Storage_Unit`.
+``Standard'Storage_Unit`` (``Standard`` is the only permissible
+prefix) provides the same value as ``System.Storage_Unit``.
Attribute Stub_Type
===================
@@ -1122,12 +1123,12 @@ call on any dispatching operation of such a stub object does the
remote call, if necessary, using the information in the stub object
to locate the target partition, etc.
-For a prefix `T` that denotes a remote access-to-classwide type,
-`T'Stub_Type` denotes the type of the corresponding stub objects.
+For a prefix ``T`` that denotes a remote access-to-classwide type,
+``T'Stub_Type`` denotes the type of the corresponding stub objects.
-By construction, the layout of `T'Stub_Type` is identical to that of
-type `RACW_Stub_Type` declared in the internal implementation-defined
-unit `System.Partition_Interface`. Use of this attribute will create
+By construction, the layout of ``T'Stub_Type`` is identical to that of
+type ``RACW_Stub_Type`` declared in the internal implementation-defined
+unit ``System.Partition_Interface``. Use of this attribute will create
an implicit dependency on this unit.
Attribute System_Allocator_Alignment
@@ -1136,7 +1137,7 @@ Attribute System_Allocator_Alignment
.. index:: System_Allocator_Alignment
-`Standard'System_Allocator_Alignment` (`Standard` is the only
+``Standard'System_Allocator_Alignment`` (``Standard`` is the only
permissible prefix) provides the observable guaranted to be honored by
the system allocator (malloc). This is a static value that can be used
in user storage pools based on malloc either to reject allocation
@@ -1147,7 +1148,7 @@ Attribute Target_Name
=====================
.. index:: Target_Name
-`Standard'Target_Name` (`Standard` is the only permissible
+``Standard'Target_Name`` (``Standard`` is the only permissible
prefix) provides a static string value that identifies the target
for the current compilation. For GCC implementations, this is the
standard gcc target name without the terminating slash (for
@@ -1157,10 +1158,10 @@ Attribute To_Address
====================
.. index:: To_Address
-The `System'To_Address`
-(`System` is the only permissible prefix)
+The ``System'To_Address``
+(``System`` is the only permissible prefix)
denotes a function identical to
-`System.Storage_Elements.To_Address` except that
+``System.Storage_Elements.To_Address`` except that
it is a static attribute. This means that if its argument is
a static expression, then the result of the attribute is a
static expression. This means that such an expression can be
@@ -1184,9 +1185,9 @@ Attribute Type_Class
====================
.. index:: Type_Class
-``type'Type_Class`` for any type or subtype `type` yields
-the value of the type class for the full type of `type`. If
-`type` is a generic formal type, the value is the value for the
+``typ'Type_Class`` for any type or subtype `typ` yields
+the value of the type class for the full type of `typ`. If
+`typ` is a generic formal type, the value is the value for the
corresponding actual subtype. The value of this attribute is of type
``System.Aux_DEC.Type_Class``, which has the following definition:
@@ -1204,7 +1205,7 @@ corresponding actual subtype. The value of this attribute is of type
Type_Class_Address);
-Protected types yield the value `Type_Class_Task`, which thus
+Protected types yield the value ``Type_Class_Task``, which thus
applies to all concurrent types. This attribute is designed to
be compatible with the DEC Ada 83 attribute of the same name.
@@ -1212,7 +1213,7 @@ Attribute Type_Key
==================
.. index:: Type_Key
-The `Type_Key` attribute is applicable to a type or subtype and
+The ``Type_Key`` attribute is applicable to a type or subtype and
yields a value of type Standard.String containing encoded information
about the type or subtype. This provides improved compatibility with
other implementations that support this attribute.
@@ -1228,10 +1229,10 @@ Attribute Unconstrained_Array
=============================
.. index:: Unconstrained_Array
-The `Unconstrained_Array` attribute can be used with a prefix that
+The ``Unconstrained_Array`` attribute can be used with a prefix that
denotes any type or subtype. It is a static attribute that yields
-`True` if the prefix designates an unconstrained array,
-and `False` otherwise. In a generic instance, the result is
+``True`` if the prefix designates an unconstrained array,
+and ``False`` otherwise. In a generic instance, the result is
still static, and yields the result of applying this test to the
generic actual.
@@ -1241,7 +1242,7 @@ Attribute Universal_Literal_String
.. index:: Universal_Literal_String
-The prefix of `Universal_Literal_String` must be a named
+The prefix of ``Universal_Literal_String`` must be a named
number. The static result is the string consisting of the characters of
the number as defined in the original source. This allows the user
program to access the actual text of named numbers without intermediate
@@ -1266,18 +1267,18 @@ Attribute Unrestricted_Access
.. index:: Unrestricted_Access
-The `Unrestricted_Access` attribute is similar to `Access`
+The ``Unrestricted_Access`` attribute is similar to ``Access``
except that all accessibility and aliased view checks are omitted. This
is a user-beware attribute.
-For objects, it is similar to `Address`, for which it is a
+For objects, it is similar to ``Address``, for which it is a
desirable replacement where the value desired is an access type.
In other words, its effect is similar to first applying the
-`Address` attribute and then doing an unchecked conversion to a
+``Address`` attribute and then doing an unchecked conversion to a
desired access type.
-For subprograms, `P'Unrestricted_Access` may be used where
-`P'Access` would be illegal, to construct a value of a
+For subprograms, ``P'Unrestricted_Access`` may be used where
+``P'Access`` would be illegal, to construct a value of a
less-nested named access type that designates a more-nested
subprogram. This value may be used in indirect calls, so long as the
more-nested subprogram still exists; once the subprogram containing it
@@ -1314,11 +1315,11 @@ When P1 is called from P2, the call via Global is OK, but if P1 were
called after P2 returns, it would be an erroneous use of a dangling
pointer.
-For objects, it is possible to use `Unrestricted_Access` for any
+For objects, it is possible to use ``Unrestricted_Access`` for any
type. However, if the result is of an access-to-unconstrained array
subtype, then the resulting pointer has the same scope as the context
of the attribute, and must not be returned to some enclosing scope.
-For instance, if a function uses `Unrestricted_Access` to create
+For instance, if a function uses ``Unrestricted_Access`` to create
an access-to-unconstrained-array and returns that value to the caller,
the result will involve dangling pointers. In addition, it is only
valid to create pointers to unconstrained arrays using this attribute
@@ -1398,17 +1399,17 @@ considered to be erroneous. Consider the following example:
A normal unconstrained array value
or a constrained array object marked as aliased has the bounds in memory
just before the array, so a thin pointer can retrieve both the data and
-the bounds. But in this case, the non-aliased object `X` does not have the
-bounds before the string. If the size clause for type `A`
+the bounds. But in this case, the non-aliased object ``X`` does not have the
+bounds before the string. If the size clause for type ``A``
were not present, then the pointer
would be a fat pointer, where one component is a pointer to the bounds,
and all would be well. But with the size clause present, the conversion from
fat pointer to thin pointer in the call loses the bounds, and so this
-is erroneous, and the program likely raises a `Program_Error` exception.
+is erroneous, and the program likely raises a ``Program_Error`` exception.
In general, it is advisable to completely
avoid mixing the use of thin pointers and the use of
-`Unrestricted_Access` where the designated type is an
+``Unrestricted_Access`` where the designated type is an
unconstrained array. The use of thin pointers should be restricted to
cases of porting legacy code that implicitly assumes the size of pointers,
and such code should not in any case be using this attribute.
@@ -1431,8 +1432,8 @@ Here we attempt to modify the constant P from 4 to 3, but the compiler may
or may not notice this attempt, and subsequent references to P may yield
either the value 3 or the value 4 or the assignment may blow up if the
compiler decides to put P in read-only memory. One particular case where
-`Unrestricted_Access` can be used in this way is to modify the
-value of an `IN` parameter:
+``Unrestricted_Access`` can be used in this way is to modify the
+value of an ``in`` parameter:
.. code-block:: ada
@@ -1445,14 +1446,14 @@ value of an `IN` parameter:
In general this is a risky approach. It may appear to "work" but such uses of
-`Unrestricted_Access` are potentially non-portable, even from one version
-of `GNAT` to another, so are best avoided if possible.
+``Unrestricted_Access`` are potentially non-portable, even from one version
+of GNAT to another, so are best avoided if possible.
Attribute Update
================
.. index:: Update
-The `Update` attribute creates a copy of an array or record value
+The ``Update`` attribute creates a copy of an array or record value
with one or more modified components. The syntax is::
PREFIX'Update ( RECORD_COMPONENT_ASSOCIATION_LIST )
@@ -1465,9 +1466,9 @@ with one or more modified components. The syntax is::
INDEX_EXPRESSION_LIST ::= ( EXPRESSION {, EXPRESSION } )
-where `PREFIX` is the name of an array or record object, the
-association list in parentheses does not contain an `others`
-choice and the box symbol `<>` may not appear in any
+where ``PREFIX`` is the name of an array or record object, the
+association list in parentheses does not contain an ``others``
+choice and the box symbol ``<>`` may not appear in any
expression. The effect is to yield a copy of the array or record value
which is unchanged apart from the components mentioned in the
association list, which are changed to the indicated value. The
@@ -1482,7 +1483,7 @@ example:
Avar2 : Arr := Avar1'Update (2 => 10, 3 .. 4 => 20);
-yields a value for `Avar2` of 1,10,20,20,5 with `Avar1`
+yields a value for ``Avar2`` of 1,10,20,20,5 with ``Avar1``
begin unmodified. Similarly:
.. code-block:: ada
@@ -1493,8 +1494,8 @@ begin unmodified. Similarly:
Rvar2 : Rec := Rvar1'Update (B => 20);
-yields a value for `Rvar2` of (A => 1, B => 20, C => 3),
-with `Rvar1` being unmodifed.
+yields a value for ``Rvar2`` of (A => 1, B => 20, C => 3),
+with ``Rvar1`` being unmodifed.
Note that the value of the attribute reference is computed
completely before it is used. This means that if you write:
@@ -1503,13 +1504,13 @@ completely before it is used. This means that if you write:
Avar1 := Avar1'Update (1 => 10, 2 => Function_Call);
-then the value of `Avar1` is not modified if `Function_Call`
+then the value of ``Avar1`` is not modified if ``Function_Call``
raises an exception, unlike the effect of a series of direct assignments
-to elements of `Avar1`. In general this requires that
+to elements of ``Avar1``. In general this requires that
two extra complete copies of the object are required, which should be
kept in mind when considering efficiency.
-The `Update` attribute cannot be applied to prefixes of a limited
+The ``Update`` attribute cannot be applied to prefixes of a limited
type, and cannot reference discriminants in the case of a record type.
The accessibility level of an Update attribute result object is defined
as for an aggregate.
@@ -1533,29 +1534,29 @@ Attribute Valid_Scalars
=======================
.. index:: Valid_Scalars
-The `'Valid_Scalars` attribute is intended to make it easier to
+The ``'Valid_Scalars`` attribute is intended to make it easier to
check the validity of scalar subcomponents of composite objects. It
-is defined for any prefix `X` that denotes an object.
+is defined for any prefix ``X`` that denotes an object.
The value of this attribute is of the predefined type Boolean.
-`X'Valid_Scalars` yields True if and only if evaluation of
-`P'Valid` yields True for every scalar part P of X or if X has
+``X'Valid_Scalars`` yields True if and only if evaluation of
+``P'Valid`` yields True for every scalar part P of X or if X has
no scalar parts. It is not specified in what order the scalar parts
are checked, nor whether any more are checked after any one of them
-is determined to be invalid. If the prefix `X` is of a class-wide
-type `T'Class` (where `T` is the associated specific type),
-or if the prefix `X` is of a specific tagged type `T`, then
-only the scalar parts of components of `T` are traversed; in other
-words, components of extensions of `T` are not traversed even if
-`T'Class (X)'Tag /= T'Tag` . The compiler will issue a warning if it can
+is determined to be invalid. If the prefix ``X`` is of a class-wide
+type ``T'Class`` (where ``T`` is the associated specific type),
+or if the prefix ``X`` is of a specific tagged type ``T``, then
+only the scalar parts of components of ``T`` are traversed; in other
+words, components of extensions of ``T`` are not traversed even if
+``T'Class (X)'Tag /= T'Tag`` . The compiler will issue a warning if it can
be determined at compile time that the prefix of the attribute has no
scalar parts (e.g., if the prefix is of an access type, an interface type,
an undiscriminated task type, or an undiscriminated protected type).
-For scalar types, `Valid_Scalars` is equivalent to `Valid`. The use
-of this attribute is not permitted for `Unchecked_Union` types for which
+For scalar types, ``Valid_Scalars`` is equivalent to ``Valid``. The use
+of this attribute is not permitted for ``Unchecked_Union`` types for which
in general it is not possible to determine the values of the discriminants.
-Note: `Valid_Scalars` can generate a lot of code, especially in the case
+Note: ``Valid_Scalars`` can generate a lot of code, especially in the case
of a large variant record. If the attribute is called in many places in the
same program applied to objects of the same type, it can reduce program size
to write a function with a single use of the attribute, and then call that
@@ -1567,13 +1568,13 @@ Attribute VADS_Size
.. index:: VADS_Size
-The `'VADS_Size` attribute is intended to make it easier to port
-legacy code which relies on the semantics of `'Size` as implemented
+The ``'VADS_Size`` attribute is intended to make it easier to port
+legacy code which relies on the semantics of ``'Size`` as implemented
by the VADS Ada 83 compiler. GNAT makes a best effort at duplicating the
-same semantic interpretation. In particular, `'VADS_Size` applied
+same semantic interpretation. In particular, ``'VADS_Size`` applied
to a predefined or other primitive type with no Size clause yields the
-Object_Size (for example, `Natural'Size` is 32 rather than 31 on
-typical machines). In addition `'VADS_Size` applied to an object
+Object_Size (for example, ``Natural'Size`` is 32 rather than 31 on
+typical machines). In addition ``'VADS_Size`` applied to an object
gives the result that would be obtained by applying the attribute to
the corresponding type.
@@ -1587,22 +1588,22 @@ Attribute Value_Size
``type'Value_Size`` is the number of bits required to represent
a value of the given subtype. It is the same as ``type'Size``,
-but, unlike `Size`, may be set for non-first subtypes.
+but, unlike ``Size``, may be set for non-first subtypes.
Attribute Wchar_T_Size
======================
.. index:: Wchar_T_Size
-`Standard'Wchar_T_Size` (`Standard` is the only permissible
-prefix) provides the size in bits of the C `wchar_t` type
+``Standard'Wchar_T_Size`` (``Standard`` is the only permissible
+prefix) provides the size in bits of the C ``wchar_t`` type
primarily for constructing the definition of this type in
-package `Interfaces.C`. The result is a static constant.
+package ``Interfaces.C``. The result is a static constant.
Attribute Word_Size
===================
.. index:: Word_Size
-`Standard'Word_Size` (`Standard` is the only permissible
-prefix) provides the value `System.Word_Size`. The result is
+``Standard'Word_Size`` (``Standard`` is the only permissible
+prefix) provides the value ``System.Word_Size``. The result is
a static constant.
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst b/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst
index 10c4a09..44d2993 100644
--- a/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst
@@ -45,7 +45,7 @@ There are no variations from the standard.
"Which code_statements cause external
interactions. See 1.1.3(10)."
-Any `code_statement` can potentially cause external interactions.
+Any *code_statement* can potentially cause external interactions.
*
"The coded representation for the text of an Ada
@@ -80,16 +80,16 @@ length of a lexical element is the same as the maximum line length.
See :ref:`Implementation_Defined_Pragmas`.
*
- "Effect of pragma `Optimize`. See 2.8(27)."
+ "Effect of pragma ``Optimize``. See 2.8(27)."
-Pragma `Optimize`, if given with a `Time` or `Space`
+Pragma ``Optimize``, if given with a ``Time`` or ``Space``
parameter, checks that the optimization flag is set, and aborts if it is
not.
*
"The sequence of characters of the value returned by
``S'Image`` when some of the graphic characters of
- ``S'Wide_Image`` are not defined in `Character`. See
+ ``S'Wide_Image`` are not defined in ``Character``. See
3.5(37)."
The sequence of characters is as defined by the wide character encoding
@@ -98,7 +98,7 @@ further details.
*
"The predefined integer types declared in
- `Standard`. See 3.5.4(25)."
+ ``Standard``. See 3.5.4(25)."
====================== =======================================
Type Representation
@@ -132,7 +132,7 @@ The precision and range is as defined by the IEEE standard.
*
"The predefined floating point types declared in
- `Standard`. See 3.5.7(16)."
+ ``Standard``. See 3.5.7(16)."
====================== ====================================================
Type Representation
@@ -146,14 +146,14 @@ Type Representation
*
"The small of an ordinary fixed point type. See 3.5.9(8)."
-`Fine_Delta` is 2**(-63)
+``Fine_Delta`` is 2**(-63)
*
"What combinations of small, range, and digits are
supported for fixed point types. See 3.5.9(10)."
Any combinations are permitted that do not result in a small less than
-`Fine_Delta` and do not result in a mantissa larger than 63 bits.
+``Fine_Delta`` and do not result in a mantissa larger than 63 bits.
If the mantissa is larger than 53 bits on machines where Long_Long_Float
is 64 bits (true of all architectures except ia32), then the output from
Text_IO is accurate to only 53 bits, rather than the full mantissa. This
@@ -161,10 +161,10 @@ is because floating-point conversions are used to convert fixed point.
*
- "The result of `Tags.Expanded_Name` for types declared
- within an unnamed `block_statement`. See 3.9(10)."
+ "The result of ``Tags.Expanded_Name`` for types declared
+ within an unnamed *block_statement*. See 3.9(10)."
-Block numbers of the form `B`nnn``, where `nnn` is a
+Block numbers of the form :samp:`B{nnn}`, where *nnn* is a
decimal integer are allocated.
*
@@ -181,33 +181,33 @@ There are no implementation-defined time types.
"The time base associated with relative delays."
See 9.6(20). The time base used is that provided by the C library
-function `gettimeofday`.
+function ``gettimeofday``.
*
- "The time base of the type `Calendar.Time`. See
+ "The time base of the type ``Calendar.Time``. See
9.6(23)."
The time base used is that provided by the C library function
-`gettimeofday`.
+``gettimeofday``.
*
- "The time zone used for package `Calendar`
+ "The time zone used for package ``Calendar``
operations. See 9.6(24)."
-The time zone used by package `Calendar` is the current system time zone
+The time zone used by package ``Calendar`` is the current system time zone
setting for local time, as accessed by the C library function
-`localtime`.
+``localtime``.
*
- "Any limit on `delay_until_statements` of
- `select_statements`. See 9.6(29)."
+ "Any limit on *delay_until_statements* of
+ *select_statements*. See 9.6(29)."
There are no such limits.
*
"Whether or not two non-overlapping parts of a composite
object are independently addressable, in the case where packing, record
- layout, or `Component_Size` is specified for the object. See
+ layout, or ``Component_Size`` is specified for the object. See
9.10(1)."
Separate components are independently addressable if they do not share
@@ -253,7 +253,7 @@ provides the binder options *-z* and *-n* respectively, and in
this case a list of units can be explicitly supplied to the binder for
inclusion in the partition (all units needed by these units will also
be included automatically). For full details on the use of these
-options, refer to the `GNAT Make Program gnatmake` in the
+options, refer to *GNAT Make Program gnatmake* in the
:title:`GNAT User's Guide`.
*
@@ -274,7 +274,7 @@ The main program is designated by providing the name of the
corresponding :file:`ALI` file as the input parameter to the binder.
*
- "The order of elaboration of `library_items`. See
+ "The order of elaboration of *library_items*. See
10.2(18)."
The first constraint on ordering is that it meets the requirements of
@@ -293,7 +293,7 @@ where a choice still remains.
The main program has no parameters. It may be a procedure, or a function
returning an integer type. In the latter case, the returned integer
value is the return code of the program (overriding any value that
-may have been set by a call to `Ada.Command_Line.Set_Exit_Status`).
+may have been set by a call to ``Ada.Command_Line.Set_Exit_Status``).
*
"The mechanisms for building and running partitions. See
@@ -320,24 +320,24 @@ provided by the operating system. See the GLADE reference manual for
further details.
*
- "The information returned by `Exception_Message`. See
+ "The information returned by ``Exception_Message``. See
11.4.1(10)."
Exception message returns the null string unless a specific message has
been passed by the program.
*
- "The result of `Exceptions.Exception_Name` for types
- declared within an unnamed `block_statement`. See 11.4.1(12)."
+ "The result of ``Exceptions.Exception_Name`` for types
+ declared within an unnamed *block_statement*. See 11.4.1(12)."
-Blocks have implementation defined names of the form `B`nnn``
-where `nnn` is an integer.
+Blocks have implementation defined names of the form :samp:`B{nnn}`
+where *nnn* is an integer.
*
"The information returned by
- `Exception_Information`. See 11.4.1(13)."
+ ``Exception_Information``. See 11.4.1(13)."
-`Exception_Information` returns a string in the following format::
+``Exception_Information`` returns a string in the following format::
*Exception_Name:* nnnnn
*Message:* mmmmm
@@ -348,12 +348,12 @@ where `nnn` is an integer.
where
- * `nnnn` is the fully qualified name of the exception in all upper
+ * ``nnnn`` is the fully qualified name of the exception in all upper
case letters. This line is always present.
- * `mmmm` is the message (this line present only if message is non-null)
+ * ``mmmm`` is the message (this line present only if message is non-null)
- * `ppp` is the Process Id value as a decimal integer (this line is
+ * ``ppp`` is the Process Id value as a decimal integer (this line is
present only if the Process Id is nonzero). Currently we are
not making use of this field.
@@ -364,7 +364,7 @@ where
the main executable. The values are given in C style format, with lower case
letters for a-f, and only as many digits present as are necessary.
The line terminator sequence at the end of each line, including
- the last line is a single `LF` character (`16#0A#`).
+ the last line is a single ``LF`` character (``16#0A#``).
*
"Implementation-defined check names. See 11.5(27)."
@@ -373,7 +373,7 @@ The implementation defined check names include Alignment_Check,
Atomic_Synchronization, Duplicated_Tag_Check, Container_Checks,
Tampering_Check, Predicate_Check, and Validity_Check. In addition, a user
program can add implementation-defined check names by means of the pragma
-Check_Name. See the description of pragma `Suppress` for full details.
+Check_Name. See the description of pragma ``Suppress`` for full details.
*
"The interpretation of each aspect of representation. See
@@ -388,7 +388,7 @@ See separate section on data representations.
See separate section on data representations.
*
- "The meaning of `Size` for indefinite subtypes. See
+ "The meaning of ``Size`` for indefinite subtypes. See
13.3(48)."
Size for an indefinite subtype is the maximum possible size, except that
@@ -416,15 +416,15 @@ The only implementation defined component is the tag for a tagged type,
which contains a pointer to the dispatching table.
*
- "If `Word_Size` = `Storage_Unit`, the default bit
+ "If ``Word_Size`` = ``Storage_Unit``, the default bit
ordering. See 13.5.3(5)."
-`Word_Size` (32) is not the same as `Storage_Unit` (8) for this
+``Word_Size`` (32) is not the same as ``Storage_Unit`` (8) for this
implementation, so no non-default bit ordering is supported. The default
bit ordering corresponds to the natural endianness of the target architecture.
*
- "The contents of the visible part of package `System`
+ "The contents of the visible part of package ``System``
and its language-defined children. See 13.7(2)."
See the definition of these packages in files :file:`system.ads` and
@@ -438,8 +438,8 @@ System.
*
"The contents of the visible part of package
- `System.Machine_Code`, and the meaning of
- `code_statements`. See 13.8(7)."
+ ``System.Machine_Code``, and the meaning of
+ *code_statements*. See 13.8(7)."
See the definition and documentation in file :file:`s-maccod.ads`.
@@ -487,14 +487,14 @@ on the simple assignment of the invalid negative value from Y to Z.
*
"The manner of choosing a storage pool for an access type
- when `Storage_Pool` is not specified for the type. See 13.11(17)."
+ when ``Storage_Pool`` is not specified for the type. See 13.11(17)."
There are 3 different standard pools used by the compiler when
-`Storage_Pool` is not specified depending whether the type is local
+``Storage_Pool`` is not specified depending whether the type is local
to a subprogram or defined at the library level and whether
-`Storage_Size`is specified or not. See documentation in the runtime
-library units `System.Pool_Global`, `System.Pool_Size` and
-`System.Pool_Local` in files :file:`s-poosiz.ads`,
+``Storage_Size``is specified or not. See documentation in the runtime
+library units ``System.Pool_Global``, ``System.Pool_Size`` and
+``System.Pool_Local`` in files :file:`s-poosiz.ads`,
:file:`s-pooglo.ads` and :file:`s-pooloc.ads` for full details on the
default pools used.
@@ -503,13 +503,13 @@ default pools used.
names for the standard pool type(s). See 13.11(17)."
See documentation in the sources of the run time mentioned in the previous
-paragraph. All these pools are accessible by means of `with`'ing
+paragraph. All these pools are accessible by means of `with`\ ing
these units.
*
- "The meaning of `Storage_Size`. See 13.11(18)."
+ "The meaning of ``Storage_Size``. See 13.11(18)."
-`Storage_Size` is measured in storage units, and refers to the
+``Storage_Size`` is measured in storage units, and refers to the
total space available for an access type collection, or to the primary
stack space for a task.
@@ -523,21 +523,21 @@ for details on GNAT-defined aspects of storage pools.
*
"The set of restrictions allowed in a pragma
- `Restrictions`. See 13.12(7)."
+ ``Restrictions``. See 13.12(7)."
See :ref:`Standard_and_Implementation_Defined_Restrictions`.
*
"The consequences of violating limitations on
- `Restrictions` pragmas. See 13.12(9)."
+ ``Restrictions`` pragmas. See 13.12(9)."
Restrictions that can be checked at compile time result in illegalities
if violated. Currently there are no other consequences of violating
restrictions.
*
- "The representation used by the `Read` and
- `Write` attributes of elementary types in terms of stream
+ "The representation used by the ``Read`` and
+ ``Write`` attributes of elementary types in terms of stream
elements. See 13.13.2(9)."
The representation is the in-memory representation of the base type of
@@ -546,15 +546,15 @@ the type, using the number of bits corresponding to the
*
"The names and characteristics of the numeric subtypes
- declared in the visible part of package `Standard`. See A.1(3)."
+ declared in the visible part of package ``Standard``. See A.1(3)."
See items describing the integer and floating-point types supported.
*
- "The string returned by `Character_Set_Version`.
+ "The string returned by ``Character_Set_Version``.
See A.3.5(3)."
-`Ada.Wide_Characters.Handling.Character_Set_Version` returns
+``Ada.Wide_Characters.Handling.Character_Set_Version`` returns
the string "Unicode 4.0", referring to version 4.0 of the
Unicode specification.
@@ -567,21 +567,21 @@ library. Only fast math mode is implemented.
*
"The sign of a zero result from some of the operators or
- functions in `Numerics.Generic_Elementary_Functions`, when
- `Float_Type'Signed_Zeros` is `True`. See A.5.1(46)."
+ functions in ``Numerics.Generic_Elementary_Functions``, when
+ ``Float_Type'Signed_Zeros`` is ``True``. See A.5.1(46)."
The sign of zeroes follows the requirements of the IEEE 754 standard on
floating-point.
*
"The value of
- `Numerics.Float_Random.Max_Image_Width`. See A.5.2(27)."
+ ``Numerics.Float_Random.Max_Image_Width``. See A.5.2(27)."
Maximum image width is 6864, see library file :file:`s-rannum.ads`.
*
"The value of
- `Numerics.Discrete_Random.Max_Image_Width`. See A.5.2(27)."
+ ``Numerics.Discrete_Random.Max_Image_Width``. See A.5.2(27)."
Maximum image width is 6864, see library file :file:`s-rannum.ads`.
@@ -610,13 +610,13 @@ The minimum period between reset calls to guarantee distinct series of
random numbers is one microsecond.
*
- "The values of the `Model_Mantissa`,
- `Model_Emin`, `Model_Epsilon`, `Model`,
- `Safe_First`, and `Safe_Last` attributes, if the Numerics
+ "The values of the ``Model_Mantissa``,
+ ``Model_Emin``, ``Model_Epsilon``, ``Model``,
+ ``Safe_First``, and ``Safe_Last`` attributes, if the Numerics
Annex is not supported. See A.5.3(72)."
Run the compiler with *-gnatS* to produce a listing of package
-`Standard`, has the values of all numeric attributes.
+``Standard``, has the values of all numeric attributes.
*
"Any implementation-defined characteristics of the
@@ -626,10 +626,10 @@ There are no special implementation defined characteristics for these
packages.
*
- "The value of `Buffer_Size` in `Storage_IO`. See
+ "The value of ``Buffer_Size`` in ``Storage_IO``. See
A.9(10)."
-All type representations are contiguous, and the `Buffer_Size` is
+All type representations are contiguous, and the ``Buffer_Size`` is
the value of ``type'Size`` rounded up to the next storage unit
boundary.
@@ -641,7 +641,7 @@ These files are mapped onto the files provided by the C streams
libraries. See source file :file:`i-cstrea.ads` for further details.
*
- "The accuracy of the value produced by `Put`. See
+ "The accuracy of the value produced by ``Put``. See
A.10.9(36)."
If more digits are requested in the output than are represented by the
@@ -649,30 +649,30 @@ precision of the value, zeroes are output in the corresponding least
significant digit positions.
*
- "The meaning of `Argument_Count`, `Argument`, and
- `Command_Name`. See A.15(1)."
+ "The meaning of ``Argument_Count``, ``Argument``, and
+ ``Command_Name``. See A.15(1)."
-These are mapped onto the `argv` and `argc` parameters of the
+These are mapped onto the ``argv`` and ``argc`` parameters of the
main program in the natural manner.
*
- "The interpretation of the `Form` parameter in procedure
- `Create_Directory`. See A.16(56)."
+ "The interpretation of the ``Form`` parameter in procedure
+ ``Create_Directory``. See A.16(56)."
-The `Form` parameter is not used.
+The ``Form`` parameter is not used.
*
- "The interpretation of the `Form` parameter in procedure
- `Create_Path`. See A.16(60)."
+ "The interpretation of the ``Form`` parameter in procedure
+ ``Create_Path``. See A.16(60)."
-The `Form` parameter is not used.
+The ``Form`` parameter is not used.
*
- "The interpretation of the `Form` parameter in procedure
- `Copy_File`. See A.16(68)."
+ "The interpretation of the ``Form`` parameter in procedure
+ ``Copy_File``. See A.16(68)."
-The `Form` parameter is case-insensitive.
-Two fields are recognized in the `Form` parameter::
+The ``Form`` parameter is case-insensitive.
+Two fields are recognized in the ``Form`` parameter::
*preserve=<value>*
*mode=<value>*
@@ -721,13 +721,13 @@ Examples of incorrect Forms::
Form => "mode=internal, preserve=timestamps"
*
- "The interpretation of the `Pattern` parameter, when not the null string,
- in the `Start_Search` and `Search` procedures.
+ "The interpretation of the ``Pattern`` parameter, when not the null string,
+ in the ``Start_Search`` and ``Search`` procedures.
See A.16(104) and A.16(112)."
-When the `Pattern` parameter is not the null string, it is interpreted
+When the ``Pattern`` parameter is not the null string, it is interpreted
according to the syntax of regular expressions as defined in the
-`GNAT.Regexp` package.
+``GNAT.Regexp`` package.
See :ref:`GNAT.Regexp_(g-regexp.ads)`.
@@ -757,7 +757,7 @@ Convention Name Interpretation
*Default* Treated the same as C
*External* Treated the same as C
*Fortran* Fortran
-*Intrinsic* For support of pragma `Import` with convention Intrinsic, see
+*Intrinsic* For support of pragma ``Import`` with convention Intrinsic, see
separate section on Intrinsic Subprograms.
*Stdcall* Stdcall (used for Windows implementations only). This convention correspond
to the WINAPI (previously called Pascal convention) C/C++ convention under
@@ -767,8 +767,8 @@ Convention Name Interpretation
*Win32* Synonym for Stdcall
*Stubbed* Stubbed is a special convention used to indicate that the body of the
subprogram will be entirely ignored. Any call to the subprogram
- is converted into a raise of the `Program_Error` exception. If a
- pragma `Import` specifies convention `stubbed` then no body need
+ is converted into a raise of the ``Program_Error`` exception. If a
+ pragma ``Import`` specifies convention ``stubbed`` then no body need
be present at all. This convention is useful during development for the
inclusion of subprograms whose body has not yet been written.
In addition, all otherwise unrecognized convention names are also
@@ -792,9 +792,9 @@ external language, interpreting the Ada name as being in all lower case
letters.
*
- "The effect of pragma `Linker_Options`. See B.1(37)."
+ "The effect of pragma ``Linker_Options``. See B.1(37)."
-The string passed to `Linker_Options` is presented uninterpreted as
+The string passed to ``Linker_Options`` is presented uninterpreted as
an argument to the link command, unless it contains ASCII.NUL characters.
NUL characters if they appear act as argument separators, so for example
@@ -802,7 +802,7 @@ NUL characters if they appear act as argument separators, so for example
pragma Linker_Options ("-labc" & ASCII.NUL & "-ldef");
-causes two separate arguments `-labc` and `-ldef` to be passed to the
+causes two separate arguments ``-labc`` and ``-ldef`` to be passed to the
linker. The order of linker options is preserved for a given unit. The final
list of options passed to the linker is in reverse order of the elaboration
order. For example, linker options for a body always appear before the options
@@ -810,23 +810,23 @@ from the corresponding package spec.
*
"The contents of the visible part of package
- `Interfaces` and its language-defined descendants. See B.2(1)."
+ ``Interfaces`` and its language-defined descendants. See B.2(1)."
See files with prefix :file:`i-` in the distributed library.
*
"Implementation-defined children of package
- `Interfaces`. The contents of the visible part of package
- `Interfaces`. See B.2(11)."
+ ``Interfaces``. The contents of the visible part of package
+ ``Interfaces``. See B.2(11)."
See files with prefix :file:`i-` in the distributed library.
*
- "The types `Floating`, `Long_Floating`,
- `Binary`, `Long_Binary`, `Decimal_ Element`, and
- `COBOL_Character`; and the initialization of the variables
- `Ada_To_COBOL` and `COBOL_To_Ada`, in
- `Interfaces.COBOL`. See B.4(50)."
+ "The types ``Floating``, ``Long_Floating``,
+ ``Binary``, ``Long_Binary``, ``Decimal_ Element``, and
+ ``COBOL_Character``; and the initialization of the variables
+ ``Ada_To_COBOL`` and ``COBOL_To_Ada``, in
+ ``Interfaces.COBOL``. See B.4(50)."
===================== ====================================
COBOL Ada
@@ -857,7 +857,7 @@ See documentation in file :file:`s-maccod.ads` in the distributed library.
Interrupts are mapped to signals or conditions as appropriate. See
definition of unit
-`Ada.Interrupt_Names` in source file :file:`a-intnam.ads` for details
+``Ada.Interrupt_Names`` in source file :file:`a-intnam.ads` for details
on the interrupts supported on a particular target.
*
@@ -868,25 +868,25 @@ GNAT does not permit a partition to be restarted without reloading,
except under control of the debugger.
*
- "The semantics of pragma `Discard_Names`. See C.5(7)."
+ "The semantics of pragma ``Discard_Names``. See C.5(7)."
-Pragma `Discard_Names` causes names of enumeration literals to
+Pragma ``Discard_Names`` causes names of enumeration literals to
be suppressed. In the presence of this pragma, the Image attribute
provides the image of the Pos of the literal, and Value accepts
Pos values.
*
- "The result of the `Task_Identification.Image`
+ "The result of the ``Task_Identification.Image``
attribute. See C.7.1(7)."
The result of this attribute is a string that identifies
-the object or component that denotes a given task. If a variable `Var`
-has a task type, the image for this task will have the form `Var_`XXXXXXXX``,
-where the suffix
+the object or component that denotes a given task. If a variable ``Var``
+has a task type, the image for this task will have the form :samp:`Var_{XXXXXXXX}`,
+where the suffix *XXXXXXXX*
is the hexadecimal representation of the virtual address of the corresponding
task control block. If the variable is an array of tasks, the image of each
task will have the form of an indexed component indicating the position of a
-given task in the array, e.g., `Group(5)_`XXXXXXX``. If the task is a
+given task in the array, e.g., :samp:`Group(5)_{XXXXXXX}`. If the task is a
component of a record, the image of the task will have the form of a selected
component. These rules are fully recursive, so that the image of a task that
is a subcomponent of a composite object corresponds to the expression that
@@ -904,28 +904,30 @@ the numeric suffix, that is to say the hexadecimal representation of the
virtual address of the control block of the task.
*
- "The value of `Current_Task` when in a protected entry
+ "The value of ``Current_Task`` when in a protected entry
or interrupt handler. See C.7.1(17)."
Protected entries or interrupt handlers can be executed by any
-convenient thread, so the value of `Current_Task` is undefined.
+convenient thread, so the value of ``Current_Task`` is undefined.
*
- "The effect of calling `Current_Task` from an entry
+ "The effect of calling ``Current_Task`` from an entry
body or interrupt handler. See C.7.1(19)."
-The effect of calling `Current_Task` from an entry body or
-interrupt handler is to return the identification of the task currently
-executing the code.
+When GNAT can determine statically that ``Current_Task`` is called directly in
+the body of an entry (or barrier) then a warning is emitted and ``Program_Error``
+is raised at run time. Otherwise, the effect of calling ``Current_Task`` from an
+entry body or interrupt handler is to return the identification of the task
+currently executing the code.
*
"Implementation-defined aspects of
- `Task_Attributes`. See C.7.2(19)."
+ ``Task_Attributes``. See C.7.2(19)."
-There are no implementation-defined aspects of `Task_Attributes`.
+There are no implementation-defined aspects of ``Task_Attributes``.
*
- "Values of all `Metrics`. See D(2)."
+ "Values of all ``Metrics``. See D(2)."
The metrics information for GNAT depends on the performance of the
underlying operating system. The sources of the run-time for tasking
@@ -937,8 +939,8 @@ on the exact target in use, this information can be used to determine
the required metrics.
*
- "The declarations of `Any_Priority` and
- `Priority`. See D.1(11)."
+ "The declarations of ``Any_Priority`` and
+ ``Priority``. See D.1(11)."
See declarations in file :file:`system.ads`.
@@ -963,8 +965,8 @@ and appropriate, these threads correspond to native threads of the
underlying operating system.
*
- "Implementation-defined `policy_identifiers` allowed
- in a pragma `Task_Dispatching_Policy`. See D.2.2(3)."
+ "Implementation-defined *policy_identifiers* allowed
+ in a pragma ``Task_Dispatching_Policy``. See D.2.2(3)."
There are no implementation-defined policy-identifiers allowed in this
pragma.
@@ -982,16 +984,16 @@ of delay expirations for lower priority tasks.
The policy is the same as that of the underlying threads implementation.
*
- "Implementation-defined `policy_identifiers` allowed
- in a pragma `Locking_Policy`. See D.3(4)."
+ "Implementation-defined *policy_identifiers* allowed
+ in a pragma ``Locking_Policy``. See D.3(4)."
The two implementation defined policies permitted in GNAT are
-`Inheritance_Locking` and `Concurrent_Readers_Locking`. On
-targets that support the `Inheritance_Locking` policy, locking is
+``Inheritance_Locking`` and ``Concurrent_Readers_Locking``. On
+targets that support the ``Inheritance_Locking`` policy, locking is
implemented by inheritance, i.e., the task owning the lock operates
at a priority equal to the highest priority of any task currently
requesting the lock. On targets that support the
-`Concurrent_Readers_Locking` policy, locking is implemented with a
+``Concurrent_Readers_Locking`` policy, locking is implemented with a
read/write lock allowing multiple protected object functions to enter
concurrently.
@@ -999,7 +1001,7 @@ concurrently.
"Default ceiling priorities. See D.3(10)."
The ceiling priority of protected objects of the type
-`System.Interrupt_Priority'Last` as described in the Ada
+``System.Interrupt_Priority'Last`` as described in the Ada
Reference Manual D.3(10),
*
@@ -1007,7 +1009,7 @@ Reference Manual D.3(10),
the implementation. See D.3(16)."
The ceiling priority of internal protected objects is
-`System.Priority'Last`.
+``System.Priority'Last``.
*
"Implementation-defined queuing policies. See D.4(1)."
@@ -1031,25 +1033,25 @@ task creation.
*
"What happens when a task terminates in the presence of
- pragma `No_Task_Termination`. See D.7(15)."
+ pragma ``No_Task_Termination``. See D.7(15)."
Execution is erroneous in that case.
*
"Implementation-defined aspects of pragma
- `Restrictions`. See D.7(20)."
+ ``Restrictions``. See D.7(20)."
There are no such implementation-defined aspects.
*
"Implementation-defined aspects of package
- `Real_Time`. See D.8(17)."
+ ``Real_Time``. See D.8(17)."
-There are no implementation defined aspects of package `Real_Time`.
+There are no implementation defined aspects of package ``Real_Time``.
*
"Implementation-defined aspects of
- `delay_statements`. See D.9(8)."
+ *delay_statements*. See D.9(8)."
Any difference greater than one microsecond will cause the task to be
delayed (see D.9(7)).
@@ -1114,7 +1116,7 @@ implementation defined interfaces.
*
"The values of named numbers in the package
- `Decimal`. See F.2(7)."
+ ``Decimal``. See F.2(7)."
==================== ==========
Named Number Value
@@ -1127,14 +1129,14 @@ Named Number Value
==================== ==========
*
- "The value of `Max_Picture_Length` in the package
- `Text_IO.Editing`. See F.3.3(16)."
+ "The value of ``Max_Picture_Length`` in the package
+ ``Text_IO.Editing``. See F.3.3(16)."
64
*
- "The value of `Max_Picture_Length` in the package
- `Wide_Text_IO.Editing`. See F.3.4(5)."
+ "The value of ``Max_Picture_Length`` in the package
+ ``Wide_Text_IO.Editing``. See F.3.4(5)."
64
@@ -1147,8 +1149,8 @@ operations. Only fast math mode is currently supported.
*
"The sign of a zero result (or a component thereof) from
- any operator or function in `Numerics.Generic_Complex_Types`, when
- `Real'Signed_Zeros` is True. See G.1.1(53)."
+ any operator or function in ``Numerics.Generic_Complex_Types``, when
+ ``Real'Signed_Zeros`` is True. See G.1.1(53)."
The signs of zero values are as recommended by the relevant
implementation advice.
@@ -1156,8 +1158,8 @@ implementation advice.
*
"The sign of a zero result (or a component thereof) from
any operator or function in
- `Numerics.Generic_Complex_Elementary_Functions`, when
- `Real'Signed_Zeros` is `True`. See G.1.2(45)."
+ ``Numerics.Generic_Complex_Elementary_Functions``, when
+ ``Real'Signed_Zeros`` is ``True``. See G.1.2(45)."
The signs of zero values are as recommended by the relevant
implementation advice.
@@ -1179,8 +1181,8 @@ floating-point format.
*
"The result of a floating point arithmetic operation in
- overflow situations, when the `Machine_Overflows` attribute of the
- result type is `False`. See G.2.1(13)."
+ overflow situations, when the ``Machine_Overflows`` attribute of the
+ result type is ``False``. See G.2.1(13)."
Infinite and NaN values are produced as dictated by the IEEE
floating-point standard.
@@ -1208,7 +1210,7 @@ floating-point, the operation is done in floating-point, and the result
is converted to the target type.
*
- "Conditions on a `universal_real` operand of a fixed
+ "Conditions on a *universal_real* operand of a fixed
point multiplication or division for which the result shall be in the
perfect result set. See G.2.3(22)."
@@ -1218,16 +1220,16 @@ representable in 64-bits.
*
"The result of a fixed point arithmetic operation in
- overflow situations, when the `Machine_Overflows` attribute of the
- result type is `False`. See G.2.3(27)."
+ overflow situations, when the ``Machine_Overflows`` attribute of the
+ result type is ``False``. See G.2.3(27)."
-Not relevant, `Machine_Overflows` is `True` for fixed-point
+Not relevant, ``Machine_Overflows`` is ``True`` for fixed-point
types.
*
"The result of an elementary function reference in
- overflow situations, when the `Machine_Overflows` attribute of the
- result type is `False`. See G.2.4(4)."
+ overflow situations, when the ``Machine_Overflows`` attribute of the
+ result type is ``False``. See G.2.4(4)."
IEEE infinite and Nan values are produced as appropriate.
@@ -1248,8 +1250,8 @@ Information on this subject is not yet available.
*
"The result of a complex arithmetic operation or complex
elementary function reference in overflow situations, when the
- `Machine_Overflows` attribute of the corresponding real type is
- `False`. See G.2.6(5)."
+ ``Machine_Overflows`` attribute of the corresponding real type is
+ ``False``. See G.2.6(5)."
IEEE infinite and Nan values are produced as appropriate.
@@ -1268,21 +1270,21 @@ Information on this subject is not yet available.
*
"Implementation-defined aspects of pragma
- `Inspection_Point`. See H.3.2(8)."
+ ``Inspection_Point``. See H.3.2(8)."
-Pragma `Inspection_Point` ensures that the variable is live and can
+Pragma ``Inspection_Point`` ensures that the variable is live and can
be examined by the debugger at the inspection point.
*
"Implementation-defined aspects of pragma
- `Restrictions`. See H.4(25)."
+ ``Restrictions``. See H.4(25)."
-There are no implementation-defined aspects of pragma `Restrictions`. The
-use of pragma `Restrictions [No_Exceptions]` has no effect on the
-generated code. Checks must suppressed by use of pragma `Suppress`.
+There are no implementation-defined aspects of pragma ``Restrictions``. The
+use of pragma ``Restrictions [No_Exceptions]`` has no effect on the
+generated code. Checks must suppressed by use of pragma ``Suppress``.
*
- "Any restrictions on pragma `Restrictions`. See
+ "Any restrictions on pragma ``Restrictions``. See
H.4(27)."
-There are no restrictions on pragma `Restrictions`.
+There are no restrictions on pragma ``Restrictions``.
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
index e5f0c82..3053013 100644
--- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. _Implementation_Defined_Pragmas:
******************************
@@ -32,7 +34,7 @@ Syntax:
This pragma must appear at the start of the statement sequence of a
-handled sequence of statements (right after the `begin`). It has
+handled sequence of statements (right after the ``begin``). It has
the effect of deferring aborts for the sequence of statements (but not
for the declarations or handlers, if any, associated with this statement
sequence).
@@ -84,7 +86,7 @@ Syntax:
ABSTRACT_STATE ::= name
-For the semantics of this pragma, see the entry for aspect `Abstract_State` in
+For the semantics of this pragma, see the entry for aspect ``Abstract_State`` in
the SPARK 2014 Reference Manual, section 7.1.4.
Pragma Ada_83
@@ -104,7 +106,7 @@ the syntax and semantics of Ada 83, as defined in the original Ada
83 Reference Manual as possible. In particular, the keywords added by Ada 95
and Ada 2005 are not recognized, optional package bodies are allowed,
and generics may name types with unknown discriminants without using
-the `(<>)` notation. In addition, some but not all of the additional
+the ``(<>)`` notation. In addition, some but not all of the additional
restrictions of Ada 83 are enforced.
Ada 83 mode is intended for two purposes. Firstly, it allows existing
@@ -127,7 +129,7 @@ Syntax:
A configuration pragma that establishes Ada 95 mode for the unit to which
it applies, regardless of the mode set by the command line switches.
-This mode is set automatically for the `Ada` and `System`
+This mode is set automatically for the ``Ada`` and ``System``
packages and their children, so you need not specify it in these
contexts. This pragma is useful when writing a reusable component that
itself uses Ada 95 features, but which is intended to be usable from
@@ -187,7 +189,7 @@ Syntax:
A configuration pragma that establishes Ada 2012 mode for the unit to which
it applies, regardless of the mode set by the command line switches.
-This mode is set automatically for the `Ada` and `System`
+This mode is set automatically for the ``Ada`` and ``System``
packages and their children, so you need not specify it in these
contexts. This pragma is useful when writing a reusable component that
itself uses Ada 2012 features, but which is intended to be usable from
@@ -227,15 +229,15 @@ Syntax:
pragma Allow_Integer_Address;
-In almost all versions of GNAT, `System.Address` is a private
+In almost all versions of GNAT, ``System.Address`` is a private
type in accordance with the implementation advice in the RM. This
means that integer values,
in particular integer literals, are not allowed as address values.
If the configuration pragma
-`Allow_Integer_Address` is given, then integer expressions may
-be used anywhere a value of type `System.Address` is required.
+``Allow_Integer_Address`` is given, then integer expressions may
+be used anywhere a value of type ``System.Address`` is required.
The effect is to introduce an implicit unchecked conversion from the
-integer value to type `System.Address`. The reverse case of using
+integer value to type ``System.Address``. The reverse case of using
an address where an integer type is required is handled analogously.
The following example compiles without errors:
@@ -261,8 +263,8 @@ The following example compiles without errors:
end AddrAsInt;
-Note that pragma `Allow_Integer_Address` is ignored if `System.Address`
-is not a private type. In implementations of `GNAT` where
+Note that pragma ``Allow_Integer_Address`` is ignored if ``System.Address``
+is not a private type. In implementations of ``GNAT`` where
System.Address is a visible integer type,
this pragma serves no purpose but is ignored
rather than rejected to allow common sets of sources to be used
@@ -280,18 +282,18 @@ Syntax::
ARG ::= NAME | EXPRESSION
-This pragma is used to annotate programs. `identifier` identifies
+This pragma is used to annotate programs. IDENTIFIER identifies
the type of annotation. GNAT verifies that it is an identifier, but does
not otherwise analyze it. The second optional identifier is also left
unanalyzed, and by convention is used to control the action of the tool to
-which the annotation is addressed. The remaining `arg` arguments
+which the annotation is addressed. The remaining ARG arguments
can be either string literals or more generally expressions.
String literals are assumed to be either of type
-`Standard.String` or else `Wide_String` or `Wide_Wide_String`
+``Standard.String`` or else ``Wide_String`` or ``Wide_Wide_String``
depending on the character literals they contain.
All other kinds of arguments are analyzed as expressions, and must be
unambiguous. The last argument if present must have the identifier
-`Entity` and GNAT verifies that a local name is given.
+``Entity`` and GNAT verifies that a local name is given.
The analyzed pragma is retained in the tree, but not otherwise processed
by any part of the GNAT compiler, except to generate corresponding note
@@ -327,18 +329,18 @@ equivalent to the following:
The string argument, if given, is the message that will be associated
with the exception occurrence if the exception is raised. If no second
-argument is given, the default message is `file`:`nnn`,
-where `file` is the name of the source file containing the assert,
-and `nnn` is the line number of the assert.
+argument is given, the default message is ``file``:``nnn``,
+where ``file`` is the name of the source file containing the assert,
+and ``nnn`` is the line number of the assert.
-Note that, as with the `if` statement to which it is equivalent, the
-type of the expression is either `Standard.Boolean`, or any type derived
+Note that, as with the ``if`` statement to which it is equivalent, the
+type of the expression is either ``Standard.Boolean``, or any type derived
from this standard type.
Assert checks can be either checked or ignored. By default they are ignored.
They will be checked if either the command line switch *-gnata* is
-used, or if an `Assertion_Policy` or `Check_Policy` pragma is used
-to enable `Assert_Checks`.
+used, or if an ``Assertion_Policy`` or ``Check_Policy`` pragma is used
+to enable ``Assert_Checks``.
If assertions are ignored, then there
is no run-time effect (and in particular, any side effects from the
@@ -347,8 +349,8 @@ analyzed at compile time, and may cause types to be frozen if they are
mentioned here for the first time).
If assertions are checked, then the given expression is tested, and if
-it is `False` then `System.Assertions.Raise_Assert_Failure` is called
-which results in the raising of `Assert_Failure` with the given message.
+it is ``False`` then ``System.Assertions.Raise_Assert_Failure`` is called
+which results in the raising of ``Assert_Failure`` with the given message.
You should generally avoid side effects in the expression arguments of
this pragma, because these side effects will turn on and off with the
@@ -357,8 +359,8 @@ effect on the program. However, the expressions are analyzed for
semantic correctness whether or not assertions are enabled, so turning
assertions on and off cannot affect the legality of a program.
-Note that the implementation defined policy `DISABLE`, given in a
-pragma `Assertion_Policy`, can be used to suppress this semantic analysis.
+Note that the implementation defined policy ``DISABLE``, given in a
+pragma ``Assertion_Policy``, can be used to suppress this semantic analysis.
Note: this is a standard language-defined pragma in versions
of Ada from 2005 on. In GNAT, it is implemented in all versions
@@ -375,9 +377,9 @@ Syntax::
[, string_EXPRESSION]);
-The effect of this pragma is identical to that of pragma `Assert`,
-except that in an `Assertion_Policy` pragma, the identifier
-`Assert_And_Cut` is used to control whether it is ignored or checked
+The effect of this pragma is identical to that of pragma ``Assert``,
+except that in an ``Assertion_Policy`` pragma, the identifier
+``Assert_And_Cut`` is used to control whether it is ignored or checked
(or disabled).
The intention is that this be used within a subprogram when the
@@ -432,42 +434,42 @@ Syntax::
This is a standard Ada 2012 pragma that is available as an
implementation-defined pragma in earlier versions of Ada.
-The assertion kinds `RM_ASSERTION_KIND` are those defined in
-the Ada standard. The assertion kinds `ID_ASSERTION_KIND`
+The assertion kinds ``RM_ASSERTION_KIND`` are those defined in
+the Ada standard. The assertion kinds ``ID_ASSERTION_KIND``
are implementation defined additions recognized by the GNAT compiler.
The pragma applies in both cases to pragmas and aspects with matching
-names, e.g. `Pre` applies to the Pre aspect, and `Precondition`
-applies to both the `Precondition` pragma
-and the aspect `Precondition`. Note that the identifiers for
+names, e.g. ``Pre`` applies to the Pre aspect, and ``Precondition``
+applies to both the ``Precondition`` pragma
+and the aspect ``Precondition``. Note that the identifiers for
pragmas Pre_Class and Post_Class are Pre'Class and Post'Class (not
Pre_Class and Post_Class), since these pragmas are intended to be
identical to the corresponding aspects).
-If the policy is `CHECK`, then assertions are enabled, i.e.
+If the policy is ``CHECK``, then assertions are enabled, i.e.
the corresponding pragma or aspect is activated.
-If the policy is `IGNORE`, then assertions are ignored, i.e.
+If the policy is ``IGNORE``, then assertions are ignored, i.e.
the corresponding pragma or aspect is deactivated.
This pragma overrides the effect of the *-gnata* switch on the
command line.
-If the policy is `SUPPRESSIBLE`, then assertions are enabled by default,
+If the policy is ``SUPPRESSIBLE``, then assertions are enabled by default,
however, if the *-gnatp* switch is specified all assertions are ignored.
-The implementation defined policy `DISABLE` is like
-`IGNORE` except that it completely disables semantic
+The implementation defined policy ``DISABLE`` is like
+``IGNORE`` except that it completely disables semantic
checking of the corresponding pragma or aspect. This is
useful when the pragma or aspect argument references subprograms
in a with'ed package which is replaced by a dummy package
for the final build.
-The implementation defined assertion kind `Assertions` applies to all
+The implementation defined assertion kind ``Assertions`` applies to all
assertion kinds. The form with no assertion kind given implies this
choice, so it applies to all assertion kinds (RM defined, and
implementation defined).
-The implementation defined assertion kind `Statement_Assertions`
-applies to `Assert`, `Assert_And_Cut`,
-`Assume`, `Loop_Invariant`, and `Loop_Variant`.
+The implementation defined assertion kind ``Statement_Assertions``
+applies to ``Assert``, ``Assert_And_Cut``,
+``Assume``, ``Loop_Invariant``, and ``Loop_Variant``.
Pragma Assume
=============
@@ -481,9 +483,9 @@ Syntax:
[, string_EXPRESSION]);
-The effect of this pragma is identical to that of pragma `Assert`,
-except that in an `Assertion_Policy` pragma, the identifier
-`Assume` is used to control whether it is ignored or checked
+The effect of this pragma is identical to that of pragma ``Assert``,
+except that in an ``Assertion_Policy`` pragma, the identifier
+``Assume`` is used to control whether it is ignored or checked
(or disabled).
The intention is that this be used for assumptions about the
@@ -491,7 +493,7 @@ external environment. So you cannot expect to verify formally
or informally that the condition is met, this must be
established by examining things outside the program itself.
For example, we may have code that depends on the size of
-`Long_Long_Integer` being at least 64. So we could write:
+``Long_Long_Integer`` being at least 64. So we could write:
.. code-block:: ada
@@ -537,12 +539,12 @@ prove they are valid. Consider the following example:
if V1 and V2 have valid values, then the loop is known at compile
time not to execute since the lower bound must be greater than the
upper bound. However in default mode, no such assumption is made,
-and the loop may execute. If `Assume_No_Invalid_Values (On)`
+and the loop may execute. If ``Assume_No_Invalid_Values (On)``
is given, the compiler will assume that any occurrence of a variable
-other than in an explicit `'Valid` test always has a valid
+other than in an explicit ``'Valid`` test always has a valid
value, and the loop above will be optimized away.
-The use of `Assume_No_Invalid_Values (On)` is appropriate if
+The use of ``Assume_No_Invalid_Values (On)`` is appropriate if
you know your code is free of uninitialized variables and other
possible sources of invalid representations, and may result in
more efficient code. A program that accesses an invalid representation
@@ -566,7 +568,7 @@ Syntax:
pragma Asynch_Readers [ (boolean_EXPRESSION) ];
-For the semantics of this pragma, see the entry for aspect `Async_Readers` in
+For the semantics of this pragma, see the entry for aspect ``Async_Readers`` in
the SPARK 2014 Reference Manual, section 7.1.2.
.. _Pragma-Async_Writers:
@@ -580,7 +582,7 @@ Syntax:
pragma Asynch_Writers [ (boolean_EXPRESSION) ];
-For the semantics of this pragma, see the entry for aspect `Async_Writers` in
+For the semantics of this pragma, see the entry for aspect ``Async_Writers`` in
the SPARK 2014 Reference Manual, section 7.1.2.
Pragma Attribute_Definition
@@ -596,7 +598,7 @@ Syntax:
[Expression =>] EXPRESSION | NAME);
-If `Attribute` is a known attribute name, this pragma is equivalent to
+If ``Attribute`` is a known attribute name, this pragma is equivalent to
the attribute definition clause:
@@ -605,7 +607,7 @@ the attribute definition clause:
for Entity'Attribute use Expression;
-If `Attribute` is not a recognized attribute name, the pragma is
+If ``Attribute`` is not a recognized attribute name, the pragma is
ignored, and a warning is emitted. This allows source
code to be written that takes advantage of some new attribute, while remaining
compilable with earlier compilers.
@@ -625,15 +627,15 @@ Syntax:
Normally the default mechanism for passing C convention records to C
convention subprograms is to pass them by reference, as suggested by RM
-B.3(69). Use the configuration pragma `C_Pass_By_Copy` to change
+B.3(69). Use the configuration pragma ``C_Pass_By_Copy`` to change
this default, by requiring that record formal parameters be passed by
copy if all of the following conditions are met:
*
The size of the record type does not exceed the value specified for
- `Max_Size`.
+ ``Max_Size``.
*
- The record type has `Convention C`.
+ The record type has ``Convention C``.
*
The formal parameter has this record type, and the subprogram has a
foreign (non-Ada) convention.
@@ -643,8 +645,8 @@ manner consistent with what C expects if the corresponding formal in the
C prototype is a struct (rather than a pointer to a struct).
You can also pass records by copy by specifying the convention
-`C_Pass_By_Copy` for the record type, or by using the extended
-`Import` and `Export` pragmas, which allow specification of
+``C_Pass_By_Copy`` for the record type, or by using the extended
+``Import`` and ``Export`` pragmas, which allow specification of
passing mechanisms on a parameter by parameter basis.
Pragma Check
@@ -670,19 +672,19 @@ Syntax:
Invariant'Class
-This pragma is similar to the predefined pragma `Assert` except that an
+This pragma is similar to the predefined pragma ``Assert`` except that an
extra identifier argument is present. In conjunction with pragma
-`Check_Policy`, this can be used to define groups of assertions that can
-be independently controlled. The identifier `Assertion` is special, it
-refers to the normal set of pragma `Assert` statements.
+``Check_Policy``, this can be used to define groups of assertions that can
+be independently controlled. The identifier ``Assertion`` is special, it
+refers to the normal set of pragma ``Assert`` statements.
Checks introduced by this pragma are normally deactivated by default. They can
be activated either by the command line option *-gnata*, which turns on
-all checks, or individually controlled using pragma `Check_Policy`.
+all checks, or individually controlled using pragma ``Check_Policy``.
-The identifiers `Assertions` and `Statement_Assertions` are not
+The identifiers ``Assertions`` and ``Statement_Assertions`` are not
permitted as check kinds, since this would cause confusion with the use
-of these identifiers in `Assertion_Policy` and `Check_Policy`
+of these identifiers in ``Assertion_Policy`` and ``Check_Policy``
pragmas, where they are used to refer to sets of assertions.
Pragma Check_Float_Overflow
@@ -697,8 +699,8 @@ Syntax:
pragma Check_Float_Overflow;
-In Ada, the predefined floating-point types (`Short_Float`,
-`Float`, `Long_Float`, `Long_Long_Float`) are
+In Ada, the predefined floating-point types (``Short_Float``,
+``Float``, ``Long_Float``, ``Long_Long_Float``) are
defined to be *unconstrained*. This means that even though each
has a well-defined base range, an operation that delivers a result
outside this base range is not required to raise an exception.
@@ -721,22 +723,22 @@ can have the same base range as its base type. For example:
subtype My_Float is Float range Float'Range;
-Here `My_Float` has the same range as
-`Float` but is constrained, so operations on
-`My_Float` values will be checked for overflow
+Here ``My_Float`` has the same range as
+``Float`` but is constrained, so operations on
+``My_Float`` values will be checked for overflow
against this range.
This style will achieve the desired goal, but
it is often more convenient to be able to simply use
the standard predefined floating-point types as long
as overflow checking could be guaranteed.
-The `Check_Float_Overflow`
+The ``Check_Float_Overflow``
configuration pragma achieves this effect. If a unit is compiled
subject to this configuration pragma, then all operations
on predefined floating-point types including operations on
base types of these floating-point types will be treated as
though those types were constrained, and overflow checks
-will be generated. The `Constraint_Error`
+will be generated. The ``Constraint_Error``
exception is raised if the result is out of range.
This mode can also be set by use of the compiler
@@ -764,14 +766,14 @@ are present in a partition mentioning the same name, only one new
check name is introduced.
An implementation defined check name introduced with this pragma may
-be used in only three contexts: `pragma Suppress`,
-`pragma Unsuppress`,
-and as the prefix of a `Check_Name'Enabled` attribute reference. For
+be used in only three contexts: ``pragma Suppress``,
+``pragma Unsuppress``,
+and as the prefix of a ``Check_Name'Enabled`` attribute reference. For
any of these three cases, the check name must be visible. A check
name is visible if it is in the configuration pragmas applying to
the current unit, or if it appears at the start of any unit that
is part of the dependency set of the current unit (e.g., units that
-are mentioned in `with` clauses).
+are mentioned in ``with`` clauses).
Check names introduced by this pragma are subject to control by compiler
switches (in particular -gnatp) in the usual manner.
@@ -814,27 +816,27 @@ Syntax:
This pragma is used to set the checking policy for assertions (specified
-by aspects or pragmas), the `Debug` pragma, or additional checks
-to be checked using the `Check` pragma. It may appear either as
+by aspects or pragmas), the ``Debug`` pragma, or additional checks
+to be checked using the ``Check`` pragma. It may appear either as
a configuration pragma, or within a declarative part of package. In the
latter case, it applies from the point where it appears to the end of
-the declarative region (like pragma `Suppress`).
+the declarative region (like pragma ``Suppress``).
-The `Check_Policy` pragma is similar to the
-predefined `Assertion_Policy` pragma,
+The ``Check_Policy`` pragma is similar to the
+predefined ``Assertion_Policy`` pragma,
and if the check kind corresponds to one of the assertion kinds that
-are allowed by `Assertion_Policy`, then the effect is identical.
+are allowed by ``Assertion_Policy``, then the effect is identical.
If the first argument is Debug, then the policy applies to Debug pragmas,
-disabling their effect if the policy is `OFF`, `DISABLE`, or
-`IGNORE`, and allowing them to execute with normal semantics if
-the policy is `ON` or `CHECK`. In addition if the policy is
-`DISABLE`, then the procedure call in `Debug` pragmas will
+disabling their effect if the policy is ``OFF``, ``DISABLE``, or
+``IGNORE``, and allowing them to execute with normal semantics if
+the policy is ``ON`` or ``CHECK``. In addition if the policy is
+``DISABLE``, then the procedure call in ``Debug`` pragmas will
be totally ignored and not analyzed semantically.
Finally the first argument may be some other identifier than the above
possibilities, in which case it controls a set of named assertions
-that can be checked using pragma `Check`. For example, if the pragma:
+that can be checked using pragma ``Check``. For example, if the pragma:
.. code-block:: ada
@@ -842,19 +844,19 @@ that can be checked using pragma `Check`. For example, if the pragma:
pragma Check_Policy (Critical_Error, OFF);
-is given, then subsequent `Check` pragmas whose first argument is also
-`Critical_Error` will be disabled.
+is given, then subsequent ``Check`` pragmas whose first argument is also
+``Critical_Error`` will be disabled.
-The check policy is `OFF` to turn off corresponding checks, and `ON`
+The check policy is ``OFF`` to turn off corresponding checks, and ``ON``
to turn on corresponding checks. The default for a set of checks for which no
-`Check_Policy` is given is `OFF` unless the compiler switch
+``Check_Policy`` is given is ``OFF`` unless the compiler switch
*-gnata* is given, which turns on all checks by default.
-The check policy settings `CHECK` and `IGNORE` are recognized
-as synonyms for `ON` and `OFF`. These synonyms are provided for
-compatibility with the standard `Assertion_Policy` pragma. The check
-policy setting `DISABLE` causes the second argument of a corresponding
-`Check` pragma to be completely ignored and not analyzed.
+The check policy settings ``CHECK`` and ``IGNORE`` are recognized
+as synonyms for ``ON`` and ``OFF``. These synonyms are provided for
+compatibility with the standard ``Assertion_Policy`` pragma. The check
+policy setting ``DISABLE`` causes the second argument of a corresponding
+``Check`` pragma to be completely ignored and not analyzed.
Pragma Comment
==============
@@ -867,10 +869,10 @@ Syntax:
pragma Comment (static_string_EXPRESSION);
-This is almost identical in effect to pragma `Ident`. It allows the
+This is almost identical in effect to pragma ``Ident``. It allows the
placement of a comment into the object file and hence into the
executable file if the operating system permits such usage. The
-difference is that `Comment`, unlike `Ident`, has
+difference is that ``Comment``, unlike ``Ident``, has
no limitations on placement of the pragma (it can be placed
anywhere in the main source unit), and if more than one pragma
is used, all comments are retained.
@@ -894,15 +896,15 @@ Syntax:
This pragma enables the shared use of variables stored in overlaid
-linker areas corresponding to the use of `COMMON`
+linker areas corresponding to the use of ``COMMON``
in Fortran. The single
-object `LOCAL_NAME` is assigned to the area designated by
-the `External` argument.
+object ``LOCAL_NAME`` is assigned to the area designated by
+the ``External`` argument.
You may define a record to correspond to a series
-of fields. The `Size` argument
+of fields. The ``Size`` argument
is syntax checked in GNAT, but otherwise ignored.
-`Common_Object` is not supported on all platforms. If no
+``Common_Object`` is not supported on all platforms. If no
support is available, then the code generator will issue a message
indicating that the necessary attribute for implementation of this
pragma is not available.
@@ -1021,7 +1023,7 @@ Syntax:
([Entity =>] LOCAL_NAME);
-The `Entity` argument must be the name of a record type which has
+The ``Entity`` argument must be the name of a record type which has
two fields of the same floating-point type. The effect of this pragma is
to force gcc to use the special internal complex representation form for
this record, which may be more efficient. Note that this may result in
@@ -1053,7 +1055,7 @@ Syntax:
Specifies the alignment of components in array or record types.
-The meaning of the `Form` argument is as follows:
+The meaning of the ``Form`` argument is as follows:
.. index:: Component_Size (in pragma Component_Alignment)
@@ -1079,25 +1081,25 @@ The meaning of the `Form` argument is as follows:
*Storage_Unit*
Specifies that array or record components are byte aligned, i.e.,
aligned on boundaries determined by the value of the constant
- `System.Storage_Unit`.
+ ``System.Storage_Unit``.
.. index:: Default (in pragma Component_Alignment)
*Default*
Specifies that array or record components are aligned on default
boundaries, appropriate to the underlying hardware or operating system or
- both. The `Default` choice is the same as `Component_Size` (natural
+ both. The ``Default`` choice is the same as ``Component_Size`` (natural
alignment).
-If the `Name` parameter is present, `type_LOCAL_NAME` must
+If the ``Name`` parameter is present, ``type_LOCAL_NAME`` must
refer to a local record or array type, and the specified alignment
choice applies to the specified type. The use of
-`Component_Alignment` together with a pragma `Pack` causes the
-`Component_Alignment` pragma to be ignored. The use of
-`Component_Alignment` together with a record representation clause
+``Component_Alignment`` together with a pragma ``Pack`` causes the
+``Component_Alignment`` pragma to be ignored. The use of
+``Component_Alignment`` together with a record representation clause
is only effective for fields not specified by the representation clause.
-If the `Name` parameter is absent, the pragma can be used as either
+If the ``Name`` parameter is absent, the pragma can be used as either
a configuration pragma, in which case it applies to one or more units in
accordance with the normal rules for configuration pragmas, or it can be
used within a declarative part, in which case it applies to types that
@@ -1107,7 +1109,7 @@ to be applied to any record or array type which has otherwise standard
representation.
If the alignment for a record or array type is not specified (using
-pragma `Pack`, pragma `Component_Alignment`, or a record rep
+pragma ``Pack``, pragma ``Component_Alignment``, or a record rep
clause), the GNAT uses the default alignment as described previously.
.. _Pragma-Constant_After_Elaboration:
@@ -1122,7 +1124,7 @@ Syntax:
pragma Constant_After_Elaboration [ (boolean_EXPRESSION) ];
For the semantics of this pragma, see the entry for aspect
-`Constant_After_Elaboration` in the SPARK 2014 Reference Manual, section 3.3.1.
+``Constant_After_Elaboration`` in the SPARK 2014 Reference Manual, section 3.3.1.
.. _Pragma-Contract_Cases:
@@ -1142,9 +1144,9 @@ Syntax:
CONSEQUENCE ::= boolean_EXPRESSION
-The `Contract_Cases` pragma allows defining fine-grain specifications
+The ``Contract_Cases`` pragma allows defining fine-grain specifications
that can complement or replace the contract given by a precondition and a
-postcondition. Additionally, the `Contract_Cases` pragma can be used
+postcondition. Additionally, the ``Contract_Cases`` pragma can be used
by testing and formal verification tools. The compiler checks its validity and,
depending on the assertion policy at the point of declaration of the pragma,
it may insert a check in the executable. For code generation, the contract
@@ -1176,7 +1178,7 @@ The postcondition ensures that for the condition that was True on entry,
the corrresponding consequence is True on exit. Other consequence expressions
are not evaluated.
-A precondition `P` and postcondition `Q` can also be
+A precondition ``P`` and postcondition ``Q`` can also be
expressed as contract cases:
.. code-block:: ada
@@ -1184,16 +1186,16 @@ expressed as contract cases:
pragma Contract_Cases (P => Q);
-The placement and visibility rules for `Contract_Cases` pragmas are
+The placement and visibility rules for ``Contract_Cases`` pragmas are
identical to those described for preconditions and postconditions.
The compiler checks that boolean expressions given in conditions and
consequences are valid, where the rules for conditions are the same as
-the rule for an expression in `Precondition` and the rules for
+the rule for an expression in ``Precondition`` and the rules for
consequences are the same as the rule for an expression in
-`Postcondition`. In particular, attributes `'Old` and
-`'Result` can only be used within consequence expressions.
-The condition for the last contract case may be `others`, to denote
+``Postcondition``. In particular, attributes ``'Old`` and
+``'Result`` can only be used within consequence expressions.
+The condition for the last contract case may be ``others``, to denote
any case not captured by the previous cases. The
following is an example of use within a package spec:
@@ -1230,9 +1232,9 @@ Syntax:
This pragma provides a mechanism for supplying synonyms for existing
-convention identifiers. The `Name` identifier can subsequently
+convention identifiers. The ``Name`` identifier can subsequently
be used as a synonym for the given convention in other pragmas (including
-for example pragma `Import` or another `Convention_Identifier`
+for example pragma ``Import`` or another ``Convention_Identifier``
pragma). As an example of the use of this, suppose you had legacy code
which used Fortran77 as the identifier for Fortran. Then the pragma:
@@ -1242,13 +1244,13 @@ which used Fortran77 as the identifier for Fortran. Then the pragma:
pragma Convention_Identifier (Fortran77, Fortran);
-would allow the use of the convention identifier `Fortran77` in
+would allow the use of the convention identifier ``Fortran77`` in
subsequent code, avoiding the need to modify the sources. As another
example, you could use this to parameterize convention requirements
-according to systems. Suppose you needed to use `Stdcall` on
-windows systems, and `C` on some other system, then you could
-define a convention identifier `Library` and use a single
-`Convention_Identifier` pragma to specify which convention
+according to systems. Suppose you needed to use ``Stdcall`` on
+windows systems, and ``C`` on some other system, then you could
+define a convention identifier ``Library`` and use a single
+``Convention_Identifier`` pragma to specify which convention
would be used system-wide.
Pragma CPP_Class
@@ -1269,18 +1271,18 @@ externally declared C++ class type, and is to be laid out the same way
that C++ would lay out the type. If the C++ class has virtual primitives
then the record must be declared as a tagged record type.
-Types for which `CPP_Class` is specified do not have assignment or
+Types for which ``CPP_Class`` is specified do not have assignment or
equality operators defined (such operations can be imported or declared
as subprograms as required). Initialization is allowed only by constructor
-functions (see pragma `CPP_Constructor`). Such types are implicitly
+functions (see pragma ``CPP_Constructor``). Such types are implicitly
limited if not explicitly declared as limited or derived from a limited
type, and an error is issued in that case.
See :ref:`Interfacing_to_C++` for related information.
-Note: Pragma `CPP_Class` is currently obsolete. It is supported
+Note: Pragma ``CPP_Class`` is currently obsolete. It is supported
for backward compatibility but its functionality is available
-using pragma `Import` with `Convention` = `CPP`.
+using pragma ``Import`` with ``Convention`` = ``CPP``.
Pragma CPP_Constructor
======================
@@ -1298,37 +1300,37 @@ Syntax:
This pragma identifies an imported function (imported in the usual way
-with pragma `Import`) as corresponding to a C++ constructor. If
-`External_Name` and `Link_Name` are not specified then the
-`Entity` argument is a name that must have been previously mentioned
-in a pragma `Import` with `Convention` = `CPP`. Such name
+with pragma ``Import``) as corresponding to a C++ constructor. If
+``External_Name`` and ``Link_Name`` are not specified then the
+``Entity`` argument is a name that must have been previously mentioned
+in a pragma ``Import`` with ``Convention`` = ``CPP``. Such name
must be of one of the following forms:
*
- **function** `Fname` **return** T`
+ **function** ``Fname`` **return** T`
*
- **function** `Fname` **return** T'Class
+ **function** ``Fname`` **return** T'Class
*
- **function** `Fname` (...) **return** T`
+ **function** ``Fname`` (...) **return** T`
*
- **function** `Fname` (...) **return** T'Class
+ **function** ``Fname`` (...) **return** T'Class
-where `T` is a limited record type imported from C++ with pragma
-`Import` and `Convention` = `CPP`.
+where ``T`` is a limited record type imported from C++ with pragma
+``Import`` and ``Convention`` = ``CPP``.
The first two forms import the default constructor, used when an object
-of type `T` is created on the Ada side with no explicit constructor.
+of type ``T`` is created on the Ada side with no explicit constructor.
The latter two forms cover all the non-default constructors of the type.
See the GNAT User's Guide for details.
If no constructors are imported, it is impossible to create any objects
on the Ada side and the type is implicitly declared abstract.
-Pragma `CPP_Constructor` is intended primarily for automatic generation
-using an automatic binding generator tool (such as the `-fdump-ada-spec`
+Pragma ``CPP_Constructor`` is intended primarily for automatic generation
+using an automatic binding generator tool (such as the :switch:`-fdump-ada-spec`
GCC switch).
See :ref:`Interfacing_to_C++` for more related information.
@@ -1407,7 +1409,7 @@ Syntax:
pragma Default_Initial_Condition [ (null | boolean_EXPRESSION) ];
For the semantics of this pragma, see the entry for aspect
-`Default_Initial_Condition` in the SPARK 2014 Reference Manual, section 7.3.3.
+``Default_Initial_Condition`` in the SPARK 2014 Reference Manual, section 7.3.3.
Pragma Debug
============
@@ -1431,11 +1433,11 @@ If debug pragmas are not enabled or if the condition is present and evaluates
to False, this pragma has no effect. If debug pragmas are enabled, the
semantics of the pragma is exactly equivalent to the procedure call statement
corresponding to the argument with a terminating semicolon. Pragmas are
-permitted in sequences of declarations, so you can use pragma `Debug` to
+permitted in sequences of declarations, so you can use pragma ``Debug`` to
intersperse calls to debug procedures in the middle of declarations. Debug
pragmas can be enabled either by use of the command line switch *-gnata*
-or by use of the pragma `Check_Policy` with a first argument of
-`Debug`.
+or by use of the pragma ``Check_Policy`` with a first argument of
+``Debug``.
Pragma Debug_Policy
===================
@@ -1448,8 +1450,8 @@ Syntax:
pragma Debug_Policy (CHECK | DISABLE | IGNORE | ON | OFF);
-This pragma is equivalent to a corresponding `Check_Policy` pragma
-with a first argument of `Debug`. It is retained for historical
+This pragma is equivalent to a corresponding ``Check_Policy`` pragma
+with a first argument of ``Debug``. It is retained for historical
compatibility reasons.
Pragma Default_Scalar_Storage_Order
@@ -1467,7 +1469,7 @@ Syntax:
pragma Default_Scalar_Storage_Order (High_Order_First | Low_Order_First);
-Normally if no explicit `Scalar_Storage_Order` is given for a record
+Normally if no explicit ``Scalar_Storage_Order`` is given for a record
type or array type, then the scalar storage order defaults to the ordinary
default for the target. But this default may be overridden using this pragma.
The pragma may appear as a configuration pragma, or locally within a package
@@ -1513,10 +1515,10 @@ The following example shows the use of this pragma:
end DSSO1;
-In this example record types L.. have `Low_Order_First` scalar
-storage order, and record types H.. have `High_Order_First`.
-Note that in the case of `H4a`, the order is not inherited
-from the parent type. Only an explicitly set `Scalar_Storage_Order`
+In this example record types with names starting with *L* have `Low_Order_First` scalar
+storage order, and record types with names starting with *H* have ``High_Order_First``.
+Note that in the case of ``H4a``, the order is not inherited
+from the parent type. Only an explicitly set ``Scalar_Storage_Order``
gets inherited on type derivation.
If this pragma is used as a configuration pragma which appears within a
@@ -1574,7 +1576,7 @@ Syntax:
where FUNCTION_RESULT is a function Result attribute_reference
-For the semantics of this pragma, see the entry for aspect `Depends` in the
+For the semantics of this pragma, see the entry for aspect ``Depends`` in the
SPARK 2014 Reference Manual, section 6.1.5.
Pragma Detect_Blocking
@@ -1614,9 +1616,9 @@ be turned off using this pragma in cases where it is known not to be
required.
The placement and scope rules for this pragma are the same as those
-for `pragma Suppress`. In particular it can be used as a
+for ``pragma Suppress``. In particular it can be used as a
configuration pragma, or in a declaration sequence where it applies
-till the end of the scope. If an `Entity` argument is present,
+till the end of the scope. If an ``Entity`` argument is present,
the action applies only to that entity.
Pragma Dispatching_Domain
@@ -1645,7 +1647,7 @@ Syntax:
pragma Effective_Reads [ (boolean_EXPRESSION) ];
-For the semantics of this pragma, see the entry for aspect `Effective_Reads` in
+For the semantics of this pragma, see the entry for aspect ``Effective_Reads`` in
the SPARK 2014 Reference Manual, section 7.1.2.
.. _Pragma-Effective_Writes:
@@ -1659,7 +1661,7 @@ Syntax:
pragma Effective_Writes [ (boolean_EXPRESSION) ];
-For the semantics of this pragma, see the entry for aspect `Effective_Writes`
+For the semantics of this pragma, see the entry for aspect ``Effective_Writes``
in the SPARK 2014 Reference Manual, section 7.1.2.
Pragma Elaboration_Checks
@@ -1677,16 +1679,17 @@ Syntax:
This is a configuration pragma that provides control over the
elaboration model used by the compilation affected by the
-pragma. If the parameter is `Dynamic`,
+pragma. If the parameter is ``Dynamic``,
then the dynamic elaboration
model described in the Ada Reference Manual is used, as though
the *-gnatE* switch had been specified on the command
-line. If the parameter is `Static`, then the default GNAT static
+line. If the parameter is ``Static``, then the default GNAT static
model is used. This configuration pragma overrides the setting
of the command line. For full details on the elaboration models
used by the GNAT compiler, see the chapter on elaboration order handling
in the *GNAT User's Guide*.
+
Pragma Eliminate
================
.. index:: Elimination of unused subprograms
@@ -1697,76 +1700,141 @@ Syntax:
::
- pragma Eliminate ([Entity =>] DEFINING_DESIGNATOR,
- [Source_Location =>] STRING_LITERAL);
+ pragma Eliminate (
+ [ Unit_Name => ] IDENTIFIER | SELECTED_COMPONENT ,
+ [ Entity => ] IDENTIFIER |
+ SELECTED_COMPONENT |
+ STRING_LITERAL
+ [, Source_Location => SOURCE_TRACE ] );
+ SOURCE_TRACE ::= STRING_LITERAL
-The string literal given for the source location is a string which
-specifies the line number of the occurrence of the entity, using
-the syntax for SOURCE_TRACE given below:
+This pragma indicates that the given entity is not used in the program to be
+compiled and built, thus allowing the compiler to
+eliminate the code or data associated with the named entity. Any reference to
+an eliminated entity causes a compile-time or link-time error.
-::
+The pragma has the following semantics, where ``U`` is the unit specified by
+the ``Unit_Name`` argument and ``E`` is the entity specified by the ``Entity``
+argument:
- SOURCE_TRACE ::= SOURCE_REFERENCE [LBRACKET SOURCE_TRACE RBRACKET]
+* ``E`` must be a subprogram that is explicitly declared either:
- LBRACKET ::= [
- RBRACKET ::= ]
+ o Within ``U``, or
- SOURCE_REFERENCE ::= FILE_NAME : LINE_NUMBER
+ o Within a generic package that is instantiated in ``U``, or
- LINE_NUMBER ::= DIGIT {DIGIT}
+ o As an instance of generic subprogram instantiated in ``U``.
+ Otherwise the pragma is ignored.
-Spaces around the colon in a `Source_Reference` are optional.
-
-The `DEFINING_DESIGNATOR` matches the defining designator used in an
-explicit subprogram declaration, where the `entity` name in this
-designator appears on the source line specified by the source location.
-
-The source trace that is given as the `Source_Location` shall obey the
-following rules. The `FILE_NAME` is the short name (with no directory
-information) of an Ada source file, given using exactly the required syntax
-for the underlying file system (e.g. case is important if the underlying
-operating system is case sensitive). `LINE_NUMBER` gives the line
-number of the occurrence of the `entity`
-as a decimal literal without an exponent or point. If an `entity` is not
-declared in a generic instantiation (this includes generic subprogram
-instances), the source trace includes only one source reference. If an entity
-is declared inside a generic instantiation, its source trace (when parsing
-from left to right) starts with the source location of the declaration of the
-entity in the generic unit and ends with the source location of the
-instantiation (it is given in square brackets). This approach is recursively
-used in case of nested instantiations: the rightmost (nested most deeply in
-square brackets) element of the source trace is the location of the outermost
-instantiation, the next to left element is the location of the next (first
-nested) instantiation in the code of the corresponding generic unit, and so
-on, and the leftmost element (that is out of any square brackets) is the
-location of the declaration of the entity to eliminate in a generic unit.
-
-Note that the `Source_Location` argument specifies which of a set of
-similarly named entities is being eliminated, dealing both with overloading,
-and also appearance of the same entity name in different scopes.
+* If ``E`` is overloaded within ``U`` then, in the absence of a
+ ``Source_Location`` argument, all overloadings are eliminated.
-This pragma indicates that the given entity is not used in the program to be
-compiled and built. The effect of the pragma is to allow the compiler to
-eliminate the code or data associated with the named entity. Any reference to
-an eliminated entity causes a compile-time or link-time error.
+* If ``E`` is overloaded within ``U`` and only some overloadings
+ are to be eliminated, then each overloading to be eliminated
+ must be specified in a corresponding pragma ``Eliminate``
+ with a ``Source_Location`` argument identifying the line where the
+ declaration appears, as described below.
+
+* If ``E`` is declared as the result of a generic instantiation, then
+ a ``Source_Location`` argument is needed, as described below
-The intention of pragma `Eliminate` is to allow a program to be compiled
-in a system-independent manner, with unused entities eliminated, without
+Pragma ``Eliminate`` allows a program to be compiled in a system-independent
+manner, so that unused entities are eliminated but without
needing to modify the source text. Normally the required set of
-`Eliminate` pragmas is constructed automatically using the gnatelim tool.
+``Eliminate`` pragmas is constructed automatically using the ``gnatelim`` tool.
Any source file change that removes, splits, or
-adds lines may make the set of Eliminate pragmas invalid because their
-`Source_Location` argument values may get out of date.
+adds lines may make the set of ``Eliminate`` pragmas invalid because their
+``Source_Location`` argument values may get out of date.
-Pragma `Eliminate` may be used where the referenced entity is a dispatching
+Pragma ``Eliminate`` may be used where the referenced entity is a dispatching
operation. In this case all the subprograms to which the given operation can
dispatch are considered to be unused (are never called as a result of a direct
or a dispatching call).
+The string literal given for the source location specifies the line number
+of the declaration of the entity, using the following syntax for ``SOURCE_TRACE``:
+
+::
+
+ SOURCE_TRACE ::= SOURCE_REFERENCE [ LBRACKET SOURCE_TRACE RBRACKET ]
+
+ LBRACKET ::= '['
+ RBRACKET ::= ']'
+
+ SOURCE_REFERENCE ::= FILE_NAME : LINE_NUMBER
+
+ LINE_NUMBER ::= DIGIT {DIGIT}
+
+
+Spaces around the colon in a ``SOURCE_REFERENCE`` are optional.
+
+The source trace that is given as the ``Source_Location`` must obey the
+following rules (or else the pragma is ignored), where ``U`` is
+the unit ``U`` specified by the ``Unit_Name`` argument and ``E`` is the
+subprogram specified by the ``Entity`` argument:
+
+* ``FILE_NAME`` is the short name (with no directory
+ information) of the Ada source file for ``U``, using the required syntax
+ for the underlying file system (e.g. case is significant if the underlying
+ operating system is case sensitive).
+ If ``U`` is a package and ``E`` is a subprogram declared in the package
+ specification and its full declaration appears in the package body,
+ then the relevant source file is the one for the package specification;
+ analogously if ``U`` is a generic package.
+
+* If ``E`` is not declared in a generic instantiation (this includes
+ generic subprogram instances), the source trace includes only one source
+ line reference. ``LINE_NUMBER`` gives the line number of the occurrence
+ of the declaration of ``E`` within the source file (as a decimal literal
+ without an exponent or point).
+
+* If ``E`` is declared by a generic instantiation, its source trace
+ (from left to right) starts with the source location of the
+ declaration of ``E`` in the generic unit and ends with the source
+ location of the instantiation, given in square brackets. This approach is
+ applied recursively with nested instantiations: the rightmost (nested
+ most deeply in square brackets) element of the source trace is the location
+ of the outermost instantiation, and the leftmost element (that is, outside
+ of any square brackets) is the location of the declaration of ``E`` in
+ the generic unit.
+
+Examples:
+
+ .. code-block:: ada
+
+ pragma Eliminate (Pkg0, Proc);
+ -- Eliminate (all overloadings of) Proc in Pkg0
+
+ pragma Eliminate (Pkg1, Proc,
+ Source_Location => "pkg1.ads:8");
+ -- Eliminate overloading of Proc at line 8 in pkg1.ads
+
+ -- Assume the following file contents:
+ -- gen_pkg.ads
+ -- 1: generic
+ -- 2: type T is private;
+ -- 3: package Gen_Pkg is
+ -- 4: procedure Proc(N : T);
+ -- ... ...
+ -- ... end Gen_Pkg;
+ --
+ -- q.adb
+ -- 1: with Gen_Pkg;
+ -- 2: procedure Q is
+ -- 3: package Inst_Pkg is new Gen_Pkg(Integer);
+ -- ... -- No calls on Inst_Pkg.Proc
+ -- ... end Q;
+
+ -- The following pragma eliminates Inst_Pkg.Proc from Q
+ pragma Eliminate (Q, Proc,
+ Source_Location => "gen_pkg.ads:4[q.adb:3]");
+
+
+
Pragma Enable_Atomic_Synchronization
====================================
.. index:: Atomic Synchronization
@@ -1785,14 +1853,14 @@ regarded as synchronization points in the case of multiple tasks.
Particularly in the case of multi-processors this may require special
handling, e.g. the generation of memory barriers. This synchronization
is performed by default, but can be turned off using
-`pragma Disable_Atomic_Synchronization`. The
-`Enable_Atomic_Synchronization` pragma can be used to turn
+``pragma Disable_Atomic_Synchronization``. The
+``Enable_Atomic_Synchronization`` pragma can be used to turn
it back on.
The placement and scope rules for this pragma are the same as those
-for `pragma Unsuppress`. In particular it can be used as a
+for ``pragma Unsuppress``. In particular it can be used as a
configuration pragma, or in a declaration sequence where it applies
-till the end of the scope. If an `Entity` argument is present,
+till the end of the scope. If an ``Entity`` argument is present,
the action applies only to that entity.
Pragma Export_Function
@@ -1840,24 +1908,24 @@ Use this pragma to make a function externally callable and optionally
provide information on mechanisms to be used for passing parameter and
result values. We recommend, for the purposes of improving portability,
this pragma always be used in conjunction with a separate pragma
-`Export`, which must precede the pragma `Export_Function`.
-GNAT does not require a separate pragma `Export`, but if none is
-present, `Convention Ada` is assumed, which is usually
+``Export``, which must precede the pragma ``Export_Function``.
+GNAT does not require a separate pragma ``Export``, but if none is
+present, ``Convention Ada`` is assumed, which is usually
not what is wanted, so it is usually appropriate to use this
-pragma in conjunction with a `Export` or `Convention`
+pragma in conjunction with a ``Export`` or ``Convention``
pragma that specifies the desired foreign convention.
-Pragma `Export_Function`
-(and `Export`, if present) must appear in the same declarative
+Pragma ``Export_Function``
+(and ``Export``, if present) must appear in the same declarative
region as the function to which they apply.
-`internal_name` must uniquely designate the function to which the
+The ``internal_name`` must uniquely designate the function to which the
pragma applies. If more than one function name exists of this name in
-the declarative part you must use the `Parameter_Types` and
-`Result_Type` parameters is mandatory to achieve the required
-unique designation. `subtype_mark`s in these parameters must
+the declarative part you must use the ``Parameter_Types`` and
+``Result_Type`` parameters to achieve the required
+unique designation. The `subtype_mark`\ s in these parameters must
exactly match the subtypes in the corresponding function specification,
using positional notation to match parameters with subtype marks.
-The form with an `'Access` attribute can be used to match an
+The form with an ``'Access`` attribute can be used to match an
anonymous access parameter.
.. index:: Suppressing external name
@@ -1887,9 +1955,9 @@ Syntax:
This pragma designates an object as exported, and apart from the
extended rules for external symbols, is identical in effect to the use of
-the normal `Export` pragma applied to an object. You may use a
+the normal ``Export`` pragma applied to an object. You may use a
separate Export pragma (and you probably should from the point of view
-of portability), but it is not required. `Size` is syntax checked,
+of portability), but it is not required. ``Size`` is syntax checked,
but otherwise ignored by GNAT.
Pragma Export_Procedure
@@ -1929,13 +1997,13 @@ Syntax:
MECHANISM_NAME ::= Value | Reference
-This pragma is identical to `Export_Function` except that it
+This pragma is identical to ``Export_Function`` except that it
applies to a procedure rather than a function and the parameters
-`Result_Type` and `Result_Mechanism` are not permitted.
-GNAT does not require a separate pragma `Export`, but if none is
-present, `Convention Ada` is assumed, which is usually
+``Result_Type`` and ``Result_Mechanism`` are not permitted.
+GNAT does not require a separate pragma ``Export``, but if none is
+present, ``Convention Ada`` is assumed, which is usually
not what is wanted, so it is usually appropriate to use this
-pragma in conjunction with a `Export` or `Convention`
+pragma in conjunction with a ``Export`` or ``Convention``
pragma that specifies the desired foreign convention.
.. index:: Suppressing external name
@@ -2003,18 +2071,18 @@ Syntax:
MECHANISM_NAME ::= Value | Reference
-This pragma is identical to `Export_Procedure` except that the
-first parameter of `LOCAL_NAME`, which must be present, must be of
-mode `OUT`, and externally the subprogram is treated as a function
+This pragma is identical to ``Export_Procedure`` except that the
+first parameter of ``LOCAL_NAME``, which must be present, must be of
+mode ``out``, and externally the subprogram is treated as a function
with this parameter as the result of the function. GNAT provides for
-this capability to allow the use of `OUT` and `IN OUT`
+this capability to allow the use of ``out`` and ``in out``
parameters in interfacing to external functions (which are not permitted
in Ada functions).
-GNAT does not require a separate pragma `Export`, but if none is
-present, `Convention Ada` is assumed, which is almost certainly
+GNAT does not require a separate pragma ``Export``, but if none is
+present, ``Convention Ada`` is assumed, which is almost certainly
not what is wanted since the whole point of this pragma is to interface
with foreign language functions, so it is usually appropriate to use this
-pragma in conjunction with a `Export` or `Convention`
+pragma in conjunction with a ``Export`` or ``Convention``
pragma that specifies the desired foreign convention.
.. index:: Suppressing external name
@@ -2040,35 +2108,35 @@ Syntax:
This pragma is used to provide backwards compatibility with other
-implementations that extend the facilities of package `System`. In
-GNAT, `System` contains only the definitions that are present in
+implementations that extend the facilities of package ``System``. In
+GNAT, ``System`` contains only the definitions that are present in
the Ada RM. However, other implementations, notably the DEC Ada 83
-implementation, provide many extensions to package `System`.
+implementation, provide many extensions to package ``System``.
For each such implementation accommodated by this pragma, GNAT provides a
-package `Aux_`xxx``, e.g., `Aux_DEC` for the DEC Ada 83
+package :samp:`Aux_{xxx}`, e.g., ``Aux_DEC`` for the DEC Ada 83
implementation, which provides the required additional definitions. You
-can use this package in two ways. You can `with` it in the normal
-way and access entities either by selection or using a `use`
+can use this package in two ways. You can ``with`` it in the normal
+way and access entities either by selection or using a ``use``
clause. In this case no special processing is required.
However, if existing code contains references such as
-`System.`xxx`` where `xxx` is an entity in the extended
-definitions provided in package `System`, you may use this pragma
-to extend visibility in `System` in a non-standard way that
+:samp:`System.{xxx}` where *xxx* is an entity in the extended
+definitions provided in package ``System``, you may use this pragma
+to extend visibility in ``System`` in a non-standard way that
provides greater compatibility with the existing code. Pragma
-`Extend_System` is a configuration pragma whose single argument is
+``Extend_System`` is a configuration pragma whose single argument is
the name of the package containing the extended definition
-(e.g., `Aux_DEC` for the DEC Ada case). A unit compiled under
+(e.g., ``Aux_DEC`` for the DEC Ada case). A unit compiled under
control of this pragma will be processed using special visibility
-processing that looks in package `System.Aux_`xxx`` where
-`Aux_`xxx`` is the pragma argument for any entity referenced in
-package `System`, but not found in package `System`.
+processing that looks in package :samp:`System.Aux_{xxx}` where
+:samp:`Aux_{xxx}` is the pragma argument for any entity referenced in
+package ``System``, but not found in package ``System``.
-You can use this pragma either to access a predefined `System`
-extension supplied with the compiler, for example `Aux_DEC` or
+You can use this pragma either to access a predefined ``System``
+extension supplied with the compiler, for example ``Aux_DEC`` or
you can construct your own extension unit following the above
-definition. Note that such a package is a child of `System`
+definition. Note that such a package is a child of ``System``
and thus is considered part of the implementation.
To compile it you will have to use the *-gnatg* switch
for compiling System units, as explained in the
@@ -2099,7 +2167,7 @@ of GNAT specific extensions are recognized as follows:
*Constrained attribute for generic objects*
- The `Constrained` attribute is permitted for objects of
+ The ``Constrained`` attribute is permitted for objects of
generic types. The result indicates if the corresponding actual
is constrained.
@@ -2114,7 +2182,7 @@ Syntax:
pragma Extensions_Visible [ (boolean_EXPRESSION) ];
-For the semantics of this pragma, see the entry for aspect `Extensions_Visible`
+For the semantics of this pragma, see the entry for aspect ``Extensions_Visible``
in the SPARK 2014 Reference Manual, section 6.1.7.
Pragma External
@@ -2133,10 +2201,10 @@ Syntax:
This pragma is identical in syntax and semantics to pragma
-`Export` as defined in the Ada Reference Manual. It is
+``Export`` as defined in the Ada Reference Manual. It is
provided for compatibility with some Ada 83 compilers that
used this pragma for exactly the same purposes as pragma
-`Export` before the latter was standardized.
+``Export`` before the latter was standardized.
Pragma External_Name_Casing
===========================
@@ -2177,9 +2245,9 @@ with Import and Export pragmas. There are two cases to consider:
casing of the external name, and so a convention is needed. In GNAT the
default treatment is that such names are converted to all lower case
letters. This corresponds to the normal C style in many environments.
- The first argument of pragma `External_Name_Casing` can be used to
- control this treatment. If `Uppercase` is specified, then the name
- will be forced to all uppercase letters. If `Lowercase` is specified,
+ The first argument of pragma ``External_Name_Casing`` can be used to
+ control this treatment. If ``Uppercase`` is specified, then the name
+ will be forced to all uppercase letters. If ``Lowercase`` is specified,
then the normal default of all lower case letters will be used.
This same implicit treatment is also used in the case of extended DEC Ada 83
@@ -2199,11 +2267,11 @@ with Import and Export pragmas. There are two cases to consider:
In this case, the string literal normally provides the exact casing required
for the external name. The second argument of pragma
- `External_Name_Casing` may be used to modify this behavior.
- If `Uppercase` is specified, then the name
- will be forced to all uppercase letters. If `Lowercase` is specified,
+ ``External_Name_Casing`` may be used to modify this behavior.
+ If ``Uppercase`` is specified, then the name
+ will be forced to all uppercase letters. If ``Lowercase`` is specified,
then the name will be forced to all lowercase letters. A specification of
- `As_Is` provides the normal default behavior in which the casing is
+ ``As_Is`` provides the normal default behavior in which the casing is
taken from the string provided.
This pragma may appear anywhere that a pragma is valid. In particular, it
@@ -2247,7 +2315,7 @@ following operations are affected:
overflows for numbers near the end of the range. The Ada standard requires that
this situation be detected and corrected by scaling, but in Fast_Math mode such
cases will simply result in overflow. Note that to take advantage of this you
- must instantiate your own version of `Ada.Numerics.Generic_Complex_Types`
+ must instantiate your own version of ``Ada.Numerics.Generic_Complex_Types``
under control of the pragma, rather than use the preinstantiated versions.
.. _Pragma-Favor_Top_Level:
@@ -2263,13 +2331,13 @@ Syntax:
pragma Favor_Top_Level (type_NAME);
-The argument of pragma `Favor_Top_Level` must be a named access-to-subprogram
+The argument of pragma ``Favor_Top_Level`` must be a named access-to-subprogram
type. This pragma is an efficiency hint to the compiler, regarding the use of
-`'Access` or `'Unrestricted_Access` on nested (non-library-level) subprograms.
+``'Access`` or ``'Unrestricted_Access`` on nested (non-library-level) subprograms.
The pragma means that nested subprograms are not used with this type, or are
rare, so that the generated code should be efficient in the top-level case.
When this pragma is used, dynamically generated trampolines may be used on some
-targets for nested subprograms. See restriction `No_Implicit_Dynamic_Code`.
+targets for nested subprograms. See restriction ``No_Implicit_Dynamic_Code``.
Pragma Finalize_Storage_Only
============================
@@ -2282,14 +2350,14 @@ Syntax:
pragma Finalize_Storage_Only (first_subtype_LOCAL_NAME);
-The argument of pragma `Finalize_Storage_Only` must denote a local type which
-is derived from `Ada.Finalization.Controlled` or `Limited_Controlled`. The
-pragma suppresses the call to `Finalize` for declared library-level objects
+The argument of pragma ``Finalize_Storage_Only`` must denote a local type which
+is derived from ``Ada.Finalization.Controlled`` or ``Limited_Controlled``. The
+pragma suppresses the call to ``Finalize`` for declared library-level objects
of the argument type. This is mostly useful for types where finalization is
only used to deal with storage reclamation since in most environments it is
not necessary to reclaim memory just before terminating execution, hence the
name. Note that this pragma does not suppress Finalize calls for library-level
-heap-allocated objects (see pragma `No_Heap_Finalization`).
+heap-allocated objects (see pragma ``No_Heap_Finalization``).
Pragma Float_Representation
===========================
@@ -2303,12 +2371,12 @@ Syntax::
In the one argument form, this pragma is a configuration pragma which
allows control over the internal representation chosen for the predefined
-floating point types declared in the packages `Standard` and
-`System`. This pragma is only provided for compatibility and has no effect.
+floating point types declared in the packages ``Standard`` and
+``System``. This pragma is only provided for compatibility and has no effect.
The two argument form specifies the representation to be used for
the specified floating-point type. The argument must
-be `IEEE_Float` to specify the use of IEEE format, as follows:
+be ``IEEE_Float`` to specify the use of IEEE format, as follows:
*
For a digits value of 6, 32-bit IEEE short format will be used.
@@ -2328,7 +2396,7 @@ Syntax:
pragma Ghost [ (boolean_EXPRESSION) ];
-For the semantics of this pragma, see the entry for aspect `Ghost` in the SPARK
+For the semantics of this pragma, see the entry for aspect ``Ghost`` in the SPARK
2014 Reference Manual, section 6.9.
.. _Pragma-Global:
@@ -2353,7 +2421,7 @@ Syntax:
GLOBAL_LIST ::= GLOBAL_ITEM | (GLOBAL_ITEM {, GLOBAL_ITEM})
GLOBAL_ITEM ::= NAME
-For the semantics of this pragma, see the entry for aspect `Global` in the
+For the semantics of this pragma, see the entry for aspect ``Global`` in the
SPARK 2014 Reference Manual, section 6.1.4.
Pragma Ident
@@ -2367,7 +2435,7 @@ Syntax:
pragma Ident (static_string_EXPRESSION);
-This pragma is identical in effect to pragma `Comment`. It is provided
+This pragma is identical in effect to pragma ``Comment``. It is provided
for compatibility with other Ada compilers providing this pragma.
Pragma Ignore_Pragma
@@ -2385,8 +2453,8 @@ that takes a single argument that is a simple identifier. Any subsequent
use of a pragma whose pragma identifier matches this argument will be
silently ignored. This may be useful when legacy code or code intended
for compilation with some other compiler contains pragmas that match the
-name, but not the exact implementation, of a `GNAT` pragma. The use of this
-pragma allows such pragmas to be ignored, which may be useful in `CodePeer`
+name, but not the exact implementation, of a GNAT pragma. The use of this
+pragma allows such pragmas to be ignored, which may be useful in CodePeer
mode, or during porting of legacy code.
Pragma Implementation_Defined
@@ -2563,24 +2631,24 @@ Syntax:
| Reference
-This pragma is used in conjunction with a pragma `Import` to
+This pragma is used in conjunction with a pragma ``Import`` to
specify additional information for an imported function. The pragma
-`Import` (or equivalent pragma `Interface`) must precede the
-`Import_Function` pragma and both must appear in the same
+``Import`` (or equivalent pragma ``Interface``) must precede the
+``Import_Function`` pragma and both must appear in the same
declarative part as the function specification.
-The `Internal` argument must uniquely designate
+The ``Internal`` argument must uniquely designate
the function to which the
pragma applies. If more than one function name exists of this name in
-the declarative part you must use the `Parameter_Types` and
-`Result_Type` parameters to achieve the required unique
+the declarative part you must use the ``Parameter_Types`` and
+``Result_Type`` parameters to achieve the required unique
designation. Subtype marks in these parameters must exactly match the
subtypes in the corresponding function specification, using positional
notation to match parameters with subtype marks.
-The form with an `'Access` attribute can be used to match an
+The form with an ``'Access`` attribute can be used to match an
anonymous access parameter.
-You may optionally use the `Mechanism` and `Result_Mechanism`
+You may optionally use the ``Mechanism`` and ``Result_Mechanism``
parameters to specify passing mechanisms for the
parameters and result. If you specify a single mechanism name, it
applies to all parameters. Otherwise you may specify a mechanism on a
@@ -2608,10 +2676,10 @@ Syntax:
This pragma designates an object as imported, and apart from the
extended rules for external symbols, is identical in effect to the use of
-the normal `Import` pragma applied to an object. Unlike the
-subprogram case, you need not use a separate `Import` pragma,
+the normal ``Import`` pragma applied to an object. Unlike the
+subprogram case, you need not use a separate ``Import`` pragma,
although you may do so (and probably should do so from a portability
-point of view). `size` is syntax checked, but otherwise ignored by
+point of view). ``size`` is syntax checked, but otherwise ignored by
GNAT.
Pragma Import_Procedure
@@ -2650,9 +2718,9 @@ Syntax:
MECHANISM_NAME ::= Value | Reference
-This pragma is identical to `Import_Function` except that it
+This pragma is identical to ``Import_Function`` except that it
applies to a procedure rather than a function and the parameters
-`Result_Type` and `Result_Mechanism` are not permitted.
+``Result_Type`` and ``Result_Mechanism`` are not permitted.
Pragma Import_Valued_Procedure
==============================
@@ -2690,13 +2758,13 @@ Syntax:
MECHANISM_NAME ::= Value | Reference
-This pragma is identical to `Import_Procedure` except that the
-first parameter of `LOCAL_NAME`, which must be present, must be of
-mode `OUT`, and externally the subprogram is treated as a function
+This pragma is identical to ``Import_Procedure`` except that the
+first parameter of ``LOCAL_NAME``, which must be present, must be of
+mode ``out``, and externally the subprogram is treated as a function
with this parameter as the result of the function. The purpose of this
-capability is to allow the use of `OUT` and `IN OUT`
+capability is to allow the use of ``out`` and ``in out``
parameters in interfacing to external functions (which are not permitted
-in Ada functions). You may optionally use the `Mechanism`
+in Ada functions). You may optionally use the ``Mechanism``
parameters to specify passing mechanisms for the parameters.
If you specify a single mechanism name, it applies to all parameters.
Otherwise you may specify a mechanism on a parameter by parameter
@@ -2761,7 +2829,7 @@ Syntax:
pragma Initial_Condition (boolean_EXPRESSION);
-For the semantics of this pragma, see the entry for aspect `Initial_Condition`
+For the semantics of this pragma, see the entry for aspect ``Initial_Condition``
in the SPARK 2014 Reference Manual, section 7.1.6.
Pragma Initialize_Scalars
@@ -2776,7 +2844,7 @@ Syntax:
pragma Initialize_Scalars;
-This pragma is similar to `Normalize_Scalars` conceptually but has
+This pragma is similar to ``Normalize_Scalars`` conceptually but has
two important differences. First, there is no requirement for the pragma
to be used uniformly in all units of a partition, in particular, it is fine
to use this just for some or all of the application units of a partition,
@@ -2810,16 +2878,16 @@ It is even possible to change the value at execution time eliminating even
the need to rebind with a different switch using an environment variable.
See the GNAT User's Guide for details.
-Note that pragma `Initialize_Scalars` is particularly useful in
+Note that pragma ``Initialize_Scalars`` is particularly useful in
conjunction with the enhanced validity checking that is now provided
in GNAT, which checks for invalid values under more conditions.
Using this feature (see description of the *-gnatV* flag in the
GNAT User's Guide) in conjunction with
-pragma `Initialize_Scalars`
+pragma ``Initialize_Scalars``
provides a powerful new tool to assist in the detection of problems
caused by uninitialized variables.
-Note: the use of `Initialize_Scalars` has a fairly extensive
+Note: the use of ``Initialize_Scalars`` has a fairly extensive
effect on the generated code. This may cause your code to be
substantially larger. It may also cause an increase in the amount
of stack required, so it is probably a good idea to turn on stack
@@ -2850,7 +2918,7 @@ Syntax:
INPUT ::= name
-For the semantics of this pragma, see the entry for aspect `Initializes` in the
+For the semantics of this pragma, see the entry for aspect ``Initializes`` in the
SPARK 2014 Reference Manual, section 7.1.5.
.. _Pragma-Inline_Always:
@@ -2866,13 +2934,13 @@ Syntax:
pragma Inline_Always (NAME [, NAME]);
-Similar to pragma `Inline` except that inlining is unconditional.
+Similar to pragma ``Inline`` except that inlining is unconditional.
Inline_Always instructs the compiler to inline every direct call to the
subprogram or else to emit a compilation error, independently of any
option, in particular *-gnatn* or *-gnatN* or the optimization level.
-It is an error to take the address or access of `NAME`. It is also an error to
+It is an error to take the address or access of ``NAME``. It is also an error to
apply this pragma to a primitive operation of a tagged type. Thanks to such
-restrictions, the compiler is allowed to remove the out-of-line body of `NAME`.
+restrictions, the compiler is allowed to remove the out-of-line body of ``NAME``.
Pragma Inline_Generic
=====================
@@ -2888,7 +2956,7 @@ Syntax:
This pragma is provided for compatibility with Dec Ada 83. It has
-no effect in `GNAT` (which always inlines generics), other
+no effect in GNAT (which always inlines generics), other
than to check that the given names are all names of generic units or
generic instances.
@@ -2908,14 +2976,14 @@ Syntax:
This pragma is identical in syntax and semantics to
-the standard Ada pragma `Import`. It is provided for compatibility
+the standard Ada pragma ``Import``. It is provided for compatibility
with Ada 83. The definition is upwards compatible both with pragma
-`Interface` as defined in the Ada 83 Reference Manual, and also
+``Interface`` as defined in the Ada 83 Reference Manual, and also
with some extended implementations of this pragma in certain Ada 83
-implementations. The only difference between pragma `Interface`
-and pragma `Import` is that there is special circuitry to allow
+implementations. The only difference between pragma ``Interface``
+and pragma ``Import`` is that there is special circuitry to allow
both pragmas to appear for the same subprogram entity (normally it
-is illegal to have multiple `Import` pragmas. This is useful in
+is illegal to have multiple ``Import`` pragmas. This is useful in
maintaining Ada 83/Ada 95 compatibility and is compatible with other
Ada 83 compilers.
@@ -2936,7 +3004,7 @@ Syntax:
This pragma provides an alternative way of specifying the interface name
for an interfaced subprogram, and is provided for compatibility with Ada
83 compilers that use the pragma for this purpose. You must provide at
-least one of `External_Name` or `Link_Name`.
+least one of ``External_Name`` or ``Link_Name``.
Pragma Interrupt_Handler
========================
@@ -2955,7 +3023,7 @@ the pragma can also be specified for nonprotected parameterless procedures
that are declared at the library level (which includes procedures
declared at the top level of a library package). In the case of AAMP,
when this pragma is applied to a nonprotected procedure, the instruction
-`IERET` is generated for returns from the procedure, enabling
+``IERET`` is generated for returns from the procedure, enabling
maskable interrupts, in place of the normal return instruction.
Pragma Interrupt_State
@@ -2973,17 +3041,17 @@ Syntax:
Normally certain interrupts are reserved to the implementation. Any attempt
to attach an interrupt causes Program_Error to be raised, as described in
-RM C.3.2(22). A typical example is the `SIGINT` interrupt used in
+RM C.3.2(22). A typical example is the ``SIGINT`` interrupt used in
many systems for an :kbd:`Ctrl-C` interrupt. Normally this interrupt is
reserved to the implementation, so that :kbd:`Ctrl-C` can be used to
-interrupt execution. Additionally, signals such as `SIGSEGV`,
-`SIGABRT`, `SIGFPE` and `SIGILL` are often mapped to specific
+interrupt execution. Additionally, signals such as ``SIGSEGV``,
+``SIGABRT``, ``SIGFPE`` and ``SIGILL`` are often mapped to specific
Ada exceptions, or used to implement run-time functions such as the
-`abort` statement and stack overflow checking.
+``abort`` statement and stack overflow checking.
-Pragma `Interrupt_State` provides a general mechanism for overriding
+Pragma ``Interrupt_State`` provides a general mechanism for overriding
such uses of interrupts. It subsumes the functionality of pragma
-`Unreserve_All_Interrupts`. Pragma `Interrupt_State` is not
+``Unreserve_All_Interrupts``. Pragma ``Interrupt_State`` is not
available on Windows or VMS. On all other platforms than VxWorks,
it applies to signals; on VxWorks, it applies to vectored hardware interrupts
and may be used to mark interrupts required by the board support package
@@ -3011,10 +3079,10 @@ Interrupts can be in one of three states:
Ada.Interrupts and pragma Interrupt_Handler or Attach_Handler to provide
some other action.
-These states are the allowed values of the `State` parameter of the
-pragma. The `Name` parameter is a value of the type
-`Ada.Interrupts.Interrupt_ID`. Typically, it is a name declared in
-`Ada.Interrupts.Names`.
+These states are the allowed values of the ``State`` parameter of the
+pragma. The ``Name`` parameter is a value of the type
+``Ada.Interrupts.Interrupt_ID``. Typically, it is a name declared in
+``Ada.Interrupts.Names``.
This is a configuration pragma, and the binder will check that there
are no inconsistencies between different units in a partition in how a
@@ -3030,12 +3098,12 @@ a handler.
Note that certain signals on many operating systems cannot be caught and
handled by applications. In such cases, the pragma is ignored. See the
-operating system documentation, or the value of the array `Reserved`
-declared in the spec of package `System.OS_Interface`.
+operating system documentation, or the value of the array ``Reserved``
+declared in the spec of package ``System.OS_Interface``.
Overriding the default state of signals used by the Ada runtime may interfere
with an application's runtime behavior in the cases of the synchronous signals,
-and in the case of the signal used to implement the `abort` statement.
+and in the case of the signal used to implement the ``abort`` statement.
.. _Pragma-Invariant:
@@ -3089,13 +3157,13 @@ Syntax:
pragma Keep_Names ([On =>] enumeration_first_subtype_LOCAL_NAME);
-The `LOCAL_NAME` argument
+The ``LOCAL_NAME`` argument
must refer to an enumeration first subtype
in the current declarative part. The effect is to retain the enumeration
-literal names for use by `Image` and `Value` even if a global
-`Discard_Names` pragma applies. This is useful when you want to
+literal names for use by ``Image`` and ``Value`` even if a global
+``Discard_Names`` pragma applies. This is useful when you want to
generally suppress enumeration literal names and for example you therefore
-use a `Discard_Names` pragma in the :file:`gnat.adc` file, but you
+use a ``Discard_Names`` pragma in the :file:`gnat.adc` file, but you
want to retain the names for specific enumeration types.
Pragma License
@@ -3112,7 +3180,7 @@ Syntax:
This pragma is provided to allow automated checking for appropriate license
conditions with respect to the standard and modified GPL. A pragma
-`License`, which is a configuration pragma that typically appears at
+``License``, which is a configuration pragma that typically appears at
the start of a source file or in a separate :file:`gnat.adc` file, specifies
the licensing conditions of a unit as follows:
@@ -3123,7 +3191,7 @@ the licensing conditions of a unit as follows:
* GPL
This is used for a unit that is licensed under the unmodified GPL, and which
- therefore cannot be `with`'ed by a restricted unit.
+ therefore cannot be ``with``\ ed by a restricted unit.
* Modified_GPL
This is used for a unit licensed under the GNAT modified GPL that includes
@@ -3135,12 +3203,12 @@ the licensing conditions of a unit as follows:
This is used for a unit that is restricted in that it is not permitted to
depend on units that are licensed under the GPL. Typical examples are
proprietary code that is to be released under more restrictive license
- conditions. Note that restricted units are permitted to `with` units
+ conditions. Note that restricted units are permitted to ``with`` units
which are licensed under the modified GPL (this is the whole point of the
modified GPL).
-Normally a unit with no `License` pragma is considered to have an
+Normally a unit with no ``License`` pragma is considered to have an
unknown license, and no checking is done. However, standard GNAT headers
are recognized, and license information is derived from them as follows.
@@ -3158,7 +3226,7 @@ then the unit is assumed to be unrestricted.
These default actions means that a program with a restricted license pragma
will automatically get warnings if a GPL unit is inappropriately
-`with`'ed. For example, the program:
+``with``\ ed. For example, the program:
.. code-block:: ada
@@ -3169,7 +3237,7 @@ will automatically get warnings if a GPL unit is inappropriately
end Secret_Stuff
-if compiled with pragma `License` (`Restricted`) in a
+if compiled with pragma ``License`` (``Restricted``) in a
:file:`gnat.adc` file will generate the warning::
1. with Sem_Ch3;
@@ -3180,9 +3248,9 @@ if compiled with pragma `License` (`Restricted`) in a
3. procedure Secret_Stuff is
-Here we get a warning on `Sem_Ch3` since it is part of the GNAT
+Here we get a warning on ``Sem_Ch3`` since it is part of the GNAT
compiler and is licensed under the
-GPL, but no warning for `GNAT.Sockets` which is part of the GNAT
+GPL, but no warning for ``GNAT.Sockets`` which is part of the GNAT
run time, and is therefore licensed under the modified GPL.
Pragma Link_With
@@ -3197,7 +3265,7 @@ Syntax:
This pragma is provided for compatibility with certain Ada 83 compilers.
-It has exactly the same effect as pragma `Linker_Options` except
+It has exactly the same effect as pragma ``Linker_Options`` except
that spaces occurring within one of the string expressions are treated
as separators. For example, in the following case:
@@ -3206,7 +3274,7 @@ as separators. For example, in the following case:
pragma Link_With ("-labc -ldef");
-results in passing the strings `-labc` and `-ldef` as two
+results in passing the strings ``-labc`` and ``-ldef`` as two
separate arguments to the linker. In addition pragma Link_With allows
multiple arguments, with the same effect as successive pragmas.
@@ -3223,21 +3291,21 @@ Syntax:
[Target =>] static_string_EXPRESSION);
-`LOCAL_NAME` must refer to an object that is declared at the library
+``LOCAL_NAME`` must refer to an object that is declared at the library
level. This pragma establishes the given entity as a linker alias for the
-given target. It is equivalent to `__attribute__((alias))` in GNU C
-and causes `LOCAL_NAME` to be emitted as an alias for the symbol
-`static_string_EXPRESSION` in the object file, that is to say no space
-is reserved for `LOCAL_NAME` by the assembler and it will be resolved
-to the same address as `static_string_EXPRESSION` by the linker.
+given target. It is equivalent to ``__attribute__((alias))`` in GNU C
+and causes ``LOCAL_NAME`` to be emitted as an alias for the symbol
+``static_string_EXPRESSION`` in the object file, that is to say no space
+is reserved for ``LOCAL_NAME`` by the assembler and it will be resolved
+to the same address as ``static_string_EXPRESSION`` by the linker.
The actual linker name for the target must be used (e.g., the fully
encoded name with qualification in Ada, or the mangled name in C++),
-or it must be declared using the C convention with `pragma Import`
-or `pragma Export`.
+or it must be declared using the C convention with ``pragma Import``
+or ``pragma Export``.
Not all target machines support this pragma. On some of them it is accepted
-only if `pragma Weak_External` has been applied to `LOCAL_NAME`.
+only if ``pragma Weak_External`` has been applied to ``LOCAL_NAME``.
.. code-block:: ada
@@ -3264,11 +3332,11 @@ Syntax:
pragma Linker_Constructor (procedure_LOCAL_NAME);
-`procedure_LOCAL_NAME` must refer to a parameterless procedure that
+``procedure_LOCAL_NAME`` must refer to a parameterless procedure that
is declared at the library level. A procedure to which this pragma is
applied will be treated as an initialization routine by the linker.
-It is equivalent to `__attribute__((constructor))` in GNU C and
-causes `procedure_LOCAL_NAME` to be invoked before the entry point
+It is equivalent to ``__attribute__((constructor))`` in GNU C and
+causes ``procedure_LOCAL_NAME`` to be invoked before the entry point
of the executable is called (or immediately after the shared library is
loaded if the procedure is linked in a shared library), in particular
before the Ada run-time environment is set up.
@@ -3294,16 +3362,16 @@ Syntax:
pragma Linker_Destructor (procedure_LOCAL_NAME);
-`procedure_LOCAL_NAME` must refer to a parameterless procedure that
+``procedure_LOCAL_NAME`` must refer to a parameterless procedure that
is declared at the library level. A procedure to which this pragma is
applied will be treated as a finalization routine by the linker.
-It is equivalent to `__attribute__((destructor))` in GNU C and
-causes `procedure_LOCAL_NAME` to be invoked after the entry point
+It is equivalent to ``__attribute__((destructor))`` in GNU C and
+causes ``procedure_LOCAL_NAME`` to be invoked after the entry point
of the executable has exited (or immediately before the shared library
is unloaded if the procedure is linked in a shared library), in particular
after the Ada run-time environment is shut down.
-See `pragma Linker_Constructor` for the set of restrictions that apply
+See ``pragma Linker_Constructor`` for the set of restrictions that apply
because of these specific contexts.
.. _Pragma-Linker_Section:
@@ -3321,18 +3389,18 @@ Syntax:
[Section =>] static_string_EXPRESSION);
-`LOCAL_NAME` must refer to an object, type, or subprogram that is
+``LOCAL_NAME`` must refer to an object, type, or subprogram that is
declared at the library level. This pragma specifies the name of the
linker section for the given entity. It is equivalent to
-`__attribute__((section))` in GNU C and causes `LOCAL_NAME` to
-be placed in the `static_string_EXPRESSION` section of the
+``__attribute__((section))`` in GNU C and causes ``LOCAL_NAME`` to
+be placed in the ``static_string_EXPRESSION`` section of the
executable (assuming the linker doesn't rename the section).
GNAT also provides an implementation defined aspect of the same name.
In the case of specifying this aspect for a type, the effect is to
-specify the corresponding for all library level objects of the type which
-do not have an explicit linker section set. Note that this only applies to
-whole objects, not to components of composite objects.
+specify the corresponding section for all library-level objects of
+the type that do not have an explicit linker section set. Note that
+this only applies to whole objects, not to components of composite objects.
In the case of a subprogram, the linker section applies to all previously
declared matching overloaded subprograms in the current declarative part
@@ -3348,8 +3416,8 @@ linker section is specified should has the default linker section.
The compiler normally places library-level entities in standard sections
depending on the class: procedures and functions generally go in the
-`.text` section, initialized variables in the `.data` section
-and uninitialized variables in the `.bss` section.
+``.text`` section, initialized variables in the ``.data`` section
+and uninitialized variables in the ``.bss`` section.
Other, special sections may exist on given target machines to map special
hardware, for example I/O ports or flash memory. This pragma is a means to
@@ -3359,8 +3427,8 @@ at the symbolic level with the compiler.
Some file formats do not support arbitrary sections so not all target
machines support this pragma. The use of this pragma may cause a program
execution to be erroneous if it is used to place an entity into an
-inappropriate section (e.g., a modified variable into the `.text`
-section). See also `pragma Persistent_BSS`.
+inappropriate section (e.g., a modified variable into the ``.text``
+section). See also ``pragma Persistent_BSS``.
.. code-block:: ada
@@ -3405,12 +3473,12 @@ Syntax:
pragma Loop_Invariant ( boolean_EXPRESSION );
-The effect of this pragma is similar to that of pragma `Assert`,
-except that in an `Assertion_Policy` pragma, the identifier
-`Loop_Invariant` is used to control whether it is ignored or checked
+The effect of this pragma is similar to that of pragma ``Assert``,
+except that in an ``Assertion_Policy`` pragma, the identifier
+``Loop_Invariant`` is used to control whether it is ignored or checked
(or disabled).
-`Loop_Invariant` can only appear as one of the items in the sequence
+``Loop_Invariant`` can only appear as one of the items in the sequence
of statements of a loop body, or nested inside block statements that
appear in the sequence of statements of a loop body.
The intention is that it be used to
@@ -3418,14 +3486,14 @@ represent a "loop invariant" assertion, i.e. something that is true each
time through the loop, and which can be used to show that the loop is
achieving its purpose.
-Multiple `Loop_Invariant` and `Loop_Variant` pragmas that
+Multiple ``Loop_Invariant`` and ``Loop_Variant`` pragmas that
apply to the same loop should be grouped in the same sequence of
statements.
-To aid in writing such invariants, the special attribute `Loop_Entry`
+To aid in writing such invariants, the special attribute ``Loop_Entry``
may be used to refer to the value of an expression on entry to the loop. This
-attribute can only be used within the expression of a `Loop_Invariant`
-pragma. For full details, see documentation of attribute `Loop_Entry`.
+attribute can only be used within the expression of a ``Loop_Invariant``
+pragma. For full details, see documentation of attribute ``Loop_Entry``.
Pragma Loop_Optimize
====================
@@ -3494,7 +3562,7 @@ Syntax:
CHANGE_DIRECTION ::= Increases | Decreases
-`Loop_Variant` can only appear as one of the items in the sequence
+``Loop_Variant`` can only appear as one of the items in the sequence
of statements of a loop body, or nested inside block statements that
appear in the sequence of statements of a loop body.
It allows the specification of quantities which must always
@@ -3511,23 +3579,23 @@ in a nesting lexicographic manner. For example:
specifies that each time through the loop either X increases, or X stays
-the same and Y decreases. A `Loop_Variant` pragma ensures that the
+the same and Y decreases. A ``Loop_Variant`` pragma ensures that the
loop is making progress. It can be useful in helping to show informally
or prove formally that the loop always terminates.
-`Loop_Variant` is an assertion whose effect can be controlled using
-an `Assertion_Policy` with a check name of `Loop_Variant`. The
-policy can be `Check` to enable the loop variant check, `Ignore`
+``Loop_Variant`` is an assertion whose effect can be controlled using
+an ``Assertion_Policy`` with a check name of ``Loop_Variant``. The
+policy can be ``Check`` to enable the loop variant check, ``Ignore``
to ignore the check (in which case the pragma has no effect on the program),
-or `Disable` in which case the pragma is not even checked for correct
+or ``Disable`` in which case the pragma is not even checked for correct
syntax.
-Multiple `Loop_Invariant` and `Loop_Variant` pragmas that
+Multiple ``Loop_Invariant`` and ``Loop_Variant`` pragmas that
apply to the same loop should be grouped in the same sequence of
statements.
-The `Loop_Entry` attribute may be used within the expressions of the
-`Loop_Variant` pragma to refer to values on entry to the loop.
+The ``Loop_Entry`` attribute may be used within the expressions of the
+``Loop_Variant`` pragma to refer to values on entry to the loop.
Pragma Machine_Attribute
========================
@@ -3545,11 +3613,11 @@ Syntax:
Machine-dependent attributes can be specified for types and/or
declarations. This pragma is semantically equivalent to
-`__attribute__((`attribute_name`))` (if `info` is not
-specified) or `__attribute__((`attribute_name`(`info`)))
-in GNU C, where ``attribute_name`` is recognized by the
-compiler middle-end or the `TARGET_ATTRIBUTE_TABLE` machine
-specific macro. A string literal for the optional parameter `info`
+:samp:`__attribute__(({attribute_name}))` (if ``info`` is not
+specified) or :samp:`__attribute__(({attribute_name(info})))`
+in GNU C, where *attribute_name* is recognized by the
+compiler middle-end or the ``TARGET_ATTRIBUTE_TABLE`` machine
+specific macro. A string literal for the optional parameter ``info``
is transformed into an identifier, which may make this pragma unusable
for some attributes.
For further information see :title:`GNU Compiler Collection (GCC) Internals`.
@@ -3587,6 +3655,8 @@ Syntax::
This pragma is provided for compatibility with OpenVMS VAX Systems. It has
no effect in GNAT, other than being syntax checked.
+.. _Pragma-Max_Queue_Length:
+
Pragma Max_Queue_Length
=======================
@@ -3623,6 +3693,25 @@ such a way that a body needed before is no longer needed. The provision of a
dummy body with a No_Body pragma ensures that there is no interference from
earlier versions of the package body.
+Pragma No_Component_Reordering
+==============================
+
+Syntax:
+
+
+::
+
+ pragma No_Component_Reordering [([Entity =>] type_LOCAL_NAME)];
+
+
+``type_LOCAL_NAME`` must refer to a record type declaration in the current
+declarative part. The effect is to preclude any reordering of components
+for the layout of the record, i.e. the record is laid out by the compiler
+in the order in which the components are declared textually. The form with
+no argument is a configuration pragma which applies to all record types
+declared in units to which the pragma applies and there is a requirement
+that this pragma be used consistently within a partition.
+
.. _Pragma-No_Elaboration_Code_All:
Pragma No_Elaboration_Code_All
@@ -3637,7 +3726,7 @@ Syntax:
This is a program unit pragma (there is also an equivalent aspect of the
-same name) that establishes the restriction `No_Elaboration_Code` for
+same name) that establishes the restriction ``No_Elaboration_Code`` for
the current unit and any extended main source units (body and subunits).
It also has the effect of enforcing a transitive application of this
aspect, so that if any unit is implicitly or explicitly with'ed by the
@@ -3655,27 +3744,29 @@ Syntax:
pragma No_Heap_Finalization [ (first_subtype_LOCAL_NAME) ];
-Pragma `No_Heap_Finalization` may be used as a configuration pragma or as a
+Pragma ``No_Heap_Finalization`` may be used as a configuration pragma or as a
type-specific pragma.
In its configuration form, the pragma must appear within a configuration file
such as gnat.adc, without an argument. The pragma suppresses the call to
-`Finalize` for heap-allocated objects created through library-level named
+``Finalize`` for heap-allocated objects created through library-level named
access-to-object types in cases where the designated type requires finalization
actions.
In its type-specific form, the argument of the pragma must denote a
library-level named access-to-object type. The pragma suppresses the call to
-`Finalize` for heap-allocated objects created through the specific access type
+``Finalize`` for heap-allocated objects created through the specific access type
in cases where the designated type requires finalization actions.
It is still possible to finalize such heap-allocated objects by explicitly
deallocating them.
A library-level named access-to-object type declared within a generic unit will
-lose its `No_Heap_Finalization` pragma when the corresponding instance does not
+lose its ``No_Heap_Finalization`` pragma when the corresponding instance does not
appear at the library level.
+.. _Pragma-No_Inline:
+
Pragma No_Inline
================
@@ -3688,11 +3779,11 @@ Syntax:
This pragma suppresses inlining for the callable entity or the instances of
-the generic subprogram designated by `NAME`, including inlining that
-results from the use of pragma `Inline`. This pragma is always active,
+the generic subprogram designated by ``NAME``, including inlining that
+results from the use of pragma ``Inline``. This pragma is always active,
in particular it is not subject to the use of option *-gnatn* or
-*-gnatN*. It is illegal to specify both pragma `No_Inline` and
-pragma `Inline_Always` for the same `NAME`.
+*-gnatN*. It is illegal to specify both pragma ``No_Inline`` and
+pragma ``Inline_Always`` for the same ``NAME``.
Pragma No_Return
================
@@ -3705,9 +3796,9 @@ Syntax:
pragma No_Return (procedure_LOCAL_NAME {, procedure_LOCAL_NAME});
-Each `procedure_LOCAL_NAME` argument must refer to one or more procedure
+Each ``procedure_LOCAL_NAME`` argument must refer to one or more procedure
declarations in the current declarative part. A procedure to which this
-pragma is applied may not contain any explicit `return` statements.
+pragma is applied may not contain any explicit ``return`` statements.
In addition, if the procedure contains any implicit returns from falling
off the end of a statement sequence, then execution of that implicit
return will cause Program_Error to be raised.
@@ -3735,7 +3826,7 @@ Syntax:
This is an obsolete configuration pragma that historically was used to
set up a runtime library with no object code. It is now used only for
internal testing. The pragma has been superseded by the reconfigurable
-runtime capability of `GNAT`.
+runtime capability of GNAT.
Pragma No_Strict_Aliasing
=========================
@@ -3748,7 +3839,7 @@ Syntax:
pragma No_Strict_Aliasing [([Entity =>] type_LOCAL_NAME)];
-`type_LOCAL_NAME` must refer to an access type
+``type_LOCAL_NAME`` must refer to an access type
declaration in the current declarative part. The effect is to inhibit
strict aliasing optimization for the given type. The form with no
arguments is a configuration pragma which applies to all access types
@@ -3769,7 +3860,6 @@ Syntax:
::
- pragma No_Tagged_Streams;
pragma No_Tagged_Streams [([Entity =>] tagged_type_LOCAL_NAME)];
@@ -3780,7 +3870,7 @@ or derived types). This can involve the generation of significant amounts
of code which is wasted space if stream routines are not needed for the
type in question.
-The `No_Tagged_Streams` pragma causes the generation of these stream
+The ``No_Tagged_Streams`` pragma causes the generation of these stream
routines to be skipped, and any attempt to use stream operations on
types subject to this pragma will be statically rejected as illegal.
@@ -3871,7 +3961,7 @@ are as follows:
*Enumeration types*
Objects of an enumeration type are initialized to all one-bits, i.e., to
- the value `2 ** typ'Size - 1` unless the subtype excludes the literal
+ the value ``2 ** typ'Size - 1`` unless the subtype excludes the literal
whose Pos value is zero, in which case a code of zero is used. This choice
will always generate an invalid value if one exists.
@@ -3914,25 +4004,25 @@ removed later.
The effect of this pragma is to output a warning message on a reference to
an entity thus marked that the subprogram is obsolescent if the appropriate
-warning option in the compiler is activated. If the Message parameter is
+warning option in the compiler is activated. If the ``Message`` parameter is
present, then a second warning message is given containing this text. In
addition, a reference to the entity is considered to be a violation of pragma
-Restrictions (No_Obsolescent_Features).
+``Restrictions (No_Obsolescent_Features)``.
This pragma can also be used as a program unit pragma for a package,
in which case the entity name is the name of the package, and the
pragma indicates that the entire package is considered
-obsolescent. In this case a client `with`'ing such a package
-violates the restriction, and the `with` statement is
+obsolescent. In this case a client ``with``\ ing such a package
+violates the restriction, and the ``with`` clause is
flagged with warnings if the warning option is set.
-If the Version parameter is present (which must be exactly
-the identifier Ada_05, no other argument is allowed), then the
+If the ``Version`` parameter is present (which must be exactly
+the identifier ``Ada_05``, no other argument is allowed), then the
indication of obsolescence applies only when compiling in Ada 2005
mode. This is primarily intended for dealing with the situations
in the predefined library where subprograms or packages
have become defined as obsolescent in Ada 2005
-(e.g., in Ada.Characters.Handling), but may be used anywhere.
+(e.g., in ``Ada.Characters.Handling``), but may be used anywhere.
The following examples show typical uses of this pragma:
@@ -3972,8 +4062,8 @@ The following examples show typical uses of this pragma:
Note that, as for all pragmas, if you use a pragma argument identifier,
then all subsequent parameters must also use a pragma argument identifier.
-So if you specify "Entity =>" for the Entity argument, and a Message
-argument is present, it must be preceded by "Message =>".
+So if you specify ``Entity =>`` for the ``Entity`` argument, and a ``Message``
+argument is present, it must be preceded by ``Message =>``.
Pragma Optimize_Alignment
=========================
@@ -4018,7 +4108,7 @@ Integer field X are efficient. But this means that objects of the type end up
with a size of 8 bytes. This is a valid choice, since sizes of objects are
allowed to be bigger than the size of the type, but it can waste space if for
example fields of type R appear in an enclosing record. If the above type is
-compiled in `Optimize_Alignment (Space)` mode, the alignment is set to 1.
+compiled in ``Optimize_Alignment (Space)`` mode, the alignment is set to 1.
However, there is one case in which SPACE is ignored. If a variable length
record (that is a discriminated record with a component which is an array
@@ -4047,7 +4137,7 @@ small types with sizes that are not a power of 2. For example, consider:
The default alignment for this record is normally 1, but if this type is
-compiled in `Optimize_Alignment (Time)` mode, then the alignment is set
+compiled in ``Optimize_Alignment (Time)`` mode, then the alignment is set
to 4, which wastes space for objects of the type, since they are now 4 bytes
long, but results in more efficient access when the whole record is referenced.
@@ -4080,7 +4170,7 @@ For example, consider:
type Color is (Red, Blue, Green, Yellow);
-By Ada semantics `Blue > Red` and `Green > Blue`,
+By Ada semantics ``Blue > Red`` and ``Green > Blue``,
but really these relations make no sense; the enumeration type merely
specifies a set of possible colors, and the order is unimportant.
@@ -4103,7 +4193,7 @@ entries have to be added to the enumeration type. Instead,
the code in the client should list the possibilities, or an
appropriate subtype should be declared in the unit that declares
the original enumeration type. E.g., the following subtype could
-be declared along with the type `Color`:
+be declared along with the type ``Color``:
.. code-block:: ada
@@ -4145,16 +4235,16 @@ on the ordering. GNAT provides a pragma to mark enumerations as ordered
rather than one to mark them as unordered, since in our experience,
the great majority of enumeration types are conceptually unordered.
-The types `Boolean`, `Character`, `Wide_Character`,
-and `Wide_Wide_Character`
+The types ``Boolean``, ``Character``, ``Wide_Character``,
+and ``Wide_Wide_Character``
are considered to be ordered types, so each is declared with a
-pragma `Ordered` in package `Standard`.
+pragma ``Ordered`` in package ``Standard``.
-Normally pragma `Ordered` serves only as documentation and a guide for
+Normally pragma ``Ordered`` serves only as documentation and a guide for
coding standards, but GNAT provides a warning switch *-gnatw.u* that
requests warnings for inappropriate uses (comparisons and explicit
subranges) for unordered types. If this switch is used, then any
-enumeration type not marked with pragma `Ordered` will be considered
+enumeration type not marked with pragma ``Ordered`` will be considered
as unordered, and will generate warnings for inappropriate uses.
Note that generic types are not considered ordered or unordered (since the
@@ -4182,25 +4272,25 @@ Syntax:
This pragma sets the current overflow mode to the given setting. For details
of the meaning of these modes, please refer to the
'Overflow Check Handling in GNAT' appendix in the
-GNAT User's Guide. If only the `General` parameter is present,
+GNAT User's Guide. If only the ``General`` parameter is present,
the given mode applies to all expressions. If both parameters are present,
-the `General` mode applies to expressions outside assertions, and
-the `Eliminated` mode applies to expressions within assertions.
+the ``General`` mode applies to expressions outside assertions, and
+the ``Eliminated`` mode applies to expressions within assertions.
-The case of the `MODE` parameter is ignored,
-so `MINIMIZED`, `Minimized` and
-`minimized` all have the same effect.
+The case of the ``MODE`` parameter is ignored,
+so ``MINIMIZED``, ``Minimized`` and
+``minimized`` all have the same effect.
-The `Overflow_Mode` pragma has the same scoping and placement
-rules as pragma `Suppress`, so it can occur either as a
+The ``Overflow_Mode`` pragma has the same scoping and placement
+rules as pragma ``Suppress``, so it can occur either as a
configuration pragma, specifying a default for the whole
program, or in a declarative scope, where it applies to the
remaining declarations and statements in that scope.
-The pragma `Suppress (Overflow_Check)` suppresses
+The pragma ``Suppress (Overflow_Check)`` suppresses
overflow checking, but does not affect the overflow mode.
-The pragma `Unsuppress (Overflow_Check)` unsuppresses (enables)
+The pragma ``Unsuppress (Overflow_Check)`` unsuppresses (enables)
overflow checking, but does not affect the overflow mode.
Pragma Overriding_Renamings
@@ -4269,7 +4359,7 @@ Syntax:
ABSTRACT_STATE ::= NAME
-For the semantics of this pragma, see the entry for aspect `Part_Of` in the
+For the semantics of this pragma, see the entry for aspect ``Part_Of`` in the
SPARK 2014 Reference Manual, section 7.2.6.
Pragma Passive
@@ -4286,10 +4376,10 @@ Syntax:
Syntax checked, but otherwise ignored by GNAT. This is recognized for
compatibility with DEC Ada 83 implementations, where it is used within a
task definition to request that a task be made passive. If the argument
-`Semaphore` is present, or the argument is omitted, then DEC Ada 83
+``Semaphore`` is present, or the argument is omitted, then DEC Ada 83
treats the pragma as an assertion that the containing task is passive
and that optimization of context switch with this task is permitted and
-desired. If the argument `No` is present, the task must not be
+desired. If the argument ``No`` is present, the task must not be
optimized. GNAT does not attempt to optimize any tasks in this manner
(since protected objects are available in place of passive tasks).
@@ -4309,15 +4399,15 @@ Syntax:
pragma Persistent_BSS [(LOCAL_NAME)]
-This pragma allows selected objects to be placed in the `.persistent_bss`
+This pragma allows selected objects to be placed in the ``.persistent_bss``
section. On some targets the linker and loader provide for special
treatment of this section, allowing a program to be reloaded without
affecting the contents of this data (hence the name persistent).
There are two forms of usage. If an argument is given, it must be the
-local name of a library level object, with no explicit initialization
+local name of a library-level object, with no explicit initialization
and whose type is potentially persistent. If no argument is given, then
-the pragma is a configuration pragma, and applies to all library level
+the pragma is a configuration pragma, and applies to all library-level
objects with no explicit initialization of potentially persistent types.
A potentially persistent type is a scalar type, or an untagged,
@@ -4327,7 +4417,7 @@ or an array, all of whose constraints are static, and whose component
type is potentially persistent.
If this pragma is used on a target where this feature is not supported,
-then the pragma will be ignored. See also `pragma Linker_Section`.
+then the pragma will be ignored. See also ``pragma Linker_Section``.
Pragma Polling
==============
@@ -4341,31 +4431,31 @@ Syntax:
This pragma controls the generation of polling code. This is normally off.
-If `pragma Polling (ON)` is used then periodic calls are generated to
-the routine `Ada.Exceptions.Poll`. This routine is a separate unit in the
+If ``pragma Polling (ON)`` is used then periodic calls are generated to
+the routine ``Ada.Exceptions.Poll``. This routine is a separate unit in the
runtime library, and can be found in file :file:`a-excpol.adb`.
-Pragma `Polling` can appear as a configuration pragma (for example it
+Pragma ``Polling`` can appear as a configuration pragma (for example it
can be placed in the :file:`gnat.adc` file) to enable polling globally, or it
can be used in the statement or declaration sequence to control polling
more locally.
A call to the polling routine is generated at the start of every loop and
-at the start of every subprogram call. This guarantees that the `Poll`
+at the start of every subprogram call. This guarantees that the ``Poll``
routine is called frequently, and places an upper bound (determined by
-the complexity of the code) on the period between two `Poll` calls.
+the complexity of the code) on the period between two ``Poll`` calls.
The primary purpose of the polling interface is to enable asynchronous
aborts on targets that cannot otherwise support it (for example Windows
NT), but it may be used for any other purpose requiring periodic polling.
The standard version is null, and can be replaced by a user program. This
-will require re-compilation of the `Ada.Exceptions` package that can
+will require re-compilation of the ``Ada.Exceptions`` package that can
be found in files :file:`a-except.ads` and :file:`a-except.adb`.
A standard alternative unit (in file :file:`4wexcpol.adb` in the standard GNAT
distribution) is used to enable the asynchronous abort capability on
targets that do not normally support the capability. The version of
-`Poll` in this file makes a call to the appropriate runtime routine
+``Poll`` in this file makes a call to the appropriate runtime routine
to test for an abort condition.
Note that polling can also be enabled by use of the *-gnatP* switch.
@@ -4386,9 +4476,9 @@ Syntax:
pragma Post (Boolean_Expression);
-The `Post` pragma is intended to be an exact replacement for
+The ``Post`` pragma is intended to be an exact replacement for
the language-defined
-`Post` aspect, and shares its restrictions and semantics.
+``Post`` aspect, and shares its restrictions and semantics.
It must appear either immediately following the corresponding
subprogram declaration (only other pragmas may intervene), or
if there is no separate subprogram declaration, then it can
@@ -4412,7 +4502,7 @@ Syntax:
[,[Message =>] String_Expression]);
-The `Postcondition` pragma allows specification of automatic
+The ``Postcondition`` pragma allows specification of automatic
postcondition checks for subprograms. These checks are similar to
assertions, but are automatically inserted just prior to the return
statements of the subprogram with which they are associated (including
@@ -4423,7 +4513,7 @@ In addition, the boolean expression which is the condition which
must be true may contain references to function'Result in the case
of a function to refer to the returned value.
-`Postcondition` pragmas may appear either immediately following the
+``Postcondition`` pragmas may appear either immediately following the
(separate) declaration of a subprogram, or at the start of the
declarations of a subprogram body. Only other pragmas may intervene
(that is appear between the subprogram declaration and its
@@ -4437,8 +4527,8 @@ The postconditions are collected and automatically tested just
before any return (implicit or explicit) in the subprogram body.
A postcondition is only recognized if postconditions are active
at the time the pragma is encountered. The compiler switch *gnata*
-turns on all postconditions by default, and pragma `Check_Policy`
-with an identifier of `Postcondition` can also be used to
+turns on all postconditions by default, and pragma ``Check_Policy``
+with an identifier of ``Postcondition`` can also be used to
control whether postconditions are active.
The general approach is that postconditions are placed in the spec
@@ -4478,7 +4568,7 @@ might have the following postcondition:
end Sqrt
-As this example, shows, the use of the `Old` attribute
+As this example, shows, the use of the ``Old`` attribute
is often useful in postconditions to refer to the state on
entry to the subprogram.
@@ -4487,7 +4577,7 @@ from the subprogram. If an abnormal return results from
raising an exception, then the postconditions are not checked.
If a postcondition fails, then the exception
-`System.Assertions.Assert_Failure` is raised. If
+``System.Assertions.Assert_Failure`` is raised. If
a message argument was supplied, then the given string
will be used as the exception message. If no message
argument was supplied, then the default message has
@@ -4529,7 +4619,7 @@ mutually recursive postconditions as in:
There are no restrictions on the complexity or form of
-conditions used within `Postcondition` pragmas.
+conditions used within ``Postcondition`` pragmas.
The following example shows that it is even possible
to verify performance behavior.
@@ -4558,12 +4648,12 @@ inlining (-gnatN option set) are accepted and legality-checked
by the compiler, but are ignored at run-time even if postcondition
checking is enabled.
-Note that pragma `Postcondition` differs from the language-defined
-`Post` aspect (and corresponding `Post` pragma) in allowing
+Note that pragma ``Postcondition`` differs from the language-defined
+``Post`` aspect (and corresponding ``Post`` pragma) in allowing
multiple occurrences, allowing occurences in the body even if there
is a separate spec, and allowing a second string parameter, and the
-use of the pragma identifier `Check`. Historically, pragma
-`Postcondition` was implemented prior to the development of
+use of the pragma identifier ``Check``. Historically, pragma
+``Postcondition`` was implemented prior to the development of
Ada 2012, and has been retained in its original form for
compatibility purposes.
@@ -4582,24 +4672,24 @@ Syntax:
pragma Post_Class (Boolean_Expression);
-The `Post_Class` pragma is intended to be an exact replacement for
+The ``Post_Class`` pragma is intended to be an exact replacement for
the language-defined
-`Post'Class` aspect, and shares its restrictions and semantics.
+``Post'Class`` aspect, and shares its restrictions and semantics.
It must appear either immediately following the corresponding
subprogram declaration (only other pragmas may intervene), or
if there is no separate subprogram declaration, then it can
appear at the start of the declarations in a subprogram body
(preceded only by other pragmas).
-Note: This pragma is called `Post_Class` rather than
-`Post'Class` because the latter would not be strictly
+Note: This pragma is called ``Post_Class`` rather than
+``Post'Class`` because the latter would not be strictly
conforming to the allowed syntax for pragmas. The motivation
for provinding pragmas equivalent to the aspects is to allow a program
to be written using the pragmas, and then compiled if necessary
using an Ada compiler that does not recognize the pragmas or
aspects, but is prepared to ignore the pragmas. The assertion
-policy that controls this pragma is `Post'Class`, not
-`Post_Class`.
+policy that controls this pragma is ``Post'Class``, not
+``Post_Class``.
Pragma Rename_Pragma
============================
@@ -4615,7 +4705,7 @@ Syntax:
[Renamed =>] pragma_IDENTIFIER);
This pragma provides a mechanism for supplying new names for existing
-pragmas. The `New_Name` identifier can subsequently be used as a synonym for
+pragmas. The ``New_Name`` identifier can subsequently be used as a synonym for
the Renamed pragma. For example, suppose you have code that was originally
developed on a compiler that supports Inline_Only as an implementation defined
pragma. And suppose the semantics of pragma Inline_Only are identical to (or at
@@ -4653,9 +4743,9 @@ Syntax:
pragma Pre (Boolean_Expression);
-The `Pre` pragma is intended to be an exact replacement for
+The ``Pre`` pragma is intended to be an exact replacement for
the language-defined
-`Pre` aspect, and shares its restrictions and semantics.
+``Pre`` aspect, and shares its restrictions and semantics.
It must appear either immediately following the corresponding
subprogram declaration (only other pragmas may intervene), or
if there is no separate subprogram declaration, then it can
@@ -4679,7 +4769,7 @@ Syntax:
[,[Message =>] String_Expression]);
-The `Precondition` pragma is similar to `Postcondition`
+The ``Precondition`` pragma is similar to ``Postcondition``
except that the corresponding checks take place immediately upon
entry to the subprogram, and if a precondition fails, the exception
is raised in the context of the caller, and the attribute 'Result
@@ -4700,7 +4790,7 @@ within a package spec:
end Math_Functions;
-`Precondition` pragmas may appear either immediately following the
+``Precondition`` pragmas may appear either immediately following the
(separate) declaration of a subprogram, or at the start of the
declarations of a subprogram body. Only other pragmas may intervene
(that is appear between the subprogram declaration and its
@@ -4713,12 +4803,12 @@ inlining (-gnatN option set) are accepted and legality-checked
by the compiler, but are ignored at run-time even if precondition
checking is enabled.
-Note that pragma `Precondition` differs from the language-defined
-`Pre` aspect (and corresponding `Pre` pragma) in allowing
+Note that pragma ``Precondition`` differs from the language-defined
+``Pre`` aspect (and corresponding ``Pre`` pragma) in allowing
multiple occurrences, allowing occurences in the body even if there
is a separate spec, and allowing a second string parameter, and the
-use of the pragma identifier `Check`. Historically, pragma
-`Precondition` was implemented prior to the development of
+use of the pragma identifier ``Check``. Historically, pragma
+``Precondition`` was implemented prior to the development of
Ada 2012, and has been retained in its original form for
compatibility purposes.
@@ -4738,10 +4828,10 @@ Syntax:
This pragma (available in all versions of Ada in GNAT) encompasses both
-the `Static_Predicate` and `Dynamic_Predicate` aspects in
+the ``Static_Predicate`` and ``Dynamic_Predicate`` aspects in
Ada 2012. A predicate is regarded as static if it has an allowed form
-for `Static_Predicate` and is otherwise treated as a
-`Dynamic_Predicate`. Otherwise, predicates specified by this
+for ``Static_Predicate`` and is otherwise treated as a
+``Dynamic_Predicate``. Otherwise, predicates specified by this
pragma behave exactly as described in the Ada 2012 reference manual.
For example, if we have
@@ -4767,8 +4857,8 @@ the effect is identical to the following Ada 2012 code:
Dynamic_Predicate => F(Q) or G(Q);
-Note that there are no pragmas `Dynamic_Predicate`
-or `Static_Predicate`. That is
+Note that there are no pragmas ``Dynamic_Predicate``
+or ``Static_Predicate``. That is
because these pragmas would affect legality and semantics of
the program and thus do not have a neutral effect if ignored.
The motivation behind providing pragmas equivalent to
@@ -4778,7 +4868,7 @@ will ignore the pragmas. That doesn't work in the case of
static and dynamic predicates, since if the corresponding
pragmas are ignored, then the behavior of the program is
fundamentally changed (for example a membership test
-`A in B` would not take into account a predicate
+``A in B`` would not take into account a predicate
defined for subtype B). When following this approach, the
use of predicates should be avoided.
@@ -4795,9 +4885,9 @@ Syntax:
[Message =>] String_Expression);
-The `Predicate_Failure` pragma is intended to be an exact replacement for
+The ``Predicate_Failure`` pragma is intended to be an exact replacement for
the language-defined
-`Predicate_Failure` aspect, and shares its restrictions and semantics.
+``Predicate_Failure`` aspect, and shares its restrictions and semantics.
Pragma Preelaborable_Initialization
===================================
@@ -4843,7 +4933,7 @@ The pragma has no effect if the message is computed with an expression other
than a static string constant, since the assumption in this case is that
the program computes exactly the string it wants. If you still want the
prefixing in this case, you can always call
-`GNAT.Source_Info.Enclosing_Entity` and prepend the string manually.
+``GNAT.Source_Info.Enclosing_Entity`` and prepend the string manually.
Pragma Pre_Class
================
@@ -4860,24 +4950,24 @@ Syntax:
pragma Pre_Class (Boolean_Expression);
-The `Pre_Class` pragma is intended to be an exact replacement for
+The ``Pre_Class`` pragma is intended to be an exact replacement for
the language-defined
-`Pre'Class` aspect, and shares its restrictions and semantics.
+``Pre'Class`` aspect, and shares its restrictions and semantics.
It must appear either immediately following the corresponding
subprogram declaration (only other pragmas may intervene), or
if there is no separate subprogram declaration, then it can
appear at the start of the declarations in a subprogram body
(preceded only by other pragmas).
-Note: This pragma is called `Pre_Class` rather than
-`Pre'Class` because the latter would not be strictly
+Note: This pragma is called ``Pre_Class`` rather than
+``Pre'Class`` because the latter would not be strictly
conforming to the allowed syntax for pragmas. The motivation
for providing pragmas equivalent to the aspects is to allow a program
to be written using the pragmas, and then compiled if necessary
using an Ada compiler that does not recognize the pragmas or
aspects, but is prepared to ignore the pragmas. The assertion
-policy that controls this pragma is `Pre'Class`, not
-`Pre_Class`.
+policy that controls this pragma is ``Pre'Class``, not
+``Pre_Class``.
Pragma Priority_Specific_Dispatching
====================================
@@ -4918,16 +5008,16 @@ Syntax:
This pragma is standard in Ada 2005, but is available in all earlier
versions of Ada as an implementation-defined pragma. This is a
configuration pragma that establishes a set of configuration pragmas
-that depend on the argument. `Ravenscar` is standard in Ada 2005.
-The other possibilities (`Restricted`, `Rational`,
-`GNAT_Extended_Ravenscar`, `GNAT_Ravenscar_EDF`)
+that depend on the argument. ``Ravenscar`` is standard in Ada 2005.
+The other possibilities (``Restricted``, ``Rational``,
+``GNAT_Extended_Ravenscar``, ``GNAT_Ravenscar_EDF``)
are implementation-defined. The set of configuration pragmas
is defined in the following sections.
* Pragma Profile (Ravenscar)
- The `Ravenscar` profile is standard in Ada 2005,
+ The ``Ravenscar`` profile is standard in Ada 2005,
but is available in all earlier
versions of Ada as an implementation-defined pragma. This profile
establishes the following set of configuration pragmas:
@@ -5103,9 +5193,9 @@ Syntax:
This is an implementation-defined pragma that is similar in
-effect to `pragma Profile` except that instead of
-generating `Restrictions` pragmas, it generates
-`Restriction_Warnings` pragmas. The result is that
+effect to ``pragma Profile`` except that instead of
+generating ``Restrictions`` pragmas, it generates
+``Restriction_Warnings`` pragmas. The result is that
violations of the profile generate warning messages instead
of error messages.
@@ -5166,7 +5256,7 @@ Syntax:
| static_string_EXPRESSION
-This pragma is identical in effect to pragma `Common_Object`.
+This pragma is identical in effect to pragma ``Common_Object``.
.. _Pragma-Pure_Function:
@@ -5184,7 +5274,7 @@ Syntax:
This pragma appears in the same declarative part as a function
declaration (or a set of function declarations if more than one
overloaded declaration exists, in which case the pragma applies
-to all entities). It specifies that the function `Entity` is
+to all entities). It specifies that the function ``Entity`` is
to be considered pure for the purposes of code generation. This means
that the compiler can assume that there are no side effects, and
in particular that two calls with identical arguments produce the
@@ -5192,7 +5282,7 @@ same result. It also means that the function can be used in an
address clause.
Note that, quite deliberately, there are no static checks to try
-to ensure that this promise is met, so `Pure_Function` can be used
+to ensure that this promise is met, so ``Pure_Function`` can be used
with functions that are conceptually pure, even if they do modify
global variables. For example, a square root function that is
instrumented to count the number of times it is called is still
@@ -5209,28 +5299,28 @@ the compiler may optimize away calls with identical arguments, and
if that results in unexpected behavior, the proper action is not to
use the pragma for subprograms that are not (conceptually) pure.
-Note: Most functions in a `Pure` package are automatically pure, and
-there is no need to use pragma `Pure_Function` for such functions. One
+Note: Most functions in a ``Pure`` package are automatically pure, and
+there is no need to use pragma ``Pure_Function`` for such functions. One
exception is any function that has at least one formal of type
-`System.Address` or a type derived from it. Such functions are not
+``System.Address`` or a type derived from it. Such functions are not
considered pure by default, since the compiler assumes that the
-`Address` parameter may be functioning as a pointer and that the
+``Address`` parameter may be functioning as a pointer and that the
referenced data may change even if the address value does not.
Similarly, imported functions are not considered to be pure by default,
since there is no way of checking that they are in fact pure. The use
-of pragma `Pure_Function` for such a function will override these default
+of pragma ``Pure_Function`` for such a function will override these default
assumption, and cause the compiler to treat a designated subprogram as pure
in these cases.
-Note: If pragma `Pure_Function` is applied to a renamed function, it
+Note: If pragma ``Pure_Function`` is applied to a renamed function, it
applies to the underlying renamed function. This can be used to
disambiguate cases of overloading where some but not all functions
in a set of overloaded functions are to be designated as pure.
-If pragma `Pure_Function` is applied to a library level function, the
+If pragma ``Pure_Function`` is applied to a library-level function, the
function is also considered pure from an optimization point of view, but the
unit is not a Pure unit in the categorization sense. So for example, a function
-thus marked is free to `with` non-pure units.
+thus marked is free to ``with`` non-pure units.
Pragma Rational
===============
@@ -5272,7 +5362,7 @@ compatibility purposes. It is equivalent to:
pragma Profile (Ravenscar);
-which is the preferred method of setting the `Ravenscar` profile.
+which is the preferred method of setting the ``Ravenscar`` profile.
.. _Pragma-Refined_Depends:
@@ -5304,7 +5394,7 @@ Syntax:
where FUNCTION_RESULT is a function Result attribute_reference
-For the semantics of this pragma, see the entry for aspect `Refined_Depends` in
+For the semantics of this pragma, see the entry for aspect ``Refined_Depends`` in
the SPARK 2014 Reference Manual, section 6.1.5.
.. _Pragma-Refined_Global:
@@ -5329,7 +5419,7 @@ Syntax:
GLOBAL_LIST ::= GLOBAL_ITEM | (GLOBAL_ITEM {, GLOBAL_ITEM})
GLOBAL_ITEM ::= NAME
-For the semantics of this pragma, see the entry for aspect `Refined_Global` in
+For the semantics of this pragma, see the entry for aspect ``Refined_Global`` in
the SPARK 2014 Reference Manual, section 6.1.4.
.. _Pragma-Refined_Post:
@@ -5343,7 +5433,7 @@ Syntax:
pragma Refined_Post (boolean_EXPRESSION);
-For the semantics of this pragma, see the entry for aspect `Refined_Post` in
+For the semantics of this pragma, see the entry for aspect ``Refined_Post`` in
the SPARK 2014 Reference Manual, section 7.2.7.
.. _Pragma-Refined_State:
@@ -5369,7 +5459,7 @@ Syntax:
CONSTITUENT ::= object_NAME | state_NAME
-For the semantics of this pragma, see the entry for aspect `Refined_State` in
+For the semantics of this pragma, see the entry for aspect ``Refined_State`` in
the SPARK 2014 Reference Manual, section 7.2.2.
Pragma Relative_Deadline
@@ -5405,7 +5495,7 @@ It specifies an exception to the RM rule from E.2.2(17/2), which forbids
the use of a remote access to class-wide type as actual for a formal
access type.
-When this pragma applies to a formal access type `Entity`, that
+When this pragma applies to a formal access type ``Entity``, that
type is treated as a remote access to class-wide type in the generic.
It must be a formal general access type, and its designated type must
be the class-wide type of a formal tagged limited private type from the
@@ -5452,7 +5542,7 @@ Syntax:
This pragma allows a series of restriction identifiers to be
specified (the list of allowed identifiers is the same as for
-pragma `Restrictions`). For each of these identifiers
+pragma ``Restrictions``). For each of these identifiers
the compiler checks for violations of the restriction, but
generates a warning message rather than an error message
if the restriction is violated.
@@ -5600,7 +5690,7 @@ Syntax:
pragma Secondary_Stack_Size (integer_EXPRESSION);
This pragma appears within the task definition of a single task declaration
-or a task type declaration (like pragma `Storage_Size`) and applies to all
+or a task type declaration (like pragma ``Storage_Size``) and applies to all
task objects of that type. The argument specifies the size of the secondary
stack to be used by these task objects, and must be of an integer type. The
secondary stack is used to handle functions that return a variable-sized
@@ -5610,18 +5700,18 @@ Note this pragma only applies to targets using fixed secondary stacks, like
VxWorks 653 and bare board targets, where a fixed block for the
secondary stack is allocated from the primary stack of the task. By default,
these targets assign a percentage of the primary stack for the secondary stack,
-as defined by `System.Parameter.Sec_Stack_Percentage`. With this pragma,
-an `integer_EXPRESSION` of bytes is assigned from the primary stack instead.
+as defined by ``System.Parameter.Sec_Stack_Percentage``. With this pragma,
+an ``integer_EXPRESSION`` of bytes is assigned from the primary stack instead.
For most targets, the pragma does not apply as the secondary stack grows on
demand: allocated as a chain of blocks in the heap. The default size of these
-blocks can be modified via the `-D` binder option as described in
+blocks can be modified via the :switch:`-D` binder option as described in
:title:`GNAT User's Guide`.
Note that no check is made to see if the secondary stack can fit inside the
primary stack.
-Note the pragma cannot appear when the restriction `No_Secondary_Stack`
+Note the pragma cannot appear when the restriction ``No_Secondary_Stack``
is in effect.
Pragma Share_Generic
@@ -5638,7 +5728,7 @@ Syntax:
This pragma is provided for compatibility with Dec Ada 83. It has
-no effect in `GNAT` (which does not implement shared generics), other
+no effect in GNAT (which does not implement shared generics), other
than to check that the given names are all names of generic units or
generic instances.
@@ -5700,14 +5790,14 @@ Syntax:
A type can be established as a 'simple storage pool type' by applying
-the representation pragma `Simple_Storage_Pool_Type` to the type.
+the representation pragma ``Simple_Storage_Pool_Type`` to the type.
A type named in the pragma must be a library-level immutably limited record
type or limited tagged type declared immediately within a package declaration.
The type can also be a limited private type whose full type is allowed as
a simple storage pool type.
-For a simple storage pool type `SSP`, nonabstract primitive subprograms
-`Allocate`, `Deallocate`, and `Storage_Size` can be declared that
+For a simple storage pool type ``SSP``, nonabstract primitive subprograms
+``Allocate``, ``Deallocate``, and ``Storage_Size`` can be declared that
are subtype conformant with the following subprogram declarations:
@@ -5729,11 +5819,11 @@ are subtype conformant with the following subprogram declarations:
return System.Storage_Elements.Storage_Count;
-Procedure `Allocate` must be declared, whereas `Deallocate` and
-`Storage_Size` are optional. If `Deallocate` is not declared, then
+Procedure ``Allocate`` must be declared, whereas ``Deallocate`` and
+``Storage_Size`` are optional. If ``Deallocate`` is not declared, then
applying an unchecked deallocation has no effect other than to set its actual
-parameter to null. If `Storage_Size` is not declared, then the
-`Storage_Size` attribute applied to an access type associated with
+parameter to null. If ``Storage_Size`` is not declared, then the
+``Storage_Size`` attribute applied to an access type associated with
a pool object of type SSP returns zero. Additional operations can be declared
for a simple storage pool type (such as for supporting a mark/release
storage-management discipline).
@@ -5781,12 +5871,12 @@ Use this to override the normal naming convention. It is a configuration
pragma, and so has the usual applicability of configuration pragmas
(i.e., it applies to either an entire partition, or to all units in a
compilation, or to a single unit, depending on how it is used.
-`unit_name` is mapped to `file_name_literal`. The identifier for
+``unit_name`` is mapped to ``file_name_literal``. The identifier for
the second argument is required, and indicates whether this is the file
name for the spec or for the body.
The optional Index argument should be used when a file contains multiple
-units, and when you do not want to use `gnatchop` to separate then
+units, and when you do not want to use ``gnatchop`` to separate then
into multiple files (which is the recommended procedure to limit the
number of recompilations that are needed when some sources change).
For instance, if the source file :file:`source.ada` contains
@@ -5816,10 +5906,10 @@ you could use the following configuration pragmas:
(A, Body_File_Name => "source.ada", Index => 2);
-Note that the `gnatname` utility can also be used to generate those
+Note that the ``gnatname`` utility can also be used to generate those
configuration pragmas.
-Another form of the `Source_File_Name` pragma allows
+Another form of the ``Source_File_Name`` pragma allows
the specification of patterns defining alternative file naming schemes
to apply to all files.
@@ -5859,8 +5949,8 @@ file naming is controlled by Source_File_Name_Project pragmas, which are
usually supplied automatically by the project manager. A pragma
Source_File_Name cannot appear after a :ref:`Pragma_Source_File_Name_Project`.
-For more details on the use of the `Source_File_Name` pragma, see the
-sections on `Using Other File Names` and `Alternative File Naming Schemes'
+For more details on the use of the ``Source_File_Name`` pragma, see the
+sections on ``Using Other File Names`` and `Alternative File Naming Schemes'
in the :title:`GNAT User's Guide`.
.. _Pragma_Source_File_Name_Project:
@@ -5893,11 +5983,11 @@ Syntax:
This pragma must appear as the first line of a source file.
-`integer_literal` is the logical line number of the line following
+``integer_literal`` is the logical line number of the line following
the pragma line (for use in error messages and debugging
-information). `string_literal` is a static string constant that
+information). ``string_literal`` is a static string constant that
specifies the file name to be used in error messages and debugging
-information. This is most notably used for the output of `gnatchop`
+information. This is most notably used for the output of ``gnatchop``
with the *-r* switch, to make sure that the original unchopped
source file is the one referred to.
@@ -5938,11 +6028,11 @@ be used in the following places:
Immediately within a library-level package body
*
- Immediately following the `private` keyword of a library-level
+ Immediately following the ``private`` keyword of a library-level
package spec
*
- Immediately following the `begin` keyword of a library-level
+ Immediately following the ``begin`` keyword of a library-level
package body
*
@@ -5954,11 +6044,11 @@ that is active at the point it is declared. But this can be overridden
by pragma within the spec or body as above.
The basic consistency rule is that you can't turn SPARK_Mode back
-`On`, once you have explicitly (with a pragma) turned if
-`Off`. So the following rules apply:
+``On``, once you have explicitly (with a pragma) turned if
+``Off``. So the following rules apply:
-If a subprogram spec has SPARK_Mode `Off`, then the body must
-also have SPARK_Mode `Off`.
+If a subprogram spec has SPARK_Mode ``Off``, then the body must
+also have SPARK_Mode ``Off``.
For a package, we have four parts:
@@ -5969,15 +6059,15 @@ For a package, we have four parts:
*
the body of the package
*
- the elaboration code after `begin`
+ the elaboration code after ``begin``
For a package, the rule is that if you explicitly turn SPARK_Mode
-`Off` for any part, then all the following parts must have
-SPARK_Mode `Off`. Note that this may require repeating a pragma
-SPARK_Mode (`Off`) in the body. For example, if we have a
-configuration pragma SPARK_Mode (`On`) that turns the mode on by
+``Off`` for any part, then all the following parts must have
+SPARK_Mode ``Off``. Note that this may require repeating a pragma
+SPARK_Mode (``Off``) in the body. For example, if we have a
+configuration pragma SPARK_Mode (``On``) that turns the mode on by
default everywhere, and one particular package spec has pragma
-SPARK_Mode (`Off`), then that pragma will need to be repeated in
+SPARK_Mode (``Off``), then that pragma will need to be repeated in
the package body.
Pragma Static_Elaboration_Desired
@@ -6032,13 +6122,13 @@ of this type. It must name a function whose argument type may be any
subtype, and whose returned type must be the type given as the first
argument to the pragma.
-The meaning of the `Read` parameter is that if a stream attribute directly
+The meaning of the ``Read`` parameter is that if a stream attribute directly
or indirectly specifies reading of the type given as the first parameter,
then a value of the type given as the argument to the Read function is
read from the stream, and then the Read function is used to convert this
to the required target type.
-Similarly the `Write` parameter specifies how to treat write attributes
+Similarly the ``Write`` parameter specifies how to treat write attributes
that directly or indirectly apply to the type given as the first parameter.
It must have an input parameter of the type specified by the first parameter,
and the return type must be the same as the input type of the Read function.
@@ -6075,12 +6165,12 @@ Reference Manual are:
The effect is that if the value of an unbounded string is written to a stream,
then the representation of the item in the stream is in the same format that
-would be used for `Standard.String'Output`, and this same representation
+would be used for ``Standard.String'Output``, and this same representation
is expected when a value of this type is read from the stream. Note that the
value written always includes the bounds, even for Unbounded_String'Write,
since Unbounded_String is not an array type.
-Note that the `Stream_Convert` pragma is not effective in the case of
+Note that the ``Stream_Convert`` pragma is not effective in the case of
a derived type of a non-limited tagged type. If such a type is specified then
the pragma is silently ignored, and the default implementation of the stream
attributes is used instead.
@@ -6126,15 +6216,15 @@ layout checking:
gcc -c -gnatyl ...
-The form ALL_CHECKS activates all standard checks (its use is equivalent
-to the use of the `gnaty` switch with no options.
+The form ``ALL_CHECKS`` activates all standard checks (its use is equivalent
+to the use of the :switch:`gnaty` switch with no options.
See the :title:`GNAT User's Guide` for details.)
-Note: the behavior is slightly different in GNAT mode (*-gnatg* used).
-In this case, ALL_CHECKS implies the standard set of GNAT mode style check
-options (i.e. equivalent to *-gnatyg*).
+Note: the behavior is slightly different in GNAT mode (:switch:`-gnatg` used).
+In this case, ``ALL_CHECKS`` implies the standard set of GNAT mode style check
+options (i.e. equivalent to :switch:`-gnatyg`).
-The forms with `Off` and `On`
+The forms with ``Off`` and ``On``
can be used to temporarily disable style checks
as shown in the following example:
@@ -6149,7 +6239,7 @@ as shown in the following example:
Finally the two argument form is allowed only if the first argument is
-`On` or `Off`. The effect is to turn of semantic style checks
+``On`` or ``Off``. The effect is to turn of semantic style checks
for the specified entity, as shown in the following example:
@@ -6193,46 +6283,46 @@ names that are implementation defined (as permitted by the RM):
*
- `Alignment_Check` can be used to suppress alignment checks
+ ``Alignment_Check`` can be used to suppress alignment checks
on addresses used in address clauses. Such checks can also be suppressed
- by suppressing range checks, but the specific use of `Alignment_Check`
+ by suppressing range checks, but the specific use of ``Alignment_Check``
allows suppression of alignment checks without suppressing other range checks.
- Note that `Alignment_Check` is suppressed by default on machines (such as
+ Note that ``Alignment_Check`` is suppressed by default on machines (such as
the x86) with non-strict alignment.
*
- `Atomic_Synchronization` can be used to suppress the special memory
+ ``Atomic_Synchronization`` can be used to suppress the special memory
synchronization instructions that are normally generated for access to
- `Atomic` variables to ensure correct synchronization between tasks
+ ``Atomic`` variables to ensure correct synchronization between tasks
that use such variables for synchronization purposes.
*
- `Duplicated_Tag_Check` Can be used to suppress the check that is generated
+ ``Duplicated_Tag_Check`` Can be used to suppress the check that is generated
for a duplicated tag value when a tagged type is declared.
*
- `Container_Checks` Can be used to suppress all checks within Ada.Containers
+ ``Container_Checks`` Can be used to suppress all checks within Ada.Containers
and instances of its children, including Tampering_Check.
*
- `Tampering_Check` Can be used to suppress tampering check in the containers.
+ ``Tampering_Check`` Can be used to suppress tampering check in the containers.
*
- `Predicate_Check` can be used to control whether predicate checks are
+ ``Predicate_Check`` can be used to control whether predicate checks are
active. It is applicable only to predicates for which the policy is
- `Check`. Unlike `Assertion_Policy`, which determines if a given
+ ``Check``. Unlike ``Assertion_Policy``, which determines if a given
predicate is ignored or checked for the whole program, the use of
- `Suppress` and `Unsuppress` with this check name allows a given
+ ``Suppress`` and ``Unsuppress`` with this check name allows a given
predicate to be turned on and off at specific points in the program.
*
- `Validity_Check` can be used specifically to control validity checks.
- If `Suppress` is used to suppress validity checks, then no validity
+ ``Validity_Check`` can be used specifically to control validity checks.
+ If ``Suppress`` is used to suppress validity checks, then no validity
checks are performed, including those specified by the appropriate compiler
- switch or the `Validity_Checks` pragma.
+ switch or the ``Validity_Checks`` pragma.
*
- Additional check names previously introduced by use of the `Check_Name`
+ Additional check names previously introduced by use of the ``Check_Name``
pragma are also allowed.
@@ -6259,11 +6349,11 @@ Syntax:
This pragma can appear anywhere within a unit.
-The effect is to apply `Suppress (All_Checks)` to the unit
+The effect is to apply ``Suppress (All_Checks)`` to the unit
in which it appears. This pragma is implemented for compatibility with DEC
Ada 83 usage where it appears at the end of a unit, and for compatibility
with Rational Ada, where it appears as a program unit pragma.
-The use of the standard Ada pragma `Suppress (All_Checks)`
+The use of the standard Ada pragma ``Suppress (All_Checks)``
as a normal configuration pragma is the preferred usage in GNAT.
.. _Pragma-Suppress_Debug_Info:
@@ -6298,7 +6388,7 @@ In normal mode, a raise statement for an exception by default generates
an exception message giving the file name and line number for the location
of the raise. This is useful for debugging and logging purposes, but this
entails extra space for the strings for the messages. The configuration
-pragma `Suppress_Exception_Locations` can be used to suppress the
+pragma ``Suppress_Exception_Locations`` can be used to suppress the
generation of these strings, with the result that space is saved, but the
exception message for such raises is null. This configuration pragma may
appear in a global configuration pragma file, or in a specific unit as
@@ -6363,7 +6453,7 @@ Syntax
This pragma appears within a task definition (like pragma
-`Priority`) and applies to the task in which it appears. The
+``Priority``) and applies to the task in which it appears. The
argument must be of type String, and provides a name to be used for
the task instance when the task is created. Note that this expression
is not required to be static, and in particular, it can contain
@@ -6373,7 +6463,7 @@ as illustrated in the example below.
The task name is recorded internally in the run-time structures
and is accessible to tools like the debugger. In addition the
-routine `Ada.Task_Identification.Image` will return this
+routine ``Ada.Task_Identification.Image`` will return this
string, with a unique task address appended.
@@ -6425,7 +6515,7 @@ This pragma specifies the length of the guard area for tasks. The guard
area is an additional storage area allocated to a task. A value of zero
means that either no guard area is created or a minimal guard area is
created, depending on the target. This pragma can appear anywhere a
-`Storage_Size` attribute definition clause is allowed for a task
+``Storage_Size`` attribute definition clause is allowed for a task
type.
.. _Pragma-Test_Case:
@@ -6447,23 +6537,23 @@ Syntax:
[, Ensures => Boolean_Expression]);
-The `Test_Case` pragma allows defining fine-grain specifications
+The ``Test_Case`` pragma allows defining fine-grain specifications
for use by testing tools.
-The compiler checks the validity of the `Test_Case` pragma, but its
+The compiler checks the validity of the ``Test_Case`` pragma, but its
presence does not lead to any modification of the code generated by the
compiler.
-`Test_Case` pragmas may only appear immediately following the
+``Test_Case`` pragmas may only appear immediately following the
(separate) declaration of a subprogram in a package declaration, inside
a package spec unit. Only other pragmas may intervene (that is appear
between the subprogram declaration and a test case).
-The compiler checks that boolean expressions given in `Requires` and
-`Ensures` are valid, where the rules for `Requires` are the
-same as the rule for an expression in `Precondition` and the rules
-for `Ensures` are the same as the rule for an expression in
-`Postcondition`. In particular, attributes `'Old` and
-`'Result` can only be used within the `Ensures`
+The compiler checks that boolean expressions given in ``Requires`` and
+``Ensures`` are valid, where the rules for ``Requires`` are the
+same as the rule for an expression in ``Precondition`` and the rules
+for ``Ensures`` are the same as the rule for an expression in
+``Postcondition``. In particular, attributes ``'Old`` and
+``'Result`` can only be used within the ``Ensures``
expression. The following is an example of use within a package spec:
@@ -6481,11 +6571,11 @@ expression. The following is an example of use within a package spec:
The meaning of a test case is that there is at least one context where
-`Requires` holds such that, if the associated subprogram is executed in
-that context, then `Ensures` holds when the subprogram returns.
-Mode `Nominal` indicates that the input context should also satisfy the
+``Requires`` holds such that, if the associated subprogram is executed in
+that context, then ``Ensures`` holds when the subprogram returns.
+Mode ``Nominal`` indicates that the input context should also satisfy the
precondition of the subprogram, and the output context should also satisfy its
-postcondition. Mode `Robustness` indicates that the precondition and
+postcondition. Mode ``Robustness`` indicates that the precondition and
postcondition of the subprogram should be ignored for this test case.
.. _Pragma-Thread_Local_Storage:
@@ -6507,20 +6597,20 @@ Syntax:
This pragma specifies that the specified entity, which must be
-a variable declared in a library level package, is to be marked as
-"Thread Local Storage" (`TLS`). On systems supporting this (which
+a variable declared in a library-level package, is to be marked as
+"Thread Local Storage" (``TLS``). On systems supporting this (which
include Windows, Solaris, GNU/Linux and VxWorks 6), this causes each
thread (and hence each Ada task) to see a distinct copy of the variable.
The variable may not have default initialization, and if there is
-an explicit initialization, it must be either `null` for an
+an explicit initialization, it must be either ``null`` for an
access variable, or a static expression for a scalar variable.
This provides a low level mechanism similar to that provided by
-the `Ada.Task_Attributes` package, but much more efficient
+the ``Ada.Task_Attributes`` package, but much more efficient
and is also useful in writing interface code that will interact
with foreign threads.
-If this pragma is used on a system where `TLS` is not supported,
+If this pragma is used on a system where ``TLS`` is not supported,
then an error message will be generated and the program will be rejected.
Pragma Time_Slice
@@ -6577,13 +6667,13 @@ Syntax:
[Check =>] EXPRESSION);
-The `Type_Invariant` pragma is intended to be an exact
-replacement for the language-defined `Type_Invariant`
+The ``Type_Invariant`` pragma is intended to be an exact
+replacement for the language-defined ``Type_Invariant``
aspect, and shares its restrictions and semantics. It differs
-from the language defined `Invariant` pragma in that it
+from the language defined ``Invariant`` pragma in that it
does not permit a string parameter, and it is
-controlled by the assertion identifier `Type_Invariant`
-rather than `Invariant`.
+controlled by the assertion identifier ``Type_Invariant``
+rather than ``Invariant``.
.. _Pragma-Type_Invariant_Class:
@@ -6600,19 +6690,19 @@ Syntax:
[Check =>] EXPRESSION);
-The `Type_Invariant_Class` pragma is intended to be an exact
-replacement for the language-defined `Type_Invariant'Class`
+The ``Type_Invariant_Class`` pragma is intended to be an exact
+replacement for the language-defined ``Type_Invariant'Class``
aspect, and shares its restrictions and semantics.
-Note: This pragma is called `Type_Invariant_Class` rather than
-`Type_Invariant'Class` because the latter would not be strictly
+Note: This pragma is called ``Type_Invariant_Class`` rather than
+``Type_Invariant'Class`` because the latter would not be strictly
conforming to the allowed syntax for pragmas. The motivation
for providing pragmas equivalent to the aspects is to allow a program
to be written using the pragmas, and then compiled if necessary
using an Ada compiler that does not recognize the pragmas or
aspects, but is prepared to ignore the pragmas. The assertion
-policy that controls this pragma is `Type_Invariant'Class`,
-not `Type_Invariant_Class`.
+policy that controls this pragma is ``Type_Invariant'Class``,
+not ``Type_Invariant_Class``.
Pragma Unchecked_Union
======================
@@ -6679,11 +6769,11 @@ on entry even though the value would not be actually used.
Although the rule guarantees against this possibility, it is sometimes
too restrictive. For example if we know that the string has a lower
bound of 1, then we will never raise an exception.
-The pragma `Unevaluated_Use_Of_Old` can be
-used to modify this behavior. If the argument is `Error` then an
+The pragma ``Unevaluated_Use_Of_Old`` can be
+used to modify this behavior. If the argument is ``Error`` then an
error is given (this is the default RM behavior). If the argument is
-`Warn` then the usage is allowed as legal but with a warning
-that an exception might be raised. If the argument is `Allow`
+``Warn`` then the usage is allowed as legal but with a warning
+that an exception might be raised. If the argument is ``Allow``
then the usage is allowed as legal without generating a warning.
This pragma may appear as a configuration pragma, or in a declarative
@@ -6704,7 +6794,7 @@ Syntax:
If this pragma occurs in a unit that is processed by the compiler, GNAT
aborts with the message :samp:`xxx not implemented`, where
-`xxx` is the name of the current compilation unit. This pragma is
+``xxx`` is the name of the current compilation unit. This pragma is
intended to allow the compiler to handle unimplemented library units in
a clean manner.
@@ -6724,13 +6814,13 @@ Syntax:
pragma Universal_Aliasing [([Entity =>] type_LOCAL_NAME)];
-`type_LOCAL_NAME` must refer to a type declaration in the current
+``type_LOCAL_NAME`` must refer to a type declaration in the current
declarative part. The effect is to inhibit strict type-based aliasing
optimization for the given type. In other words, the effect is as though
access types designating this type were subject to pragma No_Strict_Aliasing.
For a detailed description of the strict aliasing optimization, and the
situations in which it must be suppressed, see the section on
-`Optimization and Strict Aliasing` in the :title:`GNAT User's Guide`.
+``Optimization and Strict Aliasing`` in the :title:`GNAT User's Guide`.
.. _Pragma-Universal_Data:
@@ -6773,7 +6863,7 @@ Syntax:
This pragma signals that the assignable entities (variables,
-`out` parameters, `in out` parameters) whose names are listed are
+``out`` parameters, ``in out`` parameters) whose names are listed are
deliberately not assigned in the current source unit. This
suppresses warnings about the
entities being referenced but not assigned, and in addition a warning will be
@@ -6787,9 +6877,9 @@ be.
For the variable case, warnings are never given for unreferenced variables
whose name contains one of the substrings
-`DISCARD, DUMMY, IGNORE, JUNK, UNUSED` in any casing. Such names
+``DISCARD, DUMMY, IGNORE, JUNK, UNUSED`` in any casing. Such names
are typically to be used in cases where such warnings are expected.
-Thus it is never necessary to use `pragma Unmodified` for such
+Thus it is never necessary to use ``pragma Unmodified`` for such
variables, though it is harmless to do so.
.. _Pragma-Unreferenced:
@@ -6822,10 +6912,10 @@ and that this is deliberate. It can also be useful in the case of
objects declared only for their initialization or finalization side
effects.
-If `LOCAL_NAME` identifies more than one matching homonym in the
+If ``LOCAL_NAME`` identifies more than one matching homonym in the
current scope, then the entity most recently declared is the one to which
the pragma applies. Note that in the case of accept formals, the pragma
-Unreferenced may appear immediately after the keyword `do` which
+Unreferenced may appear immediately after the keyword ``do`` which
allows the indication of whether or not accept formals are referenced
or not to be given individually for each accept statement.
@@ -6839,17 +6929,17 @@ declaration, then this pragma should not be used (calls from another
unit would not be flagged); pragma Obsolescent can be used instead
for this purpose, see :ref:`Pragma_Obsolescent`.
-The second form of pragma `Unreferenced` is used within a context
+The second form of pragma ``Unreferenced`` is used within a context
clause. In this case the arguments must be unit names of units previously
-mentioned in `with` clauses (similar to the usage of pragma
-`Elaborate_All`. The effect is to suppress warnings about unreferenced
+mentioned in ``with`` clauses (similar to the usage of pragma
+``Elaborate_All``. The effect is to suppress warnings about unreferenced
units and unreferenced entities within these units.
For the variable case, warnings are never given for unreferenced variables
whose name contains one of the substrings
-`DISCARD, DUMMY, IGNORE, JUNK, UNUSED` in any casing. Such names
+``DISCARD, DUMMY, IGNORE, JUNK, UNUSED`` in any casing. Such names
are typically to be used in cases where such warnings are expected.
-Thus it is never necessary to use `pragma Unreferenced` for such
+Thus it is never necessary to use ``pragma Unreferenced`` for such
variables, though it is harmless to do so.
.. _Pragma-Unreferenced_Objects:
@@ -6890,28 +6980,28 @@ Syntax:
Normally certain interrupts are reserved to the implementation. Any attempt
to attach an interrupt causes Program_Error to be raised, as described in
-RM C.3.2(22). A typical example is the `SIGINT` interrupt used in
+RM C.3.2(22). A typical example is the ``SIGINT`` interrupt used in
many systems for a :kbd:`Ctrl-C` interrupt. Normally this interrupt is
reserved to the implementation, so that :kbd:`Ctrl-C` can be used to
interrupt execution.
-If the pragma `Unreserve_All_Interrupts` appears anywhere in any unit in
+If the pragma ``Unreserve_All_Interrupts`` appears anywhere in any unit in
a program, then all such interrupts are unreserved. This allows the
program to handle these interrupts, but disables their standard
functions. For example, if this pragma is used, then pressing
:kbd:`Ctrl-C` will not automatically interrupt execution. However,
-a program can then handle the `SIGINT` interrupt as it chooses.
+a program can then handle the ``SIGINT`` interrupt as it chooses.
For a full list of the interrupts handled in a specific implementation,
-see the source code for the spec of `Ada.Interrupts.Names` in
+see the source code for the spec of ``Ada.Interrupts.Names`` in
file :file:`a-intnam.ads`. This is a target dependent file that contains the
list of interrupts recognized for a given target. The documentation in
this file also specifies what interrupts are affected by the use of
-the `Unreserve_All_Interrupts` pragma.
+the ``Unreserve_All_Interrupts`` pragma.
For a more general facility for controlling what interrupts can be
-handled, see pragma `Interrupt_State`, which subsumes the functionality
-of the `Unreserve_All_Interrupts` pragma.
+handled, see pragma ``Interrupt_State``, which subsumes the functionality
+of the ``Unreserve_All_Interrupts`` pragma.
Pragma Unsuppress
=================
@@ -6924,11 +7014,11 @@ Syntax:
pragma Unsuppress (IDENTIFIER [, [On =>] NAME]);
-This pragma undoes the effect of a previous pragma `Suppress`. If
-there is no corresponding pragma `Suppress` in effect, it has no
+This pragma undoes the effect of a previous pragma ``Suppress``. If
+there is no corresponding pragma ``Suppress`` in effect, it has no
effect. The range of the effect is the same as for pragma
-`Suppress`. The meaning of the arguments is identical to that used
-in pragma `Suppress`.
+``Suppress``. The meaning of the arguments is identical to that used
+in pragma ``Suppress``.
One important application is to ensure that checks are on in cases where
code depends on the checks for its correct functioning, so that the code
@@ -6949,7 +7039,7 @@ of Ada as an implementation-defined pragma.
Note that in addition to the checks defined in the Ada RM, GNAT recogizes a
number of implementation-defined check names. See the description of pragma
-`Suppress` for full details.
+``Suppress`` for full details.
Pragma Use_VADS_Size
====================
@@ -6989,7 +7079,7 @@ Syntax:
This pragma signals that the assignable entities (variables,
-`out` parameters, and `in out` parameters) whose names are listed
+``out`` parameters, and ``in out`` parameters) whose names are listed
deliberately do not get assigned or referenced in the current source unit
after the occurrence of the pragma in the current source unit. This
suppresses warnings about the entities that are unreferenced and/or not
@@ -7003,9 +7093,9 @@ that it might be.
For the variable case, warnings are never given for unreferenced
variables whose name contains one of the substrings
-`DISCARD, DUMMY, IGNORE, JUNK, UNUSED` in any casing. Such names
+``DISCARD, DUMMY, IGNORE, JUNK, UNUSED`` in any casing. Such names
are typically to be used in cases where such warnings are expected.
-Thus it is never necessary to use `pragma Unmodified` for such
+Thus it is never necessary to use ``pragma Unmodified`` for such
variables, though it is harmless to do so.
Pragma Validity_Checks
@@ -7033,8 +7123,8 @@ reference manual settings, and then a string of letters in the string
specifies the exact set of options required. The form of this string
is exactly as described for the *-gnatVx* compiler switch (see the
GNAT User's Guide for details). For example the following two
-methods can be used to enable validity checking for mode `in` and
-`in out` subprogram parameters:
+methods can be used to enable validity checking for mode ``in`` and
+``in out`` subprogram parameters:
*
@@ -7051,9 +7141,9 @@ methods can be used to enable validity checking for mode `in` and
The form ALL_CHECKS activates all standard checks (its use is equivalent
-to the use of the `gnatva` switch.
+to the use of the :switch:`gnatva` switch.
-The forms with `Off` and `On`
+The forms with ``Off`` and ``On``
can be used to temporarily disable validity checks
as shown in the following example:
@@ -7106,18 +7196,18 @@ write all the bits of the object.
The intention is that this be suitable for use with memory-mapped I/O devices
on some machines. Note that there are two important respects in which this is
-different from `pragma Atomic`. First a reference to a `Volatile_Full_Access`
+different from ``pragma Atomic``. First a reference to a ``Volatile_Full_Access``
object is not a sequential action in the RM 9.10 sense and, therefore, does
-not create a synchronization point. Second, in the case of `pragma Atomic`,
+not create a synchronization point. Second, in the case of ``pragma Atomic``,
there is no guarantee that all the bits will be accessed if the reference
is not to the whole object; the compiler is allowed (and generally will)
access only part of the object in this case.
-It is not permissible to specify `Atomic` and `Volatile_Full_Access` for
+It is not permissible to specify ``Atomic`` and ``Volatile_Full_Access`` for
the same object.
-It is not permissible to specify `Volatile_Full_Access` for a composite
-(record or array) type or object that has at least one `Aliased` component.
+It is not permissible to specify ``Volatile_Full_Access`` for a composite
+(record or array) type or object that has at least one ``Aliased`` component.
.. _Pragma-Volatile_Function:
@@ -7130,7 +7220,7 @@ Syntax:
pragma Volatile_Function [ (boolean_EXPRESSION) ];
-For the semantics of this pragma, see the entry for aspect `Volatile_Function`
+For the semantics of this pragma, see the entry for aspect ``Volatile_Function``
in the SPARK 2014 Reference Manual, section 7.1.2.
Pragma Warning_As_Error
@@ -7152,8 +7242,8 @@ which treats all warnings as errors.
The pattern may contain asterisks, which match zero or more characters in
the message. For example, you can use
-`pragma Warning_As_Error ("bits of*unused")` to treat the warning
-message `warning: 960 bits of "a" unused` as an error. No other regular
+``pragma Warning_As_Error ("bits of*unused")`` to treat the warning
+message ``warning: 960 bits of "a" unused`` as an error. No other regular
expression notations are permitted. All characters other than asterisk in
these three specific cases are treated as literal characters in the match.
The match is case insensitive, for example XYZ matches xyz.
@@ -7246,41 +7336,41 @@ Syntax:
Note: in Ada 83 mode, a string literal may be used in place of a static string
expression (which does not exist in Ada 83).
-Note if the second argument of `DETAILS` is a `local_NAME` then the
+Note if the second argument of ``DETAILS`` is a ``local_NAME`` then the
second form is always understood. If the intention is to use
-the fourth form, then you can write `NAME & ""` to force the
-intepretation as a `static_string_EXPRESSION`.
+the fourth form, then you can write ``NAME & ""`` to force the
+intepretation as a *static_string_EXPRESSION*.
-Note: if the first argument is a valid `TOOL_NAME`, it will be interpreted
-that way. The use of the `TOOL_NAME` argument is relevant only to users
+Note: if the first argument is a valid ``TOOL_NAME``, it will be interpreted
+that way. The use of the ``TOOL_NAME`` argument is relevant only to users
of SPARK and GNATprove, see last part of this section for details.
Normally warnings are enabled, with the output being controlled by
-the command line switch. Warnings (`Off`) turns off generation of
-warnings until a Warnings (`On`) is encountered or the end of the
+the command line switch. Warnings (``Off``) turns off generation of
+warnings until a Warnings (``On``) is encountered or the end of the
current unit. If generation of warnings is turned off using this
pragma, then some or all of the warning messages are suppressed,
regardless of the setting of the command line switches.
-The `Reason` parameter may optionally appear as the last argument
+The ``Reason`` parameter may optionally appear as the last argument
in any of the forms of this pragma. It is intended purely for the
-purposes of documenting the reason for the `Warnings` pragma.
+purposes of documenting the reason for the ``Warnings`` pragma.
The compiler will check that the argument is a static string but
otherwise ignore this argument. Other tools may provide specialized
processing for this string.
The form with a single argument (or two arguments if Reason present),
-where the first argument is `ON` or `OFF`
+where the first argument is ``ON`` or ``OFF``
may be used as a configuration pragma.
-If the `LOCAL_NAME` parameter is present, warnings are suppressed for
+If the ``LOCAL_NAME`` parameter is present, warnings are suppressed for
the specified entity. This suppression is effective from the point where
it occurs till the end of the extended scope of the variable (similar to
-the scope of `Suppress`). This form cannot be used as a configuration
+the scope of ``Suppress``). This form cannot be used as a configuration
pragma.
-In the case where the first argument is other than `ON` or
-`OFF`,
+In the case where the first argument is other than ``ON`` or
+``OFF``,
the third form with a single static_string_EXPRESSION argument (and possible
reason) provides more precise
control over which warnings are active. The string is a list of letters
@@ -7289,35 +7379,35 @@ code for these letters is the same as the string used in the command
line switch controlling warnings. For a brief summary, use the gnatmake
command with no arguments, which will generate usage information containing
the list of warnings switches supported. For
-full details see the section on `Warning Message Control` in the
+full details see the section on ``Warning Message Control`` in the
:title:`GNAT User's Guide`.
This form can also be used as a configuration pragma.
-The warnings controlled by the *-gnatw* switch are generated by the
+The warnings controlled by the :switch:`-gnatw` switch are generated by the
front end of the compiler. The GCC back end can provide additional warnings
-and they are controlled by the *-W* switch. Such warnings can be
-identified by the appearance of a string of the form `[-Wxxx]` in the
-message which designates the *-Wxxx* switch that controls the message.
-The form with a single static_string_EXPRESSION argument also works for these
-warnings, but the string must be a single full *-Wxxx* switch in this
+and they are controlled by the :switch:`-W` switch. Such warnings can be
+identified by the appearance of a string of the form ``[-W{xxx}]`` in the
+message which designates the :switch:`-W{xxx}` switch that controls the message.
+The form with a single *static_string_EXPRESSION* argument also works for these
+warnings, but the string must be a single full :switch:`-W{xxx}` switch in this
case. The above reference lists a few examples of these additional warnings.
The specified warnings will be in effect until the end of the program
-or another pragma Warnings is encountered. The effect of the pragma is
+or another pragma ``Warnings`` is encountered. The effect of the pragma is
cumulative. Initially the set of warnings is the standard default set
as possibly modified by compiler switches. Then each pragma Warning
modifies this set of warnings as specified. This form of the pragma may
also be used as a configuration pragma.
-The fourth form, with an `On|Off` parameter and a string, is used to
+The fourth form, with an ``On|Off`` parameter and a string, is used to
control individual messages, based on their text. The string argument
is a pattern that is used to match against the text of individual
warning messages (not including the initial "warning: " tag).
The pattern may contain asterisks, which match zero or more characters in
the message. For example, you can use
-`pragma Warnings (Off, "bits of*unused")` to suppress the warning
-message `warning: 960 bits of "a" unused`. No other regular
+``pragma Warnings (Off, "bits of*unused")`` to suppress the warning
+message ``warning: 960 bits of "a" unused``. No other regular
expression notations are permitted. All characters other than asterisk in
these three specific cases are treated as literal characters in the match.
The match is case insensitive, for example XYZ matches xyz.
@@ -7329,7 +7419,7 @@ the end of the message, since this is implied).
The above use of patterns to match the message applies only to warning
messages generated by the front end. This form of the pragma with a string
argument can also be used to control warnings provided by the back end and
-mentioned above. By using a single full *-Wxxx* switch in the pragma,
+mentioned above. By using a single full :switch:`-W{xxx}` switch in the pragma,
such warnings can be turned on and off.
There are two ways to use the pragma in this form. The OFF form can be used
@@ -7353,13 +7443,13 @@ pragmas, and (if *-gnatw.w* is given) at least one matching
warning must be suppressed.
Note: to write a string that will match any warning, use the string
-`"***"`. It will not work to use a single asterisk or two
+``"***"``. It will not work to use a single asterisk or two
asterisks since this looks like an operator name. This form with three
-asterisks is similar in effect to specifying `pragma Warnings (Off)` except (if *-gnatw.w* is given) that a matching
-`pragma Warnings (On, "***")` will be required. This can be
+asterisks is similar in effect to specifying ``pragma Warnings (Off)`` except (if :switch:`-gnatw.w` is given) that a matching
+``pragma Warnings (On, "***")`` will be required. This can be
helpful in avoiding forgetting to turn warnings back on.
-Note: the debug flag -gnatd.i (`/NOWARNINGS_PRAGMAS` in VMS) can be
+Note: the debug flag :switch:`-gnatd.i` (``/NOWARNINGS_PRAGMAS`` in VMS) can be
used to cause the compiler to entirely ignore all WARNINGS pragmas. This can
be useful in checking whether obsolete pragmas in existing programs are hiding
real problems.
@@ -7368,14 +7458,14 @@ Note: pragma Warnings does not affect the processing of style messages. See
separate entry for pragma Style_Checks for control of style messages.
Users of the formal verification tool GNATprove for the SPARK subset of Ada may
-use the version of the pragma with a `TOOL_NAME` parameter.
+use the version of the pragma with a ``TOOL_NAME`` parameter.
-If present, `TOOL_NAME` is the name of a tool, currently either `GNAT` for the
-compiler or `GNATprove` for the formal verification tool. A given tool only
+If present, ``TOOL_NAME`` is the name of a tool, currently either ``GNAT`` for the
+compiler or ``GNATprove`` for the formal verification tool. A given tool only
takes into account pragma Warnings that do not specify a tool name, or that
specify the matching tool name. This makes it possible to disable warnings
selectively for each tool, and as a consequence to detect useless pragma
-Warnings with switch `-gnatw.w`.
+Warnings with switch :switch:`-gnatw.w`.
Pragma Weak_External
====================
@@ -7388,10 +7478,10 @@ Syntax:
pragma Weak_External ([Entity =>] LOCAL_NAME);
-`LOCAL_NAME` must refer to an object that is declared at the library
+``LOCAL_NAME`` must refer to an object that is declared at the library
level. This pragma specifies that the given entity should be marked as a
-weak symbol for the linker. It is equivalent to `__attribute__((weak))`
-in GNU C and causes `LOCAL_NAME` to be emitted as a weak symbol instead
+weak symbol for the linker. It is equivalent to ``__attribute__((weak))``
+in GNU C and causes ``LOCAL_NAME`` to be emitted as a weak symbol instead
of a regular symbol, that is to say a symbol that does not have to be
resolved by the linker if used in conjunction with a pragma Import.
@@ -7452,8 +7542,8 @@ wide character, because then the previous encoding will still be in
effect, causing "illegal character" errors.
The argument can be an identifier or a character literal. In the identifier
-case, it is one of `HEX`, `UPPER`, `SHIFT_JIS`,
-`EUC`, `UTF8`, or `BRACKETS`. In the character literal
+case, it is one of ``HEX``, ``UPPER``, ``SHIFT_JIS``,
+``EUC``, ``UTF8``, or ``BRACKETS``. In the character literal
case it is correspondingly one of the characters :kbd:`h`, :kbd:`u`,
:kbd:`s`, :kbd:`e`, :kbd:`8`, or :kbd:`b`.
diff --git a/gcc/ada/doc/gnat_rm/implementation_of_ada_2012_features.rst b/gcc/ada/doc/gnat_rm/implementation_of_ada_2012_features.rst
index 22ef54a..2825362c 100644
--- a/gcc/ada/doc/gnat_rm/implementation_of_ada_2012_features.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_of_ada_2012_features.rst
@@ -19,7 +19,7 @@ implemented.
Generally, these features are only
available if the *-gnat12* (Ada 2012 features enabled) option is set,
which is the default behavior,
-or if the configuration pragma `Ada_2012` is used.
+or if the configuration pragma ``Ada_2012`` is used.
However, new pragmas, attributes, and restrictions are
unconditionally available, since the Ada 95 standard allows the addition of
@@ -88,7 +88,7 @@ http://www.ada-auth.org/ai05-summary.html.
* *AI-0163 Pragmas in place of null (2010-07-01)*
A statement sequence may be composed entirely of pragmas. It is no longer
- necessary to add a dummy `null` statement to make the sequence legal.
+ necessary to add a dummy ``null`` statement to make the sequence legal.
RM References: 2.08 (7) 2.08 (16)
@@ -109,58 +109,58 @@ http://www.ada-auth.org/ai05-summary.html.
forms of declarations listed in the AI are supported. The following is a
list of the aspects supported (with GNAT implementation aspects marked)
-================================== ===========
-Supported Aspect Source
-================================== ===========
- `Ada_2005` -- GNAT
- `Ada_2012` -- GNAT
- `Address`
- `Alignment`
- `Atomic`
- `Atomic_Components`
- `Bit_Order`
- `Component_Size`
- `Contract_Cases` -- GNAT
- `Discard_Names`
- `External_Tag`
- `Favor_Top_Level` -- GNAT
- `Inline`
- `Inline_Always` -- GNAT
- `Invariant` -- GNAT
- `Machine_Radix`
- `No_Return`
- `Object_Size` -- GNAT
- `Pack`
- `Persistent_BSS` -- GNAT
- `Post`
- `Pre`
- `Predicate`
- `Preelaborable_Initialization`
- `Pure_Function` -- GNAT
- `Remote_Access_Type` -- GNAT
- `Shared` -- GNAT
- `Size`
- `Storage_Pool`
- `Storage_Size`
- `Stream_Size`
- `Suppress`
- `Suppress_Debug_Info` -- GNAT
- `Test_Case` -- GNAT
- `Thread_Local_Storage` -- GNAT
- `Type_Invariant`
- `Unchecked_Union`
- `Universal_Aliasing` -- GNAT
- `Unmodified` -- GNAT
- `Unreferenced` -- GNAT
- `Unreferenced_Objects` -- GNAT
- `Unsuppress`
- `Value_Size` -- GNAT
- `Volatile`
- `Volatile_Components`
- `Warnings` -- GNAT
-================================== ===========
-
- Note that for aspects with an expression, e.g. `Size`, the expression is
+==================================== ===========
+Supported Aspect Source
+==================================== ===========
+ ``Ada_2005`` -- GNAT
+ ``Ada_2012`` -- GNAT
+ ``Address``
+ ``Alignment``
+ ``Atomic``
+ ``Atomic_Components``
+ ``Bit_Order``
+ ``Component_Size``
+ ``Contract_Cases`` -- GNAT
+ ``Discard_Names``
+ ``External_Tag``
+ ``Favor_Top_Level`` -- GNAT
+ ``Inline``
+ ``Inline_Always`` -- GNAT
+ ``Invariant`` -- GNAT
+ ``Machine_Radix``
+ ``No_Return``
+ ``Object_Size`` -- GNAT
+ ``Pack``
+ ``Persistent_BSS`` -- GNAT
+ ``Post``
+ ``Pre``
+ ``Predicate``
+ ``Preelaborable_Initialization``
+ ``Pure_Function`` -- GNAT
+ ``Remote_Access_Type`` -- GNAT
+ ``Shared`` -- GNAT
+ ``Size``
+ ``Storage_Pool``
+ ``Storage_Size``
+ ``Stream_Size``
+ ``Suppress``
+ ``Suppress_Debug_Info`` -- GNAT
+ ``Test_Case`` -- GNAT
+ ``Thread_Local_Storage`` -- GNAT
+ ``Type_Invariant``
+ ``Unchecked_Union``
+ ``Universal_Aliasing`` -- GNAT
+ ``Unmodified`` -- GNAT
+ ``Unreferenced`` -- GNAT
+ ``Unreferenced_Objects`` -- GNAT
+ ``Unsuppress``
+ ``Value_Size`` -- GNAT
+ ``Volatile``
+ ``Volatile_Components``
+ ``Warnings`` -- GNAT
+==================================== ===========
+
+ Note that for aspects with an expression, e.g. ``Size``, the expression is
treated like a default expression (visibility is analyzed at the point of
occurrence of the aspect, but evaluation of the expression occurs at the
freeze point of the entity involved).
@@ -188,7 +188,7 @@ Supported Aspect Source
* *AI-0003 Qualified expressions as names (2010-07-11)*
In Ada 2012, a qualified expression is considered to be syntactically a name,
- meaning that constructs such as `A'(F(X)).B` are now legal. This is
+ meaning that constructs such as ``A'(F(X)).B`` are now legal. This is
useful in disambiguating some cases of overloading.
RM References: 3.03 (11) 3.03 (21) 4.01 (2) 4.04 (7) 4.07 (3)
@@ -211,7 +211,7 @@ Supported Aspect Source
The wording in the RM implied that if you have a general access to a
constrained object, it could be used to modify the discriminants. This was
- obviously not intended. `Constraint_Error` should be raised, and GNAT
+ obviously not intended. ``Constraint_Error`` should be raised, and GNAT
has always done so in this situation.
RM References: 3.03 (23) 3.10.02 (26/2) 4.01 (9) 6.04.01 (17) 8.05.01 (5/2)
@@ -242,8 +242,8 @@ Supported Aspect Source
* *AI-0181 Soft hyphen is a non-graphic character (2010-07-23)*
From Ada 2005 on, soft hyphen is considered a non-graphic character, which
- means that it has a special name (`SOFT_HYPHEN`) in conjunction with the
- `Image` and `Value` attributes for the character types. Strictly
+ means that it has a special name (``SOFT_HYPHEN``) in conjunction with the
+ ``Image`` and ``Value`` attributes for the character types. Strictly
speaking this is an inconsistency with Ada 95, but in practice the use of
these attributes is so obscure that it will not cause problems.
@@ -251,13 +251,13 @@ Supported Aspect Source
.. index:: AI-0182 (Ada 2012 feature)
-* *AI-0182 Additional forms for `Character'Value* (0000-00-00)`
+* *AI-0182 Additional forms for* ``Character'Value`` *(0000-00-00)*
- This AI allows `Character'Value` to accept the string `'?'` where
- `?` is any character including non-graphic control characters. GNAT has
+ This AI allows ``Character'Value`` to accept the string ``'?'`` where
+ ``?`` is any character including non-graphic control characters. GNAT has
always accepted such strings. It also allows strings such as
- `HEX_00000041` to be accepted, but GNAT does not take advantage of this
- permission and raises `Constraint_Error`, as is certainly still
+ ``HEX_00000041`` to be accepted, but GNAT does not take advantage of this
+ permission and raises ``Constraint_Error``, as is certainly still
permitted.
RM References: 3.05 (56/2)
@@ -298,8 +298,8 @@ Supported Aspect Source
* *AI-0173 Testing if tags represent abstract types (2010-07-03)*
- The function `Ada.Tags.Type_Is_Abstract` returns `True` if invoked
- with the tag of an abstract type, and `False` otherwise.
+ The function ``Ada.Tags.Type_Is_Abstract`` returns ``True`` if invoked
+ with the tag of an abstract type, and ``False`` otherwise.
RM References: 3.09 (7.4/2) 3.09 (12.4/2)
@@ -450,8 +450,8 @@ Supported Aspect Source
* *AI-0037 Out-of-range box associations in aggregate (0000-00-00)*
- This AI confirms that an association of the form `Indx => <>` in an
- array aggregate must raise `Constraint_Error` if `Indx`
+ This AI confirms that an association of the form ``Indx => <>`` in an
+ array aggregate must raise ``Constraint_Error`` if ``Indx``
is out of range. The RM specified a range check on other associations, but
not when the value of the association was defaulted. GNAT has always inserted
a constraint check on the index value.
@@ -464,7 +464,7 @@ Supported Aspect Source
Equality of untagged record composes, so that the predefined equality for a
composite type that includes a component of some untagged record type
- `R` uses the equality operation of `R` (which may be user-defined
+ ``R`` uses the equality operation of ``R`` (which may be user-defined
or predefined). This makes the behavior of untagged records identical to that
of tagged types in this respect.
@@ -541,7 +541,7 @@ Supported Aspect Source
The new syntax for iterating over arrays and containers is now implemented.
Iteration over containers is for now limited to read-only iterators. Only
- default iterators are supported, with the syntax: `for Elem of C`.
+ default iterators are supported, with the syntax: ``for Elem of C``.
RM References: 5.05
@@ -586,7 +586,7 @@ Supported Aspect Source
* *AI-0196 Null exclusion tests for out parameters (0000-00-00)*
- Null exclusion checks are not made for `**out**` parameters when
+ Null exclusion checks are not made for ``out`` parameters when
evaluating the actual parameters. GNAT has never generated these checks.
RM References: 6.04.01 (13)
@@ -638,7 +638,7 @@ Supported Aspect Source
* *AI-0050 Raising Constraint_Error early for function call (0000-00-00)*
- The implementation permissions for raising `Constraint_Error` early on a function call
+ The implementation permissions for raising ``Constraint_Error`` early on a function call
when it was clear an exception would be raised were over-permissive and allowed
mishandling of discriminants in some cases. GNAT did
not take advantage of these incorrect permissions in any case.
@@ -745,7 +745,7 @@ Supported Aspect Source
Requeue is permitted to a protected, synchronized or task interface primitive
providing it is known that the overriding operation is an entry. Otherwise
the requeue statement has the same effect as a procedure call. Use of pragma
- `Implemented` provides a way to impose a static requirement on the
+ ``Implemented`` provides a way to impose a static requirement on the
overriding operation by adhering to one of the implementation kinds: entry,
protected procedure or any of the above.
@@ -756,7 +756,7 @@ Supported Aspect Source
* *AI-0201 Independence of atomic object components (2010-07-22)*
- If an Atomic object has a pragma `Pack` or a `Component_Size`
+ If an Atomic object has a pragma ``Pack`` or a ``Component_Size``
attribute, then individual components may not be addressable by independent
tasks. However, if the representation clause has no effect (is confirming),
then independence is not compromised. Furthermore, in GNAT, specification of
@@ -770,8 +770,8 @@ Supported Aspect Source
* *AI-0009 Pragma Independent[_Components] (2010-07-23)*
- This AI introduces the new pragmas `Independent` and
- `Independent_Components`,
+ This AI introduces the new pragmas ``Independent`` and
+ ``Independent_Components``,
which control guaranteeing independence of access to objects and components.
The AI also requires independence not unaffected by confirming rep clauses.
@@ -782,7 +782,7 @@ Supported Aspect Source
* *AI-0072 Task signalling using 'Terminated (0000-00-00)*
- This AI clarifies that task signalling for reading `'Terminated` only
+ This AI clarifies that task signalling for reading ``'Terminated`` only
occurs if the result is True. GNAT semantics has always been consistent with
this notion of task signalling.
@@ -904,9 +904,9 @@ Supported Aspect Source
This AI concerns giving names to various representation aspects, but the
practical effect is simply to make the use of duplicate
- `Atomic[_Components]`,
- `Volatile[_Components]`, and
- `Independent[_Components]` pragmas illegal, and GNAT
+ ``Atomic[_Components]``,
+ ``Volatile[_Components]``, and
+ ``Independent[_Components]`` pragmas illegal, and GNAT
now performs this required check.
RM References: 13.01 (8)
@@ -925,7 +925,7 @@ Supported Aspect Source
* *AI-0012 Pack/Component_Size for aliased/atomic (2010-07-15)*
It is now illegal to give an inappropriate component size or a pragma
- `Pack` that attempts to change the component size in the case of atomic
+ ``Pack`` that attempts to change the component size in the case of atomic
or aliased components. Previously GNAT ignored such an attempt with a
warning.
@@ -945,10 +945,10 @@ Supported Aspect Source
* *AI-0095 Address of intrinsic subprograms (0000-00-00)*
- The prefix of `'Address` cannot statically denote a subprogram with
- convention `Intrinsic`. The use of the `Address` attribute raises
- `Program_Error` if the prefix denotes a subprogram with convention
- `Intrinsic`.
+ The prefix of ``'Address`` cannot statically denote a subprogram with
+ convention ``Intrinsic``. The use of the ``Address`` attribute raises
+ ``Program_Error`` if the prefix denotes a subprogram with convention
+ ``Intrinsic``.
RM References: 13.03 (11/1)
@@ -967,8 +967,8 @@ Supported Aspect Source
* *AI-0146 Type invariants (2009-09-21)*
Type invariants may be specified for private types using the aspect notation.
- Aspect `Type_Invariant` may be specified for any private type,
- `Type_Invariant'Class` can
+ Aspect ``Type_Invariant`` may be specified for any private type,
+ ``Type_Invariant'Class`` can
only be specified for tagged types, and is inherited by any descendent of the
tagged types. The invariant is a boolean expression that is tested for being
true in the following situations: conversions to the private type, object
@@ -976,8 +976,8 @@ Supported Aspect Source
[**in**] **out**
parameters and returned result on return from any primitive operation for
the type that is visible to a client.
- GNAT defines the synonyms `Invariant` for `Type_Invariant` and
- `Invariant'Class` for `Type_Invariant'Class`.
+ GNAT defines the synonyms ``Invariant`` for ``Type_Invariant`` and
+ ``Invariant'Class`` for ``Type_Invariant'Class``.
RM References: 13.03.03 (00)
@@ -1011,8 +1011,8 @@ Supported Aspect Source
* *AI-0193 Alignment of allocators (2010-09-16)*
- This AI introduces a new attribute `Max_Alignment_For_Allocation`,
- analogous to `Max_Size_In_Storage_Elements`, but for alignment instead
+ This AI introduces a new attribute ``Max_Alignment_For_Allocation``,
+ analogous to ``Max_Size_In_Storage_Elements``, but for alignment instead
of size.
RM References: 13.11 (16) 13.11 (21) 13.11.01 (0) 13.11.01 (1)
@@ -1048,7 +1048,7 @@ Supported Aspect Source
* *AI-0161 Restriction No_Default_Stream_Attributes (2010-09-11)*
- A new restriction `No_Default_Stream_Attributes` prevents the use of any
+ A new restriction ``No_Default_Stream_Attributes`` prevents the use of any
of the default stream attributes for elementary types. If this restriction is
in force, then it is necessary to provide explicit subprograms for any
stream attributes used.
@@ -1059,7 +1059,7 @@ Supported Aspect Source
* *AI-0194 Value of Stream_Size attribute (0000-00-00)*
- The `Stream_Size` attribute returns the default number of bits in the
+ The ``Stream_Size`` attribute returns the default number of bits in the
stream representation of the given type.
This value is not affected by the presence
of stream subprogram attributes for the type. GNAT has always implemented
@@ -1131,12 +1131,12 @@ Supported Aspect Source
* *AI-0114 Classification of letters (0000-00-00)*
- The code points 170 (`FEMININE ORDINAL INDICATOR`),
- 181 (`MICRO SIGN`), and
- 186 (`MASCULINE ORDINAL INDICATOR`) are technically considered
+ The code points 170 (``FEMININE ORDINAL INDICATOR``),
+ 181 (``MICRO SIGN``), and
+ 186 (``MASCULINE ORDINAL INDICATOR``) are technically considered
lower case letters by Unicode.
However, they are not allowed in identifiers, and they
- return `False` to `Ada.Characters.Handling.Is_Letter/Is_Lower`.
+ return ``False`` to ``Ada.Characters.Handling.Is_Letter/Is_Lower``.
This behavior is consistent with that defined in Ada 95.
RM References: A.03.02 (59) A.04.06 (7)
@@ -1145,11 +1145,11 @@ Supported Aspect Source
* *AI-0185 Ada.Wide_[Wide_]Characters.Handling (2010-07-06)*
- Two new packages `Ada.Wide_[Wide_]Characters.Handling` provide
- classification functions for `Wide_Character` and
- `Wide_Wide_Character`, as well as providing
- case folding routines for `Wide_[Wide_]Character` and
- `Wide_[Wide_]String`.
+ Two new packages ``Ada.Wide_[Wide_]Characters.Handling`` provide
+ classification functions for ``Wide_Character`` and
+ ``Wide_Wide_Character``, as well as providing
+ case folding routines for ``Wide_[Wide_]Character`` and
+ ``Wide_[Wide_]String``.
RM References: A.03.05 (0) A.03.06 (0)
@@ -1157,10 +1157,10 @@ Supported Aspect Source
* *AI-0031 Add From parameter to Find_Token (2010-07-25)*
- A new version of `Find_Token` is added to all relevant string packages,
- with an extra parameter `From`. Instead of starting at the first
+ A new version of ``Find_Token`` is added to all relevant string packages,
+ with an extra parameter ``From``. Instead of starting at the first
character of the string, the search for a matching Token starts at the
- character indexed by the value of `From`.
+ character indexed by the value of ``From``.
These procedures are available in all versions of Ada
but if used in versions earlier than Ada 2012 they will generate a warning
that an Ada 2012 subprogram is being used.
@@ -1173,7 +1173,7 @@ Supported Aspect Source
* *AI-0056 Index on null string returns zero (0000-00-00)*
The wording in the Ada 2005 RM implied an incompatible handling of the
- `Index` functions, resulting in raising an exception instead of
+ ``Index`` functions, resulting in raising an exception instead of
returning zero in some situations.
This was not intended and has been corrected.
GNAT always returned zero, and is thus consistent with this AI.
@@ -1184,20 +1184,20 @@ Supported Aspect Source
* *AI-0137 String encoding package (2010-03-25)*
- The packages `Ada.Strings.UTF_Encoding`, together with its child
- packages, `Conversions`, `Strings`, `Wide_Strings`,
- and `Wide_Wide_Strings` have been
+ The packages ``Ada.Strings.UTF_Encoding``, together with its child
+ packages, ``Conversions``, ``Strings``, ``Wide_Strings``,
+ and ``Wide_Wide_Strings`` have been
implemented. These packages (whose documentation can be found in the spec
files :file:`a-stuten.ads`, :file:`a-suenco.ads`, :file:`a-suenst.ads`,
:file:`a-suewst.ads`, :file:`a-suezst.ads`) allow encoding and decoding of
- `String`, `Wide_String`, and `Wide_Wide_String`
+ ``String``, ``Wide_String``, and ``Wide_Wide_String``
values using UTF coding schemes (including UTF-8, UTF-16LE, UTF-16BE, and
UTF-16), as well as conversions between the different UTF encodings. With
- the exception of `Wide_Wide_Strings`, these packages are available in
+ the exception of ``Wide_Wide_Strings``, these packages are available in
Ada 95 and Ada 2005 mode as well as Ada 2012 mode.
- The `Wide_Wide_Strings package`
+ The ``Wide_Wide_Strings`` package
is available in Ada 2005 mode as well as Ada 2012 mode (but not in Ada 95
- mode since it uses `Wide_Wide_Character`).
+ mode since it uses ``Wide_Wide_Character``).
RM References: A.04.11
@@ -1236,7 +1236,7 @@ Supported Aspect Source
The compiler is not required to support exporting an Ada subprogram with
convention C if there are parameters or a return type of an unconstrained
- array type (such as `String`). GNAT allows such declarations but
+ array type (such as ``String``). GNAT allows such declarations but
generates warnings. It is possible, but complicated, to write the
corresponding C code and certainly such code would be specific to GNAT and
non-portable.
@@ -1247,7 +1247,7 @@ Supported Aspect Source
* *AI-0216 No_Task_Hierarchy forbids local tasks (0000-00-00)*
- It is clearly the intention that `No_Task_Hierarchy` is intended to
+ It is clearly the intention that ``No_Task_Hierarchy`` is intended to
forbid tasks declared locally within subprograms, or functions returning task
objects, and that is the implementation that GNAT has always provided.
However the language in the RM was not sufficiently clear on this point.
@@ -1259,8 +1259,8 @@ Supported Aspect Source
* *AI-0211 No_Relative_Delays forbids Set_Handler use (2010-07-09)*
- The restriction `No_Relative_Delays` forbids any calls to the subprogram
- `Ada.Real_Time.Timing_Events.Set_Handler`.
+ The restriction ``No_Relative_Delays`` forbids any calls to the subprogram
+ ``Ada.Real_Time.Timing_Events.Set_Handler``.
RM References: D.07 (5) D.07 (10/2) D.07 (10.4/2) D.07 (10.7/2)
@@ -1268,7 +1268,7 @@ Supported Aspect Source
* *AI-0190 pragma Default_Storage_Pool (2010-09-15)*
- This AI introduces a new pragma `Default_Storage_Pool`, which can be
+ This AI introduces a new pragma ``Default_Storage_Pool``, which can be
used to control storage pools globally.
In particular, you can force every access
type that is used for allocation (**new**) to have an explicit storage pool,
@@ -1281,7 +1281,7 @@ Supported Aspect Source
* *AI-0189 No_Allocators_After_Elaboration (2010-01-23)*
- This AI introduces a new restriction `No_Allocators_After_Elaboration`,
+ This AI introduces a new restriction ``No_Allocators_After_Elaboration``,
which says that no dynamic allocation will occur once elaboration is
completed.
In general this requires a run-time check, which is not required, and which
@@ -1295,9 +1295,9 @@ Supported Aspect Source
* *AI-0171 Pragma CPU and Ravenscar Profile (2010-09-24)*
- A new package `System.Multiprocessors` is added, together with the
- definition of pragma `CPU` for controlling task affinity. A new no
- dependence restriction, on `System.Multiprocessors.Dispatching_Domains`,
+ A new package ``System.Multiprocessors`` is added, together with the
+ definition of pragma ``CPU`` for controlling task affinity. A new no
+ dependence restriction, on ``System.Multiprocessors.Dispatching_Domains``,
is added to the Ravenscar profile.
RM References: D.13.01 (4/2) D.16
@@ -1324,7 +1324,7 @@ Supported Aspect Source
* *AI-0152 Restriction No_Anonymous_Allocators (2010-09-08)*
- Restriction `No_Anonymous_Allocators` prevents the use of allocators
+ Restriction ``No_Anonymous_Allocators`` prevents the use of allocators
where the type of the returned value is an anonymous access type.
RM References: H.04 (8/1)
diff --git a/gcc/ada/doc/gnat_rm/implementation_of_specific_ada_features.rst b/gcc/ada/doc/gnat_rm/implementation_of_specific_ada_features.rst
index 979752f..3f55dc3 100644
--- a/gcc/ada/doc/gnat_rm/implementation_of_specific_ada_features.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_of_specific_ada_features.rst
@@ -14,7 +14,7 @@ Machine Code Insertions
.. index:: Machine Code insertions
-Package `Machine_Code` provides machine code support as described
+Package ``Machine_Code`` provides machine code support as described
in the Ada Reference Manual in two separate forms:
*
@@ -30,12 +30,12 @@ and use of the facilities in this package requires understanding the asm
instruction, see the section on Extended Asm in
:title:`Using_the_GNU_Compiler_Collection_(GCC)`.
-Calls to the function `Asm` and the procedure `Asm` have identical
+Calls to the function ``Asm`` and the procedure ``Asm`` have identical
semantic restrictions and effects as described below. Both are provided so
that the procedure call can be used as a statement, and the function call
can be used to form a code_statement.
-Consider this C `asm` instruction:
+Consider this C ``asm`` instruction:
::
@@ -51,14 +51,14 @@ The equivalent can be written for GNAT as:
My_Float'Asm_Input ("f", angle));
-The first argument to `Asm` is the assembler template, and is
+The first argument to ``Asm`` is the assembler template, and is
identical to what is used in GNU C. This string must be a static
expression. The second argument is the output operand list. It is
-either a single `Asm_Output` attribute reference, or a list of such
+either a single ``Asm_Output`` attribute reference, or a list of such
references enclosed in parentheses (technically an array aggregate of
such references).
-The `Asm_Output` attribute denotes a function that takes two
+The ``Asm_Output`` attribute denotes a function that takes two
parameters. The first is a string, the second is the name of a variable
of the type designated by the attribute prefix. The first (string)
argument is required to be a static expression and designates the
@@ -69,19 +69,19 @@ argument is the variable to be written or updated with the
result. The possible values for constraint are the same as those used in
the RTL, and are dependent on the configuration file used to build the
GCC back end. If there are no output operands, then this argument may
-either be omitted, or explicitly given as `No_Output_Operands`.
+either be omitted, or explicitly given as ``No_Output_Operands``.
No support is provided for GNU C's symbolic names for output parameters.
The second argument of ``my_float'Asm_Output`` functions as
-though it were an `out` parameter, which is a little curious, but
+though it were an ``out`` parameter, which is a little curious, but
all names have the form of expressions, so there is no syntactic
irregularity, even though normally functions would not be permitted
-`out` parameters. The third argument is the list of input
-operands. It is either a single `Asm_Input` attribute reference, or
+``out`` parameters. The third argument is the list of input
+operands. It is either a single ``Asm_Input`` attribute reference, or
a list of such references enclosed in parentheses (technically an array
aggregate of such references).
-The `Asm_Input` attribute denotes a function that takes two
+The ``Asm_Input`` attribute denotes a function that takes two
parameters. The first is a string, the second is an expression of the
type designated by the prefix. The first (string) argument is required
to be a static expression, and is the constraint for the parameter,
@@ -92,19 +92,19 @@ the configuration file used to built the GCC back end.
No support is provided for GNU C's symbolic names for input parameters.
If there are no input operands, this argument may either be omitted, or
-explicitly given as `No_Input_Operands`. The fourth argument, not
+explicitly given as ``No_Input_Operands``. The fourth argument, not
present in the above example, is a list of register names, called the
*clobber* argument. This argument, if given, must be a static string
expression, and is a space or comma separated list of names of registers
-that must be considered destroyed as a result of the `Asm` call. If
+that must be considered destroyed as a result of the ``Asm`` call. If
this argument is the null string (the default value), then the code
generator assumes that no additional registers are destroyed.
-In addition to registers, the special clobbers `memory` and
-`cc` as described in the GNU C docs are both supported.
+In addition to registers, the special clobbers ``memory`` and
+``cc`` as described in the GNU C docs are both supported.
The fifth argument, not present in the above example, called the
-*volatile* argument, is by default `False`. It can be set to
-the literal value `True` to indicate to the code generator that all
+*volatile* argument, is by default ``False``. It can be set to
+the literal value ``True`` to indicate to the code generator that all
optimizations with respect to the instruction specified should be
suppressed, and in particular an instruction that has outputs
will still be generated, even if none of the outputs are
@@ -114,14 +114,14 @@ Generally it is strongly advisable to use Volatile for any ASM statement
that is missing either input or output operands or to avoid unwanted
optimizations. A warning is generated if this advice is not followed.
-No support is provided for GNU C's `asm goto` feature.
+No support is provided for GNU C's ``asm goto`` feature.
-The `Asm` subprograms may be used in two ways. First the procedure
+The ``Asm`` subprograms may be used in two ways. First the procedure
forms can be used anywhere a procedure call would be valid, and
correspond to what the RM calls 'intrinsic' routines. Such calls can
be used to intersperse machine instructions with other Ada statements.
Second, the function forms, which return a dummy value of the limited
-private type `Asm_Insn`, can be used in code statements, and indeed
+private type ``Asm_Insn``, can be used in code statements, and indeed
this is the only context where such calls are allowed. Code statements
appear as aggregates of the form:
@@ -137,7 +137,7 @@ not permissible to intermix such statements with other Ada statements.
Typically the form using intrinsic procedure calls is more convenient
and more flexible. The code statement form is provided to meet the RM
suggestion that such a facility should be made available. The following
-is the exact syntax of the call to `Asm`. As usual, if named notation
+is the exact syntax of the call to ``Asm``. As usual, if named notation
is used, the arguments may be given in arbitrary order, following the
normal rules for use of positional and named arguments:
@@ -166,10 +166,10 @@ normal rules for use of positional and named arguments:
INPUT_OPERAND_ATTRIBUTE ::=
SUBTYPE_MARK'Asm_Input (static_string_EXPRESSION, EXPRESSION)
-The identifiers `No_Input_Operands` and `No_Output_Operands`
-are declared in the package `Machine_Code` and must be referenced
+The identifiers ``No_Input_Operands`` and ``No_Output_Operands``
+are declared in the package ``Machine_Code`` and must be referenced
according to normal visibility rules. In particular if there is no
-`use` clause for this package, then appropriate package name
+``use`` clause for this package, then appropriate package name
qualification is required.
.. _GNAT_Implementation_of_Tasking:
@@ -251,7 +251,7 @@ the underlying threads has significant advantages, it does create some
complications when it comes to respecting the scheduling semantics
specified in the real-time annex (Annex D).
-For instance the Annex D requirement for the `FIFO_Within_Priorities`
+For instance the Annex D requirement for the ``FIFO_Within_Priorities``
scheduling policy states:
*When the active priority of a ready task that is not running
@@ -293,22 +293,31 @@ Support for Locking Policies
This section specifies which policies specified by pragma Locking_Policy
are supported on which platforms.
-GNAT supports the standard `Ceiling_Locking` policy, and the
-implementation defined `Inheritance_Locking` and
-`Concurrent_Readers_Locking` policies.
+GNAT supports the standard ``Ceiling_Locking`` policy, and the
+implementation defined ``Inheritance_Locking`` and
+``Concurrent_Readers_Locking`` policies.
-`Ceiling_Locking` is supported on all platforms if the operating system
-supports it. In particular, `Ceiling_Locking` is not supported on
+``Ceiling_Locking`` is supported on all platforms if the operating system
+supports it. In particular, ``Ceiling_Locking`` is not supported on
VxWorks.
-`Inheritance_Locking` is supported on
+``Inheritance_Locking`` is supported on
Linux,
Darwin (Mac OS X),
LynxOS 178,
and VxWorks.
-`Concurrent_Readers_Locking` is supported on Linux.
-
-Note that on Linux, `Ceiling_Locking` requires the program to be running
-with root privileges. Otherwise, the policy is ignored.
+``Concurrent_Readers_Locking`` is supported on Linux.
+
+Notes about ``Ceiling_Locking`` on Linux:
+If the process is running as 'root', ceiling locking is used.
+If the capabilities facility is installed
+("sudo apt-get --assume-yes install libcap-dev" on Ubuntu,
+for example),
+and the program is linked against that library
+("-largs -lcap"),
+and the executable file has the cap_sys_nice capability
+("sudo /sbin/setcap cap_sys_nice=ep executable_file_name"),
+then ceiling locking is used.
+Otherwise, the ``Ceiling_Locking`` policy is ignored.
.. _GNAT_Implementation_of_Shared_Passive_Packages:
@@ -318,7 +327,7 @@ GNAT Implementation of Shared Passive Packages
.. index:: Shared passive packages
GNAT fully implements the :index:`pragma <pragma Shared_Passive>`
-`Shared_Passive` for
+``Shared_Passive`` for
the purpose of designating shared passive packages.
This allows the use of passive partitions in the
context described in the Ada Reference Manual; i.e., for communication
@@ -353,7 +362,7 @@ written.
.. index:: SHARED_MEMORY_DIRECTORY environment variable
-The environment variable `SHARED_MEMORY_DIRECTORY` should be
+The environment variable ``SHARED_MEMORY_DIRECTORY`` should be
set to the directory to be used for these files.
The files in this directory
have names that correspond to their fully qualified names. For
@@ -367,7 +376,7 @@ example, if we have the package
Z : Float;
end X;
-and the environment variable is set to `/stemp/`, then the files created
+and the environment variable is set to ``/stemp/``, then the files created
will have the names:
::
@@ -384,7 +393,7 @@ will be used. This model ensures that there are no issues in synchronizing
the elaboration process, since elaboration of passive packages elaborates the
initial values, but does not create the files.
-The files are written using normal `Stream_IO` access.
+The files are written using normal ``Stream_IO`` access.
If you want to be able
to communicate between programs or partitions running on different
architectures, then you should use the XDR versions of the stream attribute
@@ -487,7 +496,7 @@ Constant aggregates with unconstrained nominal types
----------------------------------------------------
In such cases the aggregate itself establishes the subtype, so that
-associations with `others` cannot be used. GNAT determines the
+associations with ``others`` cannot be used. GNAT determines the
bounds for the actual subtype of the aggregate, and allocates the
aggregate statically as well. No code is generated for the following:
@@ -587,7 +596,7 @@ that temporary will be copied onto the target.
The Size of Discriminated Records with Default Discriminants
============================================================
-If a discriminated type `T` has discriminants with default values, it is
+If a discriminated type ``T`` has discriminants with default values, it is
possible to declare an object of this type without providing an explicit
constraint:
@@ -620,12 +629,12 @@ that depend on it:
In order to support this behavior efficiently, an unconstrained object is
given the maximum size that any value of the type requires. In the case
-above, `Word` has storage for the discriminant and for
-a `String` of length 100.
+above, ``Word`` has storage for the discriminant and for
+a ``String`` of length 100.
It is important to note that unconstrained objects do not require dynamic
allocation. It would be an improper implementation to place on the heap those
components whose size depends on discriminants. (This improper implementation
-was used by some Ada83 compilers, where the `Name` component above
+was used by some Ada83 compilers, where the ``Name`` component above
would have
been stored as a pointer to a dynamic string). Following the principle that
dynamic storage management should never be introduced implicitly,
@@ -651,13 +660,13 @@ declaration:
Too_Large : Rec;
is flagged by the compiler with a warning:
-an attempt to create `Too_Large` will raise `Storage_Error`,
-because the required size includes `Positive'Last`
+an attempt to create ``Too_Large`` will raise ``Storage_Error``,
+because the required size includes ``Positive'Last``
bytes. As the first example indicates, the proper approach is to declare an
index type of 'reasonable' range so that unconstrained objects are not too
large.
-One final wrinkle: if the object is declared to be `aliased`, or if it is
+One final wrinkle: if the object is declared to be ``aliased``, or if it is
created in the heap by means of an allocator, then it is *not*
unconstrained:
it is constrained by the default values of the discriminants, and those values
@@ -685,8 +694,8 @@ calls and generic instantiations (*-gnatE*), and stack overflow checking
(*-fstack-check*).
Note that the result of a floating point arithmetic operation in overflow and
-invalid situations, when the `Machine_Overflows` attribute of the result
-type is `False`, is to generate IEEE NaN and infinite values. This is the
+invalid situations, when the ``Machine_Overflows`` attribute of the result
+type is ``False``, is to generate IEEE NaN and infinite values. This is the
case for machines compliant with the IEEE floating-point standard, but on
machines that are not fully compliant with this standard, such as Alpha, the
*-mieee* compiler flag must be used for achieving IEEE confirming
diff --git a/gcc/ada/doc/gnat_rm/interfacing_to_other_languages.rst b/gcc/ada/doc/gnat_rm/interfacing_to_other_languages.rst
index 63fd5ff..bb629f4 100644
--- a/gcc/ada/doc/gnat_rm/interfacing_to_other_languages.rst
+++ b/gcc/ada/doc/gnat_rm/interfacing_to_other_languages.rst
@@ -16,13 +16,13 @@ Interfacing to C
Interfacing to C with GNAT can use one of two approaches:
*
- The types in the package `Interfaces.C` may be used.
+ The types in the package ``Interfaces.C`` may be used.
*
Standard Ada types may be used directly. This may be less portable to
other compilers, but will work on all GNAT compilers, which guarantee
correspondence between the C and Ada types.
-Pragma `Convention C` may be applied to Ada types, but mostly has no
+Pragma ``Convention C`` may be applied to Ada types, but mostly has no
effect, since this is the default. The following table shows the
correspondence between Ada scalar types and the corresponding C types.
@@ -46,11 +46,11 @@ and C types:
*
Ada enumeration types map to C enumeration types directly if pragma
- `Convention C` is specified, which causes them to have int
- length. Without pragma `Convention C`, Ada enumeration types map to
- 8, 16, or 32 bits (i.e., C types `signed char`, `short`,
- `int`, respectively) depending on the number of values passed.
- This is the only case in which pragma `Convention C` affects the
+ ``Convention C`` is specified, which causes them to have int
+ length. Without pragma ``Convention C``, Ada enumeration types map to
+ 8, 16, or 32 bits (i.e., C types ``signed char``, ``short``,
+ ``int``, respectively) depending on the number of values passed.
+ This is the only case in which pragma ``Convention C`` affects the
representation of an Ada type.
*
@@ -80,29 +80,29 @@ Using these pragmas it is possible to achieve complete
inter-operability between Ada tagged types and C++ class definitions.
See :ref:`Implementation_Defined_Pragmas`, for more details.
-*pragma CPP_Class ([Entity =>] `LOCAL_NAME`)*
+:samp:`pragma CPP_Class ([Entity =>] {LOCAL_NAME})`
The argument denotes an entity in the current declarative region that is
declared as a tagged or untagged record type. It indicates that the type
corresponds to an externally declared C++ class type, and is to be laid
out the same way that C++ would lay out the type.
- Note: Pragma `CPP_Class` is currently obsolete. It is supported
+ Note: Pragma ``CPP_Class`` is currently obsolete. It is supported
for backward compatibility but its functionality is available
- using pragma `Import` with `Convention` = `CPP`.
+ using pragma ``Import`` with ``Convention`` = ``CPP``.
-*pragma CPP_Constructor ([Entity =>] `LOCAL_NAME`)*
+:samp:`pragma CPP_Constructor ([Entity =>] {LOCAL_NAME})`
This pragma identifies an imported function (imported in the usual way
- with pragma `Import`) as corresponding to a C++ constructor.
+ with pragma ``Import``) as corresponding to a C++ constructor.
-A few restrictions are placed on the use of the `Access` attribute
-in conjunction with subprograms subject to convention `CPP`: the
+A few restrictions are placed on the use of the ``Access`` attribute
+in conjunction with subprograms subject to convention ``CPP``: the
attribute may be used neither on primitive operations of a tagged
-record type with convention `CPP`, imported or not, nor on
-subprograms imported with pragma `CPP_Constructor`.
+record type with convention ``CPP``, imported or not, nor on
+subprograms imported with pragma ``CPP_Constructor``.
In addition, C++ exceptions are propagated and can be handled in an
-`others` choice of an exception handler. The corresponding Ada
+``others`` choice of an exception handler. The corresponding Ada
occurrence has no message, and the simple name of the exception identity
contains ``Foreign_Exception``. Finalization and awaiting dependent
tasks works properly when such foreign exceptions are propagated.
@@ -118,7 +118,7 @@ It is also possible to import a C++ exception using the following syntax:
[External_Name =>] static_string_EXPRESSION);
-The `External_Name` is the name of the C++ RTTI symbol. You can then
+The ``External_Name`` is the name of the C++ RTTI symbol. You can then
cover a specific C++ exception in an exception handler.
.. _Interfacing_to_COBOL:
@@ -135,7 +135,7 @@ Interfacing to Fortran
======================
Interfacing to Fortran is achieved as described in section B.5 of the
-Ada Reference Manual. The pragma `Convention Fortran`, applied to a
+Ada Reference Manual. The pragma ``Convention Fortran``, applied to a
multi-dimensional array causes the array to be stored in column-major
order as required for convenient interface to Fortran.
@@ -144,8 +144,8 @@ order as required for convenient interface to Fortran.
Interfacing to non-GNAT Ada code
================================
-It is possible to specify the convention `Ada` in a pragma
-`Import` or pragma `Export`. However this refers to
+It is possible to specify the convention ``Ada`` in a pragma
+``Import`` or pragma ``Export``. However this refers to
the calling conventions used by GNAT, which may or may not be
similar enough to those used by some other Ada 83 / Ada 95 / Ada 2005
compiler to allow interoperation.
diff --git a/gcc/ada/doc/gnat_rm/intrinsic_subprograms.rst b/gcc/ada/doc/gnat_rm/intrinsic_subprograms.rst
index 1558d06..f5f8463 100644
--- a/gcc/ada/doc/gnat_rm/intrinsic_subprograms.rst
+++ b/gcc/ada/doc/gnat_rm/intrinsic_subprograms.rst
@@ -31,13 +31,13 @@ Intrinsic Operators
.. index:: Intrinsic operator
All the predefined numeric operators in package Standard
-in `pragma Import (Intrinsic,..)`
+in ``pragma Import (Intrinsic,..)``
declarations. In the binary operator case, the operands must have the same
size. The operand or operands must also be appropriate for
the operator. For example, for addition, the operands must
both be floating-point or both be fixed-point, and the
-right operand for `"**"` must have a root type of
-`Standard.Integer'Base`.
+right operand for ``"**"`` must have a root type of
+``Standard.Integer'Base``.
You can use an intrinsic operator declaration as in the following example:
@@ -52,7 +52,7 @@ You can use an intrinsic operator declaration as in the following example:
This declaration would permit 'mixed mode' arithmetic on items
-of the differing types `Int1` and `Int2`.
+of the differing types ``Int1`` and ``Int2``.
It is also possible to specify such operators for private types, if the
full views are appropriate arithmetic types.
@@ -64,11 +64,11 @@ Compilation_Date
.. index:: Compilation_Date
This intrinsic subprogram is used in the implementation of the
-library package `GNAT.Source_Info`. The only useful use of the
+library package ``GNAT.Source_Info``. The only useful use of the
intrinsic import in this case is the one in this unit, so an
application program should simply call the function
-`GNAT.Source_Info.Compilation_Date` to obtain the date of
-the current compilation (in local time format MMM DD YYYY).
+``GNAT.Source_Info.Compilation_ISO_Date`` to obtain the date of
+the current compilation (in local time format YYYY-MM-DD).
.. _Compilation_Time:
@@ -78,10 +78,10 @@ Compilation_Time
.. index:: Compilation_Time
This intrinsic subprogram is used in the implementation of the
-library package `GNAT.Source_Info`. The only useful use of the
+library package ``GNAT.Source_Info``. The only useful use of the
intrinsic import in this case is the one in this unit, so an
application program should simply call the function
-`GNAT.Source_Info.Compilation_Time` to obtain the time of
+``GNAT.Source_Info.Compilation_Time`` to obtain the time of
the current compilation (in local time format HH:MM:SS).
.. _Enclosing_Entity:
@@ -92,10 +92,10 @@ Enclosing_Entity
.. index:: Enclosing_Entity
This intrinsic subprogram is used in the implementation of the
-library package `GNAT.Source_Info`. The only useful use of the
+library package ``GNAT.Source_Info``. The only useful use of the
intrinsic import in this case is the one in this unit, so an
application program should simply call the function
-`GNAT.Source_Info.Enclosing_Entity` to obtain the name of
+``GNAT.Source_Info.Enclosing_Entity`` to obtain the name of
the current subprogram, package, task, entry, or protected subprogram.
.. _Exception_Information:
@@ -106,10 +106,10 @@ Exception_Information
.. index:: Exception_Information'
This intrinsic subprogram is used in the implementation of the
-library package `GNAT.Current_Exception`. The only useful
+library package ``GNAT.Current_Exception``. The only useful
use of the intrinsic import in this case is the one in this unit,
so an application program should simply call the function
-`GNAT.Current_Exception.Exception_Information` to obtain
+``GNAT.Current_Exception.Exception_Information`` to obtain
the exception information associated with the current exception.
.. _Exception_Message:
@@ -120,10 +120,10 @@ Exception_Message
.. index:: Exception_Message
This intrinsic subprogram is used in the implementation of the
-library package `GNAT.Current_Exception`. The only useful
+library package ``GNAT.Current_Exception``. The only useful
use of the intrinsic import in this case is the one in this unit,
so an application program should simply call the function
-`GNAT.Current_Exception.Exception_Message` to obtain
+``GNAT.Current_Exception.Exception_Message`` to obtain
the message associated with the current exception.
.. _Exception_Name:
@@ -134,10 +134,10 @@ Exception_Name
.. index:: Exception_Name
This intrinsic subprogram is used in the implementation of the
-library package `GNAT.Current_Exception`. The only useful
+library package ``GNAT.Current_Exception``. The only useful
use of the intrinsic import in this case is the one in this unit,
so an application program should simply call the function
-`GNAT.Current_Exception.Exception_Name` to obtain
+``GNAT.Current_Exception.Exception_Name`` to obtain
the name of the current exception.
.. _File:
@@ -148,10 +148,10 @@ File
.. index:: File
This intrinsic subprogram is used in the implementation of the
-library package `GNAT.Source_Info`. The only useful use of the
+library package ``GNAT.Source_Info``. The only useful use of the
intrinsic import in this case is the one in this unit, so an
application program should simply call the function
-`GNAT.Source_Info.File` to obtain the name of the current
+``GNAT.Source_Info.File`` to obtain the name of the current
file.
.. _Line:
@@ -162,10 +162,10 @@ Line
.. index:: Line
This intrinsic subprogram is used in the implementation of the
-library package `GNAT.Source_Info`. The only useful use of the
+library package ``GNAT.Source_Info``. The only useful use of the
intrinsic import in this case is the one in this unit, so an
application program should simply call the function
-`GNAT.Source_Info.Line` to obtain the number of the current
+``GNAT.Source_Info.Line`` to obtain the number of the current
source line.
.. _Shifts_and_Rotates:
@@ -184,7 +184,7 @@ Shifts and Rotates
.. index:: Rotate_Right
In standard Ada, the shift and rotate functions are available only
-for the predefined modular types in package `Interfaces`. However, in
+for the predefined modular types in package ``Interfaces``. However, in
GNAT it is possible to define these functions for any integer
type (signed or modular), as in this example:
@@ -201,7 +201,7 @@ Shift_Left, Shift_Right, Shift_Right_Arithmetic, Rotate_Left, or
Rotate_Right. T must be an integer type. T'Size must be
8, 16, 32 or 64 bits; if T is modular, the modulus
must be 2**8, 2**16, 2**32 or 2**64.
-The result type must be the same as the type of `Value`.
+The result type must be the same as the type of ``Value``.
The shift amount must be Natural.
The formal parameter names can be anything.
@@ -217,9 +217,9 @@ Source_Location
.. index:: Source_Location
This intrinsic subprogram is used in the implementation of the
-library routine `GNAT.Source_Info`. The only useful use of the
+library routine ``GNAT.Source_Info``. The only useful use of the
intrinsic import in this case is the one in this unit, so an
application program should simply call the function
-`GNAT.Source_Info.Source_Location` to obtain the current
+``GNAT.Source_Info.Source_Location`` to obtain the current
source file location.
diff --git a/gcc/ada/doc/gnat_rm/obsolescent_features.rst b/gcc/ada/doc/gnat_rm/obsolescent_features.rst
index 6c9b61e..2082a2a 100644
--- a/gcc/ada/doc/gnat_rm/obsolescent_features.rst
+++ b/gcc/ada/doc/gnat_rm/obsolescent_features.rst
@@ -14,7 +14,7 @@ compatibility purposes.
pragma No_Run_Time
==================
-The pragma `No_Run_Time` is used to achieve an affect similar
+The pragma ``No_Run_Time`` is used to achieve an affect similar
to the use of the "Zero Foot Print" configurable run time, but without
requiring a specially configured run time. The result of using this
pragma, which must be used for all units in a partition, is to restrict
@@ -27,8 +27,8 @@ includes just those features that are to be made accessible.
pragma Ravenscar
================
-The pragma `Ravenscar` has exactly the same effect as pragma
-`Profile (Ravenscar)`. The latter usage is preferred since it
+The pragma ``Ravenscar`` has exactly the same effect as pragma
+``Profile (Ravenscar)``. The latter usage is preferred since it
is part of the new Ada 2005 standard.
.. _pragma_Restricted_Run_Time:
@@ -36,9 +36,9 @@ is part of the new Ada 2005 standard.
pragma Restricted_Run_Time
==========================
-The pragma `Restricted_Run_Time` has exactly the same effect as
-pragma `Profile (Restricted)`. The latter usage is
-preferred since the Ada 2005 pragma `Profile` is intended for
+The pragma ``Restricted_Run_Time`` has exactly the same effect as
+pragma ``Profile (Restricted)``. The latter usage is
+preferred since the Ada 2005 pragma ``Profile`` is intended for
this kind of implementation dependent addition.
.. _pragma_Task_Info:
@@ -46,9 +46,9 @@ this kind of implementation dependent addition.
pragma Task_Info
================
-The functionality provided by pragma `Task_Info` is now part of the
-Ada language. The `CPU` aspect and the package
-`System.Multiprocessors` offer a less system-dependent way to specify
+The functionality provided by pragma ``Task_Info`` is now part of the
+Ada language. The ``CPU`` aspect and the package
+``System.Multiprocessors`` offer a less system-dependent way to specify
task affinity or to query the number of processsors.
Syntax
@@ -58,9 +58,9 @@ Syntax
pragma Task_Info (EXPRESSION);
This pragma appears within a task definition (like pragma
-`Priority`) and applies to the task in which it appears. The
-argument must be of type `System.Task_Info.Task_Info_Type`.
-The `Task_Info` pragma provides system dependent control over
+``Priority``) and applies to the task in which it appears. The
+argument must be of type ``System.Task_Info.Task_Info_Type``.
+The ``Task_Info`` pragma provides system dependent control over
aspects of tasking implementation, for example, the ability to map
tasks to specific processors. For details on the facilities available
for the version of GNAT that you are using, see the documentation
@@ -73,9 +73,9 @@ package System.Task_Info (:file:`s-tasinf.ads`)
===============================================
This package provides target dependent functionality that is used
-to support the `Task_Info` pragma. The predefined Ada package
-`System.Multiprocessors` and the `CPU` aspect now provide a
-standard replacement for GNAT's `Task_Info` functionality.
+to support the ``Task_Info`` pragma. The predefined Ada package
+``System.Multiprocessors`` and the ``CPU`` aspect now provide a
+standard replacement for GNAT's ``Task_Info`` functionality.
.. raw:: latex
diff --git a/gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst b/gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst
index 72987b4..8ff5224 100644
--- a/gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst
+++ b/gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. _Representation_Clauses_and_Pragmas:
**********************************
@@ -35,17 +37,17 @@ values are as follows:
* *Elementary Types*.
For elementary types, the alignment is the minimum of the actual size of
- objects of the type divided by `Storage_Unit`,
+ 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
- `Standard'Maximum_Alignment`; see :ref:`Attribute_Maximum_Alignment`.)
+ ``Standard'Maximum_Alignment``; see :ref:`Attribute_Maximum_Alignment`.)
.. index:: Maximum_Alignment attribute
- For example, for type `Long_Float`, the object size is 8 bytes, and the
+ For example, for type ``Long_Float``, the object size is 8 bytes, and the
default alignment will be 8 on any target that supports alignments
this large, but on some targets, the maximum alignment may be smaller
- than 8, in which case objects of type `Long_Float` will be maximally
+ than 8, in which case objects of type ``Long_Float`` will be maximally
aligned.
* *Arrays*.
@@ -64,9 +66,9 @@ values are as follows:
For the normal non-packed case, the alignment of a record is equal to
the maximum alignment of any of its components. For tagged records, this
- includes the implicit access type used for the tag. If a pragma `Pack`
+ includes the implicit access type used for the tag. If a pragma ``Pack``
is used and all components are packable (see separate section on pragma
- `Pack`), then the resulting alignment is 1, unless the layout of the
+ ``Pack``), then the resulting alignment is 1, unless the layout of the
record makes it profitable to increase it.
A special case is when:
@@ -86,14 +88,14 @@ values are as follows:
end record;
for Small'Size use 16;
- then the default alignment of the record type `Small` is 2, not 1. This
+ then the default alignment of the record type ``Small`` is 2, not 1. This
leads to more efficient code when the record is treated as a unit, and also
- allows the type to specified as `Atomic` on architectures requiring
+ allows the type to specified as ``Atomic`` on architectures requiring
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
+attribute reference ``Standard'Maximum_Alignment``). 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
@@ -107,7 +109,7 @@ fixed point types, as well as for record types, for example
.. index:: Alignment, default
-The default alignment for the type `V` is 4, as a result of the
+The default alignment for the type ``V`` is 4, as a result of the
Integer field in the record, but it is permissible, as shown, to
override the default alignment of the record with a smaller value.
@@ -125,15 +127,15 @@ to control this choice. Consider:
subtype RS is R range 1 .. 1000;
The alignment clause specifies an alignment of 1 for the first named subtype
-`R` but this does not necessarily apply to `RS`. When writing
+``R`` but this does not necessarily apply to ``RS``. When writing
portable Ada code, you should avoid writing code that explicitly or
implicitly relies on the alignment of such subtypes.
For the GNAT compiler, if an explicit alignment clause is given, this
value is also used for any subsequent subtypes. So for GNAT, in the
-above example, you can count on the alignment of `RS` being 1. But this
+above example, you can count on the alignment of ``RS`` being 1. But this
assumption is non-portable, and other compilers may choose different
-alignments for the subtype `RS`.
+alignments for the subtype ``RS``.
.. _Size_Clauses:
@@ -142,13 +144,13 @@ Size Clauses
.. index:: Size Clause
-The default size for a type `T` is obtainable through the
-language-defined attribute `T'Size` and also through the
-equivalent GNAT-defined attribute `T'Value_Size`.
-For objects of type `T`, GNAT will generally increase the type size
+The default size for a type ``T`` is obtainable through the
+language-defined attribute ``T'Size`` and also through the
+equivalent GNAT-defined attribute ``T'Value_Size``.
+For objects of type ``T``, GNAT will generally increase the type size
so that the object size (obtainable through the GNAT-defined attribute
-`T'Object_Size`)
-is a multiple of `T'Alignment * Storage_Unit`.
+``T'Object_Size``)
+is a multiple of ``T'Alignment * Storage_Unit``.
For example:
@@ -161,27 +163,27 @@ For example:
Y2 : boolean;
end record;
-In this example, `Smallint'Size` = `Smallint'Value_Size` = 3,
+In this example, ``Smallint'Size`` = ``Smallint'Value_Size`` = 3,
as specified by the RM rules,
but objects of this type will have a size of 8
-(`Smallint'Object_Size` = 8),
+(``Smallint'Object_Size`` = 8),
since objects by default occupy an integral number
of storage units. On some targets, notably older
versions of the Digital Alpha, the size of stand
alone objects of this type may be 32, reflecting
the inability of the hardware to do byte load/stores.
-Similarly, the size of type `Rec` is 40 bits
-(`Rec'Size` = `Rec'Value_Size` = 40), but
+Similarly, the size of type ``Rec`` is 40 bits
+(``Rec'Size`` = ``Rec'Value_Size`` = 40), but
the alignment is 4, so objects of this type will have
their size increased to 64 bits so that it is a multiple
of the alignment (in bits). This decision is
in accordance with the specific Implementation Advice in RM 13.3(43):
- "A `Size` clause should be supported for an object if the specified
- `Size` is at least as large as its subtype's `Size`, and corresponds
+ "A ``Size`` clause should be supported for an object if the specified
+ ``Size`` is at least as large as its subtype's ``Size``, and corresponds
to a size in storage elements that is a multiple of the object's
- `Alignment` (if the `Alignment` is nonzero)."
+ ``Alignment`` (if the ``Alignment`` is nonzero)."
An explicit size clause may be used to override the default size by
increasing it. For example, if we have:
@@ -217,11 +219,11 @@ Storage_Size Clauses
.. index:: Storage_Size Clause
-For tasks, the `Storage_Size` clause specifies the amount of space
+For tasks, the ``Storage_Size`` clause specifies the amount of space
to be allocated for the task stack. This cannot be extended, and if the
-stack is exhausted, then `Storage_Error` will be raised (if stack
-checking is enabled). Use a `Storage_Size` attribute definition clause,
-or a `Storage_Size` pragma in the task definition to set the
+stack is exhausted, then ``Storage_Error`` will be raised (if stack
+checking is enabled). Use a ``Storage_Size`` attribute definition clause,
+or a ``Storage_Size`` pragma in the task definition to set the
appropriate required size. A useful technique is to include in every
task definition a pragma of the form:
@@ -229,24 +231,24 @@ task definition a pragma of the form:
pragma Storage_Size (Default_Stack_Size);
-Then `Default_Stack_Size` can be defined in a global package, and
+Then ``Default_Stack_Size`` can be defined in a global package, and
modified as required. Any tasks requiring stack sizes different from the
default can have an appropriate alternative reference in the pragma.
You can also use the *-d* binder switch to modify the default stack
size.
-For access types, the `Storage_Size` clause specifies the maximum
+For access types, the ``Storage_Size`` clause specifies the maximum
space available for allocation of objects of the type. If this space is
-exceeded then `Storage_Error` will be raised by an allocation attempt.
+exceeded then ``Storage_Error`` will be raised by an allocation attempt.
In the case where the access type is declared local to a subprogram, the
-use of a `Storage_Size` clause triggers automatic use of a special
-predefined storage pool (`System.Pool_Size`) that ensures that all
+use of a ``Storage_Size`` clause triggers automatic use of a special
+predefined storage pool (``System.Pool_Size``) that ensures that all
space for the pool is automatically reclaimed on exit from the scope in
which the type is declared.
A special case recognized by the compiler is the specification of a
-`Storage_Size` of zero for an access type. This means that no
+``Storage_Size`` of zero for an access type. This means that no
items can be allocated from the pool, and this is recognized at compile
time, and all the overhead normally associated with maintaining a fixed
size storage pool is eliminated. Consider the following example:
@@ -336,7 +338,7 @@ variant value to V2, therefore 16 bits must be allocated for V2
in the general case, even fewer bits may be needed at any particular
point during the program execution.
-As can be seen from the output of this program, the `'Size`
+As can be seen from the output of this program, the ``'Size``
attribute applied to such an object in GNAT gives the actual allocated
size of the variable, which is the largest size of any of the variants.
The Ada Reference Manual is not completely clear on what choice should
@@ -387,9 +389,9 @@ The output from this program is
16
16
-Here we see that while the `'Size` attribute always returns
+Here we see that while the ``'Size`` attribute always returns
the maximum size, regardless of the current variant value, the
-`Size` function does indeed return the size of the current
+``Size`` function does indeed return the size of the current
variant value.
@@ -415,7 +417,7 @@ For example, suppose we have the declaration:
type Small is range -7 .. -4;
for Small'Size use 2;
-Although the default size of type `Small` is 4, the `Size`
+Although the default size of type ``Small`` is 4, the ``Size``
clause is accepted by GNAT and results in the following representation
scheme:
@@ -426,7 +428,7 @@ scheme:
-5 is represented as 2#10#
-4 is represented as 2#11#
-Biased representation is only used if the specified `Size` clause
+Biased representation is only used if the specified ``Size`` clause
cannot be accepted in any other manner. These reduced sizes that force
biased representation can be used for all discrete types except for
enumeration types for which a representation clause is given.
@@ -441,13 +443,13 @@ Value_Size and Object_Size Clauses
.. index:: Object_Size
.. index:: Size, of objects
-In Ada 95 and Ada 2005, `T'Size` for a type `T` is the minimum
-number of bits required to hold values of type `T`.
+In Ada 95 and Ada 2005, ``T'Size`` for a type ``T`` is the minimum
+number of bits required to hold values of type ``T``.
Although this interpretation was allowed in Ada 83, it was not required,
and this requirement in practice can cause some significant difficulties.
-For example, in most Ada 83 compilers, `Natural'Size` was 32.
+For example, in most Ada 83 compilers, ``Natural'Size`` was 32.
However, in Ada 95 and Ada 2005,
-`Natural'Size` is
+``Natural'Size`` is
typically 31. This means that code may change in behavior when moving
from Ada 83 to Ada 95 or Ada 2005. For example, consider:
@@ -463,99 +465,99 @@ from Ada 83 to Ada 95 or Ada 2005. For example, consider:
at 0 range Natural'Size .. 2 * Natural'Size - 1;
end record;
-In the above code, since the typical size of `Natural` objects
-is 32 bits and `Natural'Size` is 31, the above code can cause
+In the above code, since the typical size of ``Natural`` objects
+is 32 bits and ``Natural'Size`` is 31, the above code can cause
unexpected inefficient packing in Ada 95 and Ada 2005, and in general
there are cases where the fact that the object size can exceed the
size of the type causes surprises.
To help get around this problem GNAT provides two implementation
-defined attributes, `Value_Size` and `Object_Size`. When
+defined attributes, ``Value_Size`` and ``Object_Size``. When
applied to a type, these attributes yield the size of the type
(corresponding to the RM defined size attribute), and the size of
objects of the type respectively.
-The `Object_Size` is used for determining the default size of
+The ``Object_Size`` is used for determining the default size of
objects and components. This size value can be referred to using the
-`Object_Size` attribute. The phrase 'is used' here means that it is
+``Object_Size`` attribute. The phrase 'is used' here means that it is
the basis of the determination of the size. The backend is free to
pad this up if necessary for efficiency, e.g., an 8-bit stand-alone
character might be stored in 32 bits on a machine with no efficient
byte access instructions such as the Alpha.
-The default rules for the value of `Object_Size` for
+The default rules for the value of ``Object_Size`` for
discrete types are as follows:
*
- The `Object_Size` for base subtypes reflect the natural hardware
+ The ``Object_Size`` for base subtypes reflect the natural hardware
size in bits (run the compiler with *-gnatS* to find those values
for numeric types). Enumeration types and fixed-point base subtypes have
8, 16, 32, or 64 bits for this size, depending on the range of values
to be stored.
*
- The `Object_Size` of a subtype is the same as the
- `Object_Size` of
+ The ``Object_Size`` of a subtype is the same as the
+ ``Object_Size`` of
the type from which it is obtained.
*
- The `Object_Size` of a derived base type is copied from the parent
- base type, and the `Object_Size` of a derived first subtype is copied
+ The ``Object_Size`` of a derived base type is copied from the parent
+ base type, and the ``Object_Size`` of a derived first subtype is copied
from the parent first subtype.
-The `Value_Size` attribute
+The ``Value_Size`` attribute
is the (minimum) number of bits required to store a value
of the type.
This value is used to determine how tightly to pack
records or arrays with components of this type, and also affects
the semantics of unchecked conversion (unchecked conversions where
-the `Value_Size` values differ generate a warning, and are potentially
+the ``Value_Size`` values differ generate a warning, and are potentially
target dependent).
-The default rules for the value of `Value_Size` are as follows:
+The default rules for the value of ``Value_Size`` are as follows:
*
- The `Value_Size` for a base subtype is the minimum number of bits
+ The ``Value_Size`` for a base subtype is the minimum number of bits
required to store all values of the type (including the sign bit
only if negative values are possible).
*
If a subtype statically matches the first subtype of a given type, then it has
- by default the same `Value_Size` as the first subtype. This is a
+ by default the same ``Value_Size`` as the first subtype. This is a
consequence of RM 13.1(14): "if two subtypes statically match,
then their subtype-specific aspects are the same".)
*
- All other subtypes have a `Value_Size` corresponding to the minimum
+ All other subtypes have a ``Value_Size`` corresponding to the minimum
number of bits required to store all values of the subtype. For
dynamic bounds, it is assumed that the value can range down or up
to the corresponding bound of the ancestor
-The RM defined attribute `Size` corresponds to the
-`Value_Size` attribute.
+The RM defined attribute ``Size`` corresponds to the
+``Value_Size`` attribute.
-The `Size` attribute may be defined for a first-named subtype. This sets
-the `Value_Size` of
+The ``Size`` attribute may be defined for a first-named subtype. This sets
+the ``Value_Size`` of
the first-named subtype to the given value, and the
-`Object_Size` of this first-named subtype to the given value padded up
+``Object_Size`` of this first-named subtype to the given value padded up
to an appropriate boundary. It is a consequence of the default rules
-above that this `Object_Size` will apply to all further subtypes. On the
-other hand, `Value_Size` is affected only for the first subtype, any
+above that this ``Object_Size`` will apply to all further subtypes. On the
+other hand, ``Value_Size`` is affected only for the first subtype, any
dynamic subtypes obtained from it directly, and any statically matching
-subtypes. The `Value_Size` of any other static subtypes is not affected.
+subtypes. The ``Value_Size`` of any other static subtypes is not affected.
-`Value_Size` and
-`Object_Size` may be explicitly set for any subtype using
+``Value_Size`` and
+``Object_Size`` may be explicitly set for any subtype using
an attribute definition clause. Note that the use of these attributes
can cause the RM 13.1(14) rule to be violated. If two access types
-reference aliased objects whose subtypes have differing `Object_Size`
+reference aliased objects whose subtypes have differing ``Object_Size``
values as a result of explicit attribute definition clauses, then it
is illegal to convert from one access subtype to the other. For a more
complete description of this additional legality rule, see the
-description of the `Object_Size` attribute.
+description of the ``Object_Size`` attribute.
To get a feel for the difference, consider the following examples (note
-that in each case the base is `Short_Short_Integer` with a size of 8):
+that in each case the base is ``Short_Short_Integer`` with a size of 8):
+---------------------------------------------+-------------+-------------+
|Type or subtype declaration | Object_Size | Value_Size|
@@ -582,22 +584,22 @@ case. What GNAT does is to allocate sufficient bits to accomodate any
possible dynamic values for the bounds at run-time.
So far, so good, but GNAT has to obey the RM rules, so the question is
-under what conditions must the RM `Size` be used.
+under what conditions must the RM ``Size`` be used.
The following is a list
-of the occasions on which the RM `Size` must be used:
+of the occasions on which the RM ``Size`` must be used:
*
Component size for packed arrays or records
*
- Value of the attribute `Size` for a type
+ Value of the attribute ``Size`` for a type
*
Warning about sizes not matching for unchecked conversion
-For record types, the `Object_Size` is always a multiple of the
+For record types, the ``Object_Size`` is always a multiple of the
alignment of the type (this is true for all types). In some cases the
-`Value_Size` can be smaller. Consider:
+``Value_Size`` can be smaller. Consider:
.. code-block:: ada
@@ -610,18 +612,18 @@ alignment of the type (this is true for all types). In some cases the
On a typical 32-bit architecture, the X component will be four bytes, and
require four-byte alignment, and the Y component will be one byte. In this
-case `R'Value_Size` will be 40 (bits) since this is the minimum size
+case ``R'Value_Size`` will be 40 (bits) since this is the minimum size
required to store a value of this type, and for example, it is permissible
to have a component of type R in an outer array whose component size is
-specified to be 48 bits. However, `R'Object_Size` will be 64 (bits),
+specified to be 48 bits. However, ``R'Object_Size`` will be 64 (bits),
since it must be rounded up so that this value is a multiple of the
alignment (4 bytes = 32 bits).
-For all other types, the `Object_Size`
-and `Value_Size` are the same (and equivalent to the RM attribute `Size`).
-Only `Size` may be specified for such types.
+For all other types, the ``Object_Size``
+and ``Value_Size`` are the same (and equivalent to the RM attribute ``Size``).
+Only ``Size`` may be specified for such types.
-Note that `Value_Size` can be used to force biased representation
+Note that ``Value_Size`` can be used to force biased representation
for a particular subtype. Consider this example:
@@ -632,12 +634,12 @@ for a particular subtype. Consider this example:
subtype REF is R range E .. F;
-By default, `RAB`
+By default, ``RAB``
has a size of 1 (sufficient to accommodate the representation
-of `A` and `B`, 0 and 1), and `REF`
+of ``A`` and ``B``, 0 and 1), and ``REF``
has a size of 3 (sufficient to accommodate the representation
-of `E` and `F`, 4 and 5). But if we add the
-following `Value_Size` attribute definition clause:
+of ``E`` and ``F``, 4 and 5). But if we add the
+following ``Value_Size`` attribute definition clause:
.. code-block:: ada
@@ -645,11 +647,11 @@ following `Value_Size` attribute definition clause:
for REF'Value_Size use 1;
-then biased representation is forced for `REF`,
-and 0 will represent `E` and 1 will represent `F`.
-A warning is issued when a `Value_Size` attribute
+then biased representation is forced for ``REF``,
+and 0 will represent ``E`` and 1 will represent ``F``.
+A warning is issued when a ``Value_Size`` attribute
definition clause forces biased representation. This
-warning can be turned off using `-gnatw.B`.
+warning can be turned off using :switch:`-gnatw.B`.
.. _Component_Size_Clauses:
@@ -713,7 +715,7 @@ Bit_Order Clauses
.. index:: ordering, of bits
-For record subtypes, GNAT permits the specification of the `Bit_Order`
+For record subtypes, GNAT permits the specification of the ``Bit_Order``
attribute. The specification may either correspond to the default bit
order for the target, in which case the specification has no effect and
places no additional restrictions, or it may be for the non-standard
@@ -728,7 +730,7 @@ restrictions placed on component clauses as follows:
* Components fitting within a single storage unit.
These are unrestricted, and the effect is merely to renumber bits. For
- example if we are on a little-endian machine with `Low_Order_First`
+ example if we are on a little-endian machine with ``Low_Order_First``
being the default, then the following two declarations have exactly
the same effect:
@@ -759,14 +761,14 @@ restrictions placed on component clauses as follows:
The useful application here is to write the second declaration with the
- `Bit_Order` attribute definition clause, and know that it will be treated
+ ``Bit_Order`` attribute definition clause, and know that it will be treated
the same, regardless of whether the target is little-endian or big-endian.
* Components occupying an integral number of bytes.
These are components that exactly fit in two or more bytes. Such component
declarations are allowed, but have no effect, since it is important to realize
- that the `Bit_Order` specification does not affect the ordering of bytes.
+ that the ``Bit_Order`` specification does not affect the ordering of bytes.
In particular, the following attempt at getting an endian-independent integer
does not work:
@@ -788,7 +790,7 @@ restrictions placed on component clauses as follows:
little-endian machine, and a big-endian integer on a big-endian machine.
If byte flipping is required for interoperability between big- and
little-endian machines, this must be explicitly programmed. This capability
- is not provided by `Bit_Order`.
+ is not provided by ``Bit_Order``.
* Components that are positioned across byte boundaries.
@@ -802,7 +804,7 @@ restrictions placed on component clauses as follows:
Since the misconception that Bit_Order automatically deals with all
endian-related incompatibilities is a common one, the specification of
a component field that is an integral number of bytes will always
-generate a warning. This warning may be suppressed using `pragma Warnings (Off)`
+generate a warning. This warning may be suppressed using ``pragma Warnings (Off)``
if desired. The following section contains additional
details regarding the issue of byte ordering.
@@ -815,11 +817,11 @@ Effect of Bit_Order on Byte Ordering
.. index:: ordering, of bytes
-In this section we will review the effect of the `Bit_Order` attribute
+In this section we will review the effect of the ``Bit_Order`` attribute
definition clause on byte ordering. Briefly, it has no effect at all, but
a detailed example will be helpful. Before giving this
example, let us review the precise
-definition of the effect of defining `Bit_Order`. The effect of a
+definition of the effect of defining ``Bit_Order``. The effect of a
non-standard bit order is described in section 13.5.3 of the Ada
Reference Manual:
@@ -836,7 +838,7 @@ this context, we visit section 13.5.1 of the manual:
less than Storage_Unit."
The critical point here is that storage places are taken from
-the values after normalization, not before. So the `Bit_Order`
+the values after normalization, not before. So the ``Bit_Order``
interpretation applies to normalized values. The interpretation
is described in the later part of the 13.5.3 paragraph:
@@ -936,7 +938,7 @@ the byte is backwards, so we have to rewrite the record rep clause as:
It is a nuisance to have to rewrite the clause, especially if
the code has to be maintained on both machines. However,
this is a case that we can handle with the
-`Bit_Order` attribute if it is implemented.
+``Bit_Order`` attribute if it is implemented.
Note that the implementation is not required on byte addressed
machines, but it is indeed implemented in GNAT.
This means that we can simply use the
@@ -953,7 +955,7 @@ independent of whether the code is compiled on a big-endian or little-endian
machine.
The important point to understand is that byte ordering is not affected.
-A `Bit_Order` attribute definition never affects which byte a field
+A ``Bit_Order`` attribute definition never affects which byte a field
ends up in, only where it ends up in that byte.
To make this clear, let us rewrite the record rep clause of the previous
example as:
@@ -1008,13 +1010,13 @@ This is exactly equivalent to saying (a repeat of the first example):
end record;
-Why are they equivalent? Well take a specific field, the `Slave_V2`
+Why are they equivalent? Well take a specific field, the ``Slave_V2``
field. The storage place attributes are obtained by normalizing the
-values given so that the `First_Bit` value is less than 8. After
+values given so that the ``First_Bit`` value is less than 8. After
normalizing the values (0,10,10) we get (1,2,2) which is exactly what
we specified in the other case.
-Now one might expect that the `Bit_Order` attribute might affect
+Now one might expect that the ``Bit_Order`` attribute might affect
bit numbering within the entire record component (two bytes in this
case, thus affecting which byte fields end up in), but that is not
the way this feature is defined, it only affects numbering of bits,
@@ -1022,7 +1024,7 @@ not which byte they end up in.
Consequently it never makes sense to specify a starting bit number
greater than 7 (for a byte addressable field) if an attribute
-definition for `Bit_Order` has been given, and indeed it
+definition for ``Bit_Order`` has been given, and indeed it
may be actively confusing to specify such a value, so the compiler
generates a warning for such usage.
@@ -1060,7 +1062,7 @@ some machines we might write:
end record;
Now to switch between machines, all that is necessary is
-to set the boolean constant `Master_Byte_First` in
+to set the boolean constant ``Master_Byte_First`` in
an appropriate manner.
.. _Pragma_Pack_for_Arrays:
@@ -1070,7 +1072,7 @@ Pragma Pack for Arrays
.. index:: Pragma Pack (for arrays)
-Pragma `Pack` applied to an array has an effect that depends upon whether the
+Pragma ``Pack`` applied to an array has an effect that depends upon whether the
component type is *packable*. For a component type to be *packable*, it must
be one of the following cases:
@@ -1081,7 +1083,7 @@ be one of the following cases:
* Any small simple record type with a static size.
For all these cases, if the component subtype size is in the range
-1 through 64, then the effect of the pragma `Pack` is exactly as though a
+1 through 64, then the effect of the pragma ``Pack`` is exactly as though a
component size were specified giving the component subtype size.
All other types are non-packable, they occupy an integral number of storage
@@ -1096,18 +1098,18 @@ For example if we have:
type ar is array (1 .. 8) of r;
pragma Pack (ar);
-Then the component size of `ar` will be set to 5 (i.e., to `r'size`,
-and the size of the array `ar` will be exactly 40 bits).
+Then the component size of ``ar`` will be set to 5 (i.e., to ``r'size``,
+and the size of the array ``ar`` will be exactly 40 bits).
Note that in some cases this rather fierce approach to packing can produce
unexpected effects. For example, in Ada 95 and Ada 2005,
-subtype `Natural` typically has a size of 31, meaning that if you
-pack an array of `Natural`, you get 31-bit
+subtype ``Natural`` typically has a size of 31, meaning that if you
+pack an array of ``Natural``, you get 31-bit
close packing, which saves a few bits, but results in far less efficient
access. Since many other Ada compilers will ignore such a packing request,
-GNAT will generate a warning on some uses of pragma `Pack` that it guesses
+GNAT will generate a warning on some uses of pragma ``Pack`` that it guesses
might not be what is intended. You can easily remove this warning by
-using an explicit `Component_Size` setting instead, which never generates
+using an explicit ``Component_Size`` setting instead, which never generates
a warning, since the intention of the programmer is clear in this case.
GNAT treats packed arrays in one of two ways. If the size of the array is
@@ -1147,7 +1149,7 @@ rejecting the size clause and noting that the minimum size allowed is 64.
One special case that is worth noting occurs when the base type of the
component size is 8/16/32 and the subtype is one bit less. Notably this
-occurs with subtype `Natural`. Consider:
+occurs with subtype ``Natural``. Consider:
.. code-block:: ada
@@ -1155,10 +1157,10 @@ occurs with subtype `Natural`. Consider:
pragma Pack (Arr);
In all commonly used Ada 83 compilers, this pragma Pack would be ignored,
-since typically `Natural'Size` is 32 in Ada 83, and in any case most
+since typically ``Natural'Size`` is 32 in Ada 83, and in any case most
Ada 83 compilers did not attempt 31 bit packing.
-In Ada 95 and Ada 2005, `Natural'Size` is required to be 31. Furthermore,
+In Ada 95 and Ada 2005, ``Natural'Size`` is required to be 31. Furthermore,
GNAT really does pack 31-bit subtype to 31 bits. This may result in a
substantial unintended performance penalty when porting legacy Ada 83 code.
To help prevent this, GNAT generates a warning in such cases. If you really
@@ -1180,7 +1182,7 @@ Pragma Pack for Records
.. index:: Pragma Pack (for records)
-Pragma `Pack` applied to a record will pack the components to reduce
+Pragma ``Pack`` applied to a record will pack the components to reduce
wasted space from alignment gaps and by reducing the amount of space
taken by components. We distinguish between *packable* components and
*non-packable* components.
@@ -1194,13 +1196,13 @@ Components of the following types are considered packable:
* Small simple records, where the size is statically known, are also packable.
-For all these cases, if the 'Size value is in the range 1 through 64, the
+For all these cases, if the ``'Size`` value is in the range 1 through 64, the
components occupy the exact number of bits corresponding to this value
and are packed with no padding bits, i.e. they can start on an arbitrary
bit boundary.
All other types are non-packable, they occupy an integral number of storage
-units and the only effect of pragma Pack is to remove alignment gaps.
+units and the only effect of pragma ``Pack`` is to remove alignment gaps.
For example, consider the record
@@ -1224,7 +1226,7 @@ For example, consider the record
end record;
pragma Pack (X2);
-The representation for the record X2 is as follows:
+The representation for the record ``X2`` is as follows:
.. code-block:: ada
@@ -1238,17 +1240,17 @@ The representation for the record X2 is as follows:
L6 at 18 range 0 .. 71;
end record;
-Studying this example, we see that the packable fields `L1`
-and `L2` are
+Studying this example, we see that the packable fields ``L1``
+and ``L2`` are
of length equal to their sizes, and placed at specific bit boundaries (and
not byte boundaries) to
-eliminate padding. But `L3` is of a non-packable float type (because
+eliminate padding. But ``L3`` is of a non-packable float type (because
it is aliased), so it is on the next appropriate alignment boundary.
-The next two fields are fully packable, so `L4` and `L5` are
-minimally packed with no gaps. However, type `Rb2` is a packed
+The next two fields are fully packable, so ``L4`` and ``L5`` are
+minimally packed with no gaps. However, type ``Rb2`` is a packed
array that is longer than 64 bits, so it is itself non-packable. Thus
-the `L6` field is aligned to the next byte boundary, and takes an
+the ``L6`` field is aligned to the next byte boundary, and takes an
integral number of bytes, i.e., 72 bits.
.. _Record_Representation_Clauses:
@@ -1266,7 +1268,7 @@ of the component.
.. index:: Component Clause
For all components of an elementary type, the only restriction on component
-clauses is that the size must be at least the 'Size value of the type
+clauses is that the size must be at least the ``'Size`` value of the type
(actually the Value_Size). There are no restrictions due to alignment,
and such components may freely cross storage boundaries.
@@ -1280,7 +1282,7 @@ thus the same lack of restriction applies. For example, if you declare:
pragma Pack (R);
for R'Size use 49;
-then a component clause for a component of type R may start on any
+then a component clause for a component of type ``R`` may start on any
specified bit boundary, and may specify a value of 49 bits or greater.
For packed bit arrays that are longer than 64 bits, there are two
@@ -1304,9 +1306,9 @@ the start of the record. No component clause may attempt to overlay this
tag. When a tagged type appears as a component, the tag field must have
proper alignment
-In the case of a record extension T1, of a type T, no component clause applied
-to the type T1 can specify a storage location that would overlap the first
-T'Size bytes of the record.
+In the case of a record extension ``T1``, of a type ``T``, no component clause applied
+to the type ``T1`` can specify a storage location that would overlap the first
+``T'Size`` bytes of the record.
For all other component types, including non-bit-packed arrays,
the component can be placed at an arbitrary bit boundary,
@@ -1329,13 +1331,6 @@ so for example, the following is permitted:
R at 0 range 82 .. 161;
end record;
-Note: the above rules apply to recent releases of GNAT 5.
-In GNAT 3, there are more severe restrictions on larger components.
-For composite types, including packed arrays with a size greater than
-64 bits, component clauses must respect the alignment requirement of the
-type, in particular, always starting on a byte boundary, and the length
-must be a multiple of the storage unit.
-
.. _Handling_of_Records_with_Holes:
Handling of Records with Holes
@@ -1454,10 +1449,10 @@ manner. Consider the declarations:
type t is array (r) of Character;
The array type t corresponds to a vector with exactly three elements and
-has a default size equal to `3*Character'Size`. This ensures efficient
+has a default size equal to ``3*Character'Size``. This ensures efficient
use of space, but means that accesses to elements of the array will incur
the overhead of converting representation values to the corresponding
-positional values, (i.e., the value delivered by the `Pos` attribute).
+positional values, (i.e., the value delivered by the ``Pos`` attribute).
.. _Address_Clauses:
@@ -1557,7 +1552,7 @@ thus when used as an address clause value is always permitted.
Additionally, GNAT treats as static an address clause that is an
unchecked_conversion of a static integer value. This simplifies the porting
of legacy code, and provides a portable equivalent to the GNAT attribute
-`To_Address`.
+``To_Address``.
Another issue with address clauses is the interaction with alignment
requirements. When an address clause is given for an object, the address
@@ -1570,10 +1565,10 @@ Since this source of erroneous behavior can have unfortunate effects on
machines with strict alignment requirements, GNAT
checks (at compile time if possible, generating a warning, or at execution
time with a run-time check) that the alignment is appropriate. If the
-run-time check fails, then `Program_Error` is raised. This run-time
+run-time check fails, then ``Program_Error`` is raised. This run-time
check is suppressed if range checks are suppressed, or if the special GNAT
check Alignment_Check is suppressed, or if
-`pragma Restrictions (No_Elaboration_Code)` is in effect. It is also
+``pragma Restrictions (No_Elaboration_Code)`` is in effect. It is also
suppressed by default on non-strict alignment machines (such as the x86).
Finally, GNAT does not permit overlaying of objects of class-wide types. In
@@ -1661,13 +1656,13 @@ or alternatively, using the form recommended by the RM:
for B'Address use Addr;
-In both of these cases, `A` and `B` become aliased to one another
+In both of these cases, ``A`` and ``B`` become aliased to one another
via the address clause. This use of address clauses to overlay
variables, achieving an effect similar to unchecked conversion
was erroneous in Ada 83, but in Ada 95 and Ada 2005
the effect is implementation defined. Furthermore, the
Ada RM specifically recommends that in a situation
-like this, `B` should be subject to the following
+like this, ``B`` should be subject to the following
implementation advice (RM 13.3(19)):
"19 If the Address of an object is specified, or it is imported
@@ -1675,13 +1670,13 @@ implementation advice (RM 13.3(19)):
optimizations based on assumptions of no aliases."
GNAT follows this recommendation, and goes further by also applying
-this recommendation to the overlaid variable (`A` in the above example)
+this recommendation to the overlaid variable (``A`` in the above example)
in this case. This means that the overlay works "as expected", in that
a modification to one of the variables will affect the value of the other.
More generally, GNAT interprets this recommendation conservatively for
address clauses: in the cases other than overlays, it considers that the
-object is effectively subject to pragma `Volatile` and implements the
+object is effectively subject to pragma ``Volatile`` and implements the
associated semantics.
Note that when address clause overlays are used in this way, there is an
@@ -1704,9 +1699,9 @@ issue of unintentional initialization, as shown by this example:
end Overwrite_Record;
-Here the default initialization of `Y` will clobber the value
-of `X`, which justifies the warning. The warning notes that
-this effect can be eliminated by adding a `pragma Import`
+Here the default initialization of ``Y`` will clobber the value
+of ``X``, which justifies the warning. The warning notes that
+this effect can be eliminated by adding a ``pragma Import``
which suppresses the initialization:
.. code-block:: ada
@@ -1723,12 +1718,12 @@ which suppresses the initialization:
end Overwrite_Record;
-Note that the use of `pragma Initialize_Scalars` may cause variables to
+Note that the use of ``pragma Initialize_Scalars`` may cause variables to
be initialized when they would not otherwise have been in the absence
of the use of this pragma. This may cause an overlay to have this
unintended clobbering effect. The compiler avoids this for scalar
types, but not for composite objects (where in general the effect
-of `Initialize_Scalars` is part of the initialization routine
+of ``Initialize_Scalars`` is part of the initialization routine
for the composite object:
::
@@ -1754,7 +1749,7 @@ for the composite object:
end Overwrite_Array;
The above program generates the warning as shown, and at execution
-time, prints `X was clobbered`. If the `pragma Import` is
+time, prints ``X was clobbered``. If the ``pragma Import`` is
added as suggested:
.. code-block:: ada
@@ -1776,7 +1771,7 @@ added as suggested:
end Overwrite_Array;
then the program compiles without the warning and when run will generate
-the output `X was not clobbered`.
+the output ``X was not clobbered``.
.. _Use_of_Address_Clauses_for_Memory-Mapped_I/O:
@@ -1834,8 +1829,8 @@ It is best to be explicit in this situation, by either declaring the
components to be atomic if you want the byte store, or explicitly writing
the full word access sequence if that is what the hardware requires.
Alternatively, if the full word access sequence is required, GNAT also
-provides the pragma `Volatile_Full_Access` which can be used in lieu of
-pragma `Atomic` and will give the additional guarantee.
+provides the pragma ``Volatile_Full_Access`` which can be used in lieu of
+pragma ``Atomic`` and will give the additional guarantee.
.. _Effect_of_Convention_on_Representation:
@@ -1872,9 +1867,9 @@ There are four exceptions to this general rule:
type Color is (Red, Green, Blue);
8 bits is sufficient to store all values of the type, so by default, objects
- of type `Color` will be represented using 8 bits. However, normal C
+ of type ``Color`` will be represented using 8 bits. However, normal C
convention is to use 32 bits for all enum values in C, since enum values
- are essentially of type int. If pragma `Convention C` is specified for an
+ are essentially of type int. If pragma ``Convention C`` is specified for an
Ada enumeration type, then the size is modified as necessary (usually to
32 bits) to be consistent with the C convention for enum values.
@@ -1893,7 +1888,7 @@ There are four exceptions to this general rule:
true. In Ada, the normal convention is that two specific values, typically
0/1, are used to represent false/true respectively.
- Fortran has a similar convention for `LOGICAL` values (any nonzero
+ Fortran has a similar convention for ``LOGICAL`` values (any nonzero
value represents true).
To accommodate the Fortran and C conventions, if a pragma Convention specifies
@@ -2006,8 +2001,8 @@ representation clause or pragma is accepted, there can still be questions
of what the compiler actually does. For example, if a partial record
representation clause specifies the location of some components and not
others, then where are the non-specified components placed? Or if pragma
-`Pack` is used on a record, then exactly where are the resulting
-fields placed? The section on pragma `Pack` in this chapter can be
+``Pack`` is used on a record, then exactly where are the resulting
+fields placed? The section on pragma ``Pack`` in this chapter can be
used to answer the second question, but it is often easier to just see
what the compiler does.
@@ -2130,7 +2125,7 @@ fields present, including the parent field, which is a copy of the fields
of the parent type of r2, i.e., r1.
The component size and size clauses for types rb1 and rb2 show
-the exact effect of pragma `Pack` on these arrays, and the record
+the exact effect of pragma ``Pack`` on these arrays, and the record
representation clause for type x2 shows how pragma `Pack` affects
this record type.
diff --git a/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst b/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
index 78c489b..7b64768 100644
--- a/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
+++ b/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
@@ -54,8 +54,8 @@ the call.
.. index:: Max_Entry_Queue_Depth
-The restriction `Max_Entry_Queue_Depth` is recognized as a
-synonym for `Max_Entry_Queue_Length`. This is retained for historical
+The restriction ``Max_Entry_Queue_Depth`` is recognized as a
+synonym for ``Max_Entry_Queue_Length``. This is retained for historical
compatibility purposes (and a warning will be generated for its use if
warnings on obsolescent features are activated).
@@ -201,7 +201,7 @@ No_Dispatch
.. index:: No_Dispatch
[RM H.4] This restriction ensures at compile time that there are no
-occurrences of `T'Class`, for any (tagged) subtype `T`.
+occurrences of ``T'Class``, for any (tagged) subtype ``T``.
No_Dispatching_Calls
--------------------
@@ -217,7 +217,7 @@ in the implementation of class-wide objects assignments. The
membership test is allowed in the presence of this restriction, because its
implementation requires no dispatching.
This restriction is comparable to the official Ada restriction
-`No_Dispatch` except that it is a bit less restrictive in that it allows
+``No_Dispatch`` except that it is a bit less restrictive in that it allows
all classwide constructs that do not imply dispatching.
The following example indicates constructs that violate this restriction.
@@ -274,8 +274,8 @@ Detach_Handler, and Reference).
.. index:: No_Dynamic_Interrupts
-The restriction `No_Dynamic_Interrupts` is recognized as a
-synonym for `No_Dynamic_Attachment`. This is retained for historical
+The restriction ``No_Dynamic_Interrupts`` is recognized as a
+synonym for ``No_Dynamic_Attachment``. This is retained for historical
compatibility purposes (and a warning will be generated for its use if
warnings on obsolescent features are activated).
@@ -368,11 +368,11 @@ performed by the compiler to support these features. The following types
are no longer considered controlled when this restriction is in effect:
*
- `Ada.Finalization.Controlled`
+ ``Ada.Finalization.Controlled``
*
- `Ada.Finalization.Limited_Controlled`
+ ``Ada.Finalization.Limited_Controlled``
*
- Derivations from `Controlled` or `Limited_Controlled`
+ Derivations from ``Controlled`` or ``Limited_Controlled``
*
Class-wide types
*
@@ -421,8 +421,8 @@ No_Implicit_Dynamic_Code
[GNAT] This restriction prevents the compiler from building 'trampolines'.
This is a structure that is built on the stack and contains dynamic
code to be executed at run time. On some targets, a trampoline is
-built for the following features: `Access`,
-`Unrestricted_Access`, or `Address` of a nested subprogram;
+built for the following features: ``Access``,
+``Unrestricted_Access``, or ``Address`` of a nested subprogram;
nested task bodies; primitive operations of nested tagged types.
Trampolines do not work on machines that prevent execution of stack
data. For example, on windows systems, enabling DEP (data execution
@@ -433,8 +433,8 @@ On many targets, trampolines have been largely eliminated. Look at the
version of system.ads for your target --- if it has
Always_Compatible_Rep equal to False, then trampolines are largely
eliminated. In particular, a trampoline is built for the following
-features: `Address` of a nested subprogram;
-`Access` or `Unrestricted_Access` of a nested subprogram,
+features: ``Address`` of a nested subprogram;
+``Access`` or ``Unrestricted_Access`` of a nested subprogram,
but only if pragma Favor_Top_Level applies, or the access type has a
foreign-language convention; primitive operations of nested tagged
types.
@@ -559,7 +559,7 @@ No_Relative_Delay
.. index:: No_Relative_Delay
[RM D.7] This restriction ensures at compile time that there are no delay
-relative statements and prevents expressions such as `delay 1.23;` from
+relative statements and prevents expressions such as ``delay 1.23;`` from
appearing in source code.
No_Requeue_Statements
@@ -567,13 +567,13 @@ No_Requeue_Statements
.. index:: No_Requeue_Statements
[RM D.7] This restriction ensures at compile time that no requeue statements
-are permitted and prevents keyword `requeue` from being used in source
+are permitted and prevents keyword ``requeue`` from being used in source
code.
.. index:: No_Requeue
-The restriction `No_Requeue` is recognized as a
-synonym for `No_Requeue_Statements`. This is retained for historical
+The restriction ``No_Requeue`` is recognized as a
+synonym for ``No_Requeue_Statements``. This is retained for historical
compatibility purposes (and a warning will be generated for its use if
warnings on oNobsolescent features are activated).
@@ -584,7 +584,7 @@ No_Secondary_Stack
[GNAT] This restriction ensures at compile time that the generated code
does not contain any reference to the secondary stack. The secondary
stack is used to implement functions returning unconstrained objects
-(arrays or records) on some targets. Suppresses the allocation of
+(arrays or records) on some targets. Suppresses the allocation of
secondary stacks for tasks (excluding the environment task) at run time.
No_Select_Statements
@@ -592,7 +592,7 @@ No_Select_Statements
.. index:: No_Select_Statements
[RM D.7] This restriction ensures at compile time no select statements of any
-kind are permitted, that is the keyword `select` may not appear.
+kind are permitted, that is the keyword ``select`` may not appear.
No_Specific_Termination_Handlers
--------------------------------
@@ -632,8 +632,8 @@ No_Stream_Optimizations
.. index:: No_Stream_Optimizations
[GNAT] This restriction affects the performance of stream operations on types
-`String`, `Wide_String` and `Wide_Wide_String`. By default, the
-compiler uses block reads and writes when manipulating `String` objects
+``String``, ``Wide_String`` and ``Wide_Wide_String``. By default, the
+compiler uses block reads and writes when manipulating ``String`` objects
due to their supperior performance. When this restriction is in effect, the
compiler performs all IO operations on a per-character basis.
@@ -644,8 +644,8 @@ No_Streams
[GNAT] This restriction ensures at compile/bind time that there are no
stream objects created and no use of stream attributes.
This restriction does not forbid dependences on the package
-`Ada.Streams`. So it is permissible to with
-`Ada.Streams` (or another package that does so itself)
+``Ada.Streams``. So it is permissible to with
+``Ada.Streams`` (or another package that does so itself)
as long as no actual stream objects are created and no
stream attributes are used.
@@ -676,12 +676,12 @@ No_Task_Attributes_Package
.. index:: No_Task_Attributes_Package
[GNAT] This restriction ensures at compile time that there are no implicit or
-explicit dependencies on the package `Ada.Task_Attributes`.
+explicit dependencies on the package ``Ada.Task_Attributes``.
.. index:: No_Task_Attributes
-The restriction `No_Task_Attributes` is recognized as a synonym
-for `No_Task_Attributes_Package`. This is retained for historical
+The restriction ``No_Task_Attributes`` is recognized as a synonym
+for ``No_Task_Attributes_Package``. This is retained for historical
compatibility purposes (and a warning will be generated for its use if
warnings on obsolescent features are activated).
@@ -704,7 +704,7 @@ No_Tasking
[GNAT] This restriction prevents the declaration of tasks or task types
throughout the partition. It is similar in effect to the use of
-`Max_Tasks => 0` except that violations are caught at compile time
+``Max_Tasks => 0`` except that violations are caught at compile time
and cause an error message to be output either by the compiler or
binder.
@@ -755,8 +755,7 @@ Pure_Barriers
[GNAT] This restriction ensures at compile time that protected entry
barriers are restricted to:
-* simple variables defined in the private part of the
- protected type/object,
+* components of the protected object (excluding selection from dereferences),
* constant declarations,
* named numbers,
* enumeration literals,
@@ -765,7 +764,8 @@ barriers are restricted to:
* character literals,
* implicitly defined comparison operators,
* uses of the Standard."not" operator,
-* short-circuit operator
+* short-circuit operator,
+* the Count attribute
This restriction is a relaxation of the Simple_Barriers restriction,
but still ensures absence of side effects, exceptions, and recursion
@@ -782,8 +782,8 @@ part of the protected type. No other form of entry barriers is permitted.
.. index:: Boolean_Entry_Barriers
-The restriction `Boolean_Entry_Barriers` is recognized as a
-synonym for `Simple_Barriers`. This is retained for historical
+The restriction ``Boolean_Entry_Barriers`` is recognized as a
+synonym for ``Simple_Barriers``. This is retained for historical
compatibility purposes (and a warning will be generated for its use if
warnings on obsolescent features are activated).
@@ -793,7 +793,7 @@ Static_Priorities
[GNAT] This restriction ensures at compile time that all priority expressions
are static, and that there are no dependences on the package
-`Ada.Dynamic_Priorities`.
+``Ada.Dynamic_Priorities``.
Static_Storage_Size
-------------------
@@ -820,10 +820,10 @@ No_Elaboration_Code
[GNAT] This restriction ensures at compile time that no elaboration code is
generated. Note that this is not the same condition as is enforced
-by pragma `Preelaborate`. There are cases in which pragma
-`Preelaborate` still permits code to be generated (e.g., code
+by pragma ``Preelaborate``. There are cases in which pragma
+``Preelaborate`` still permits code to be generated (e.g., code
to initialize a large array to all zeroes), and there are cases of units
-which do not meet the requirements for pragma `Preelaborate`,
+which do not meet the requirements for pragma ``Preelaborate``,
but for which no elaboration code is generated. Generally, it is
the case that preelaborable units will meet the restrictions, with
the exception of large aggregates initialized with an others_clause,
@@ -834,7 +834,7 @@ throughout a partition.
In the case of aggregates with others, if the aggregate has a dynamic
size, there is no way to eliminate the elaboration code (such dynamic
-bounds would be incompatible with `Preelaborate` in any case). If
+bounds would be incompatible with ``Preelaborate`` in any case). If
the bounds are static, then use of this restriction actually modifies
the code choice of the compiler to avoid generating a loop, and instead
generate the aggregate statically if possible, no matter how many times
@@ -932,7 +932,7 @@ No_Implementation_Restrictions
.. index:: No_Implementation_Restrictions
[GNAT] This restriction checks at compile time that no GNAT-defined restriction
-identifiers (other than `No_Implementation_Restrictions` itself)
+identifiers (other than ``No_Implementation_Restrictions`` itself)
are present. With this restriction, the only other restriction identifiers
that can be used are those defined in the Ada Reference Manual.
@@ -961,9 +961,9 @@ No_Implicit_Loops
.. index:: No_Implicit_Loops
[GNAT] This restriction ensures that the generated code of the unit marked
-with this restriction does not contain any implicit `for` loops, either by
+with this restriction does not contain any implicit ``for`` loops, either by
modifying the generated code where possible, or by rejecting any construct
-that would otherwise generate an implicit `for` loop. If this restriction is
+that would otherwise generate an implicit ``for`` loop. If this restriction is
active, it is possible to build large array aggregates with all static
components without generating an intermediate temporary, and without generating
a loop to initialize individual components. Otherwise, a loop is created for
@@ -982,11 +982,11 @@ No_Wide_Characters
.. index:: No_Wide_Characters
[GNAT] This restriction ensures at compile time that no uses of the types
-`Wide_Character` or `Wide_String` or corresponding wide
+``Wide_Character`` or ``Wide_String`` or corresponding wide
wide types
appear, and that no wide or wide wide string or character literals
appear in the program (that is literals representing characters not in
-type `Character`).
+type ``Character``).
SPARK_05
--------
@@ -1005,10 +1005,10 @@ SPARK restriction have the form:
.. index:: SPARK
-The restriction `SPARK` is recognized as a
-synonym for `SPARK_05`. This is retained for historical
+The restriction ``SPARK`` is recognized as a
+synonym for ``SPARK_05``. This is retained for historical
compatibility purposes (and an unconditional warning will be generated
-for its use, advising replacement by `SPARK`).
+for its use, advising replacement by ``SPARK``).
This is not a replacement for the semantic checks performed by the
SPARK Examiner tool, as the compiler currently only deals with code,
@@ -1018,7 +1018,7 @@ cases of constructs forbidden by SPARK 2005.
Thus it may well be the case that code which passes the compiler with
the SPARK restriction is rejected by the SPARK Examiner, e.g. due to
the different visibility rules of the Examiner based on SPARK 2005
-`inherit` annotations.
+``inherit`` annotations.
This restriction can be useful in providing an initial filter for code
developed using SPARK 2005, or in examining legacy code to see how far
diff --git a/gcc/ada/doc/gnat_rm/standard_library_routines.rst b/gcc/ada/doc/gnat_rm/standard_library_routines.rst
index 6c9ac9f..e6fceeb 100644
--- a/gcc/ada/doc/gnat_rm/standard_library_routines.rst
+++ b/gcc/ada/doc/gnat_rm/standard_library_routines.rst
@@ -37,31 +37,31 @@ the unit is not implemented.
``Ada.Assertions`` *(11.4.2)*
- `Assertions` provides the `Assert` subprograms, and also
- the declaration of the `Assertion_Error` exception.
+ ``Assertions`` provides the ``Assert`` subprograms, and also
+ the declaration of the ``Assertion_Error`` exception.
``Ada.Asynchronous_Task_Control`` *(D.11)*
- `Asynchronous_Task_Control` provides low level facilities for task
+ ``Asynchronous_Task_Control`` provides low level facilities for task
synchronization. It is typically not implemented. See package spec for details.
``Ada.Calendar`` *(9.6)*
- `Calendar` provides time of day access, and routines for
+ ``Calendar`` provides time of day access, and routines for
manipulating times and durations.
``Ada.Calendar.Arithmetic`` *(9.6.1)*
This package provides additional arithmetic
- operations for `Calendar`.
+ operations for ``Calendar``.
``Ada.Calendar.Formatting`` *(9.6.1)*
- This package provides formatting operations for `Calendar`.
+ This package provides formatting operations for ``Calendar``.
``Ada.Calendar.Time_Zones`` *(9.6.1)*
- This package provides additional `Calendar` facilities
+ This package provides additional ``Calendar`` facilities
for handling time zones.
@@ -84,14 +84,14 @@ the unit is not implemented.
that appear in type CHARACTER. It is useful for writing programs that
will run in international environments. For example, if you want an
upper case E with an acute accent in a string, it is often better to use
- the definition of `UC_E_Acute` in this package. Then your program
+ the definition of ``UC_E_Acute`` in this package. Then your program
will print in an understandable manner even if your environment does not
support these extended characters.
``Ada.Command_Line`` *(A.15)*
This package provides access to the command line parameters and the name
- of the current program (analogous to the use of `argc` and `argv`
+ of the current program (analogous to the use of ``argc`` and ``argv``
in C), and also allows the exit status for the program to be set in a
system-independent manner.
@@ -272,7 +272,9 @@ the unit is not implemented.
``Ada.Locales`` *(A.19)*
This package provides declarations providing information (Language
- and Country) about the current locale.
+ and Country) about the current locale. This package is currently not
+ implemented other than by providing stubs which will always return
+ Language_Unknown/Country_Unknown.
``Ada.Numerics``
@@ -289,14 +291,14 @@ the unit is not implemented.
``Ada.Numerics.Complex_Elementary_Functions``
Provides the implementation of standard elementary functions (such as
log and trigonometric functions) operating on complex numbers using the
- standard `Float` and the `Complex` and `Imaginary` types
- created by the package `Numerics.Complex_Types`.
+ standard ``Float`` and the ``Complex`` and ``Imaginary`` types
+ created by the package ``Numerics.Complex_Types``.
``Ada.Numerics.Complex_Types``
This is a predefined instantiation of
- `Numerics.Generic_Complex_Types` using `Standard.Float` to
- build the type `Complex` and `Imaginary`.
+ ``Numerics.Generic_Complex_Types`` using ``Standard.Float`` to
+ build the type ``Complex`` and ``Imaginary``.
``Ada.Numerics.Discrete_Random``
@@ -318,15 +320,15 @@ the unit is not implemented.
* ``Short_Float``
- `Ada.Numerics.Short_Complex_Elementary_Functions`
+ ``Ada.Numerics.Short_Complex_Elementary_Functions``
* ``Float``
- `Ada.Numerics.Complex_Elementary_Functions`
+ ``Ada.Numerics.Complex_Elementary_Functions``
* ``Long_Float``
- `Ada.Numerics.Long_Complex_Elementary_Functions`
+ ``Ada.Numerics.Long_Complex_Elementary_Functions``
``Ada.Numerics.Generic_Complex_Types``
This is a generic package that allows the creation of complex types,
@@ -336,15 +338,15 @@ the unit is not implemented.
* ``Short_Float``
- `Ada.Numerics.Short_Complex_Complex_Types`
+ ``Ada.Numerics.Short_Complex_Complex_Types``
* ``Float``
- `Ada.Numerics.Complex_Complex_Types`
+ ``Ada.Numerics.Complex_Complex_Types``
* ``Long_Float``
- `Ada.Numerics.Long_Complex_Complex_Types`
+ ``Ada.Numerics.Long_Complex_Complex_Types``
``Ada.Numerics.Generic_Elementary_Functions``
This is a generic package that provides the implementation of standard
@@ -355,15 +357,15 @@ the unit is not implemented.
* ``Short_Float``
- `Ada.Numerics.Short_Elementary_Functions`
+ ``Ada.Numerics.Short_Elementary_Functions``
* ``Float``
- `Ada.Numerics.Elementary_Functions`
+ ``Ada.Numerics.Elementary_Functions``
* ``Long_Float``
- `Ada.Numerics.Long_Elementary_Functions`
+ ``Ada.Numerics.Long_Elementary_Functions``
``Ada.Numerics.Generic_Real_Arrays`` *(G.3.1)*
Generic operations on arrays of reals
@@ -372,7 +374,7 @@ the unit is not implemented.
Preinstantiation of Ada.Numerics.Generic_Real_Arrays (Float).
``Ada.Real_Time`` *(D.8)*
- This package provides facilities similar to those of `Calendar`, but
+ This package provides facilities similar to those of ``Calendar``, but
operating with a finer clock suitable for real time control. Note that
annex D requires that there be no backward clock jumps, and GNAT generally
guarantees this behavior, but of course if the external clock on which
@@ -394,12 +396,12 @@ the unit is not implemented.
``Ada.Streams`` *(13.13.1)*
This is a generic package that provides the basic support for the
- concept of streams as used by the stream attributes (`Input`,
- `Output`, `Read` and `Write`).
+ concept of streams as used by the stream attributes (``Input``,
+ ``Output``, ``Read`` and ``Write``).
``Ada.Streams.Stream_IO`` *(A.12.1)*
- This package is a specialization of the type `Streams` defined in
- package `Streams` together with a set of operations providing
+ This package is a specialization of the type ``Streams`` defined in
+ package ``Streams`` together with a set of operations providing
Stream_IO capability. The Stream_IO model permits both random and
sequential access to a file which can contain an arbitrary set of values
of one or more Ada types.
@@ -511,8 +513,8 @@ the unit is not implemented.
``Ada.Strings.Wide_Unbounded`` *(A.4.7)*
These packages provide analogous capabilities to the corresponding
packages without ``Wide_`` in the name, but operate with the types
- `Wide_String` and `Wide_Character` instead of `String`
- and `Character`. Versions of all the child packages are available.
+ ``Wide_String`` and ``Wide_Character`` instead of ``String``
+ and ``Character``. Versions of all the child packages are available.
``Ada.Strings.Wide_Wide_Bounded`` *(A.4.7)*
@@ -523,8 +525,8 @@ the unit is not implemented.
``Ada.Strings.Wide_Wide_Unbounded`` *(A.4.7)*
These packages provide analogous capabilities to the corresponding
packages without ``Wide_`` in the name, but operate with the types
- `Wide_Wide_String` and `Wide_Wide_Character` instead
- of `String` and `Character`.
+ ``Wide_Wide_String`` and ``Wide_Wide_Character`` instead
+ of ``String`` and ``Character``.
``Ada.Synchronous_Barriers`` *(D.10.1)*
This package provides facilities for synchronizing tasks at a low level
@@ -578,15 +580,15 @@ the unit is not implemented.
* ``Short_Float``
- `Short_Float_Text_IO`
+ ``Short_Float_Text_IO``
* ``Float``
- `Float_Text_IO`
+ ``Float_Text_IO``
* ``Long_Float``
- `Long_Float_Text_IO`
+ ``Long_Float_Text_IO``
``Ada.Text_IO.Integer_IO``
Provides input-output facilities for integer types. The following
@@ -594,23 +596,23 @@ the unit is not implemented.
* ``Short_Short_Integer``
- `Ada.Short_Short_Integer_Text_IO`
+ ``Ada.Short_Short_Integer_Text_IO``
* ``Short_Integer``
- `Ada.Short_Integer_Text_IO`
+ ``Ada.Short_Integer_Text_IO``
* ``Integer``
- `Ada.Integer_Text_IO`
+ ``Ada.Integer_Text_IO``
* ``Long_Integer``
- `Ada.Long_Integer_Text_IO`
+ ``Ada.Long_Integer_Text_IO``
* ``Long_Long_Integer``
- `Ada.Long_Long_Integer_Text_IO`
+ ``Ada.Long_Long_Integer_Text_IO``
``Ada.Text_IO.Modular_IO``
Provides input-output facilities for modular (unsigned) types.
@@ -691,17 +693,17 @@ the unit is not implemented.
allocated by use of an allocator.
``Ada.Wide_Text_IO`` *(A.11)*
- This package is similar to `Ada.Text_IO`, except that the external
+ This package is similar to ``Ada.Text_IO``, except that the external
file supports wide character representations, and the internal types are
- `Wide_Character` and `Wide_String` instead of `Character`
- and `String`. The corresponding set of nested packages and child
+ ``Wide_Character`` and ``Wide_String`` instead of ``Character``
+ and ``String``. The corresponding set of nested packages and child
packages are defined.
``Ada.Wide_Wide_Text_IO`` *(A.11)*
- This package is similar to `Ada.Text_IO`, except that the external
+ This package is similar to ``Ada.Text_IO``, except that the external
file supports wide character representations, and the internal types are
- `Wide_Character` and `Wide_String` instead of `Character`
- and `String`. The corresponding set of nested packages and child
+ ``Wide_Character`` and ``Wide_String`` instead of ``Character``
+ and ``String``. The corresponding set of nested packages and child
packages are defined.
For packages in Interfaces and System, all the RM defined packages are
diff --git a/gcc/ada/doc/gnat_rm/the_gnat_library.rst b/gcc/ada/doc/gnat_rm/the_gnat_library.rst
index 57607fe..ed614e3 100644
--- a/gcc/ada/doc/gnat_rm/the_gnat_library.rst
+++ b/gcc/ada/doc/gnat_rm/the_gnat_library.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. _The_GNAT_Library:
****************
@@ -18,116 +20,116 @@ with all GNAT releases. For example, to find out the full specifications of
the SPITBOL pattern matching capability, including a full tutorial and
extensive examples, look in the :file:`g-spipat.ads` file in the library.
-For each entry here, the package name (as it would appear in a `with`
+For each entry here, the package name (as it would appear in a ``with``
clause) is given, followed by the name of the corresponding spec file in
-parentheses. The packages are children in four hierarchies, `Ada`,
-`Interfaces`, `System`, and `GNAT`, the latter being a
+parentheses. The packages are children in four hierarchies, ``Ada``,
+``Interfaces``, ``System``, and ``GNAT``, the latter being a
GNAT-specific hierarchy.
Note that an application program should only use packages in one of these
four hierarchies if the package is defined in the Ada Reference Manual,
or is listed in this section of the GNAT Programmers Reference Manual.
All other units should be considered internal implementation units and
-should not be directly `with`'ed by application code. The use of
-a `with` statement that references one of these internal implementation
+should not be directly ``with``\ ed by application code. The use of
+a ``with`` clause that references one of these internal implementation
units makes an application potentially dependent on changes in versions
of GNAT, and will generate a warning message.
.. _`Ada.Characters.Latin_9_(a-chlat9.ads)`:
-`Ada.Characters.Latin_9` (:file:`a-chlat9.ads`)
-===============================================
+``Ada.Characters.Latin_9`` (:file:`a-chlat9.ads`)
+=================================================
.. index:: Ada.Characters.Latin_9 (a-chlat9.ads)
.. index:: Latin_9 constants for Character
-This child of `Ada.Characters`
+This child of ``Ada.Characters``
provides a set of definitions corresponding to those in the
-RM-defined package `Ada.Characters.Latin_1` but with the
-few modifications required for `Latin-9`
+RM-defined package ``Ada.Characters.Latin_1`` but with the
+few modifications required for ``Latin-9``
The provision of such a package
is specifically authorized by the Ada Reference Manual
(RM A.3.3(27)).
.. _`Ada.Characters.Wide_Latin_1_(a-cwila1.ads)`:
-`Ada.Characters.Wide_Latin_1` (:file:`a-cwila1.ads`)
-====================================================
+``Ada.Characters.Wide_Latin_1`` (:file:`a-cwila1.ads`)
+======================================================
.. index:: Ada.Characters.Wide_Latin_1 (a-cwila1.ads)
.. index:: Latin_1 constants for Wide_Character
-This child of `Ada.Characters`
+This child of ``Ada.Characters``
provides a set of definitions corresponding to those in the
-RM-defined package `Ada.Characters.Latin_1` but with the
-types of the constants being `Wide_Character`
-instead of `Character`. The provision of such a package
+RM-defined package ``Ada.Characters.Latin_1`` but with the
+types of the constants being ``Wide_Character``
+instead of ``Character``. The provision of such a package
is specifically authorized by the Ada Reference Manual
(RM A.3.3(27)).
.. _`Ada.Characters.Wide_Latin_9_(a-cwila1.ads)`:
-`Ada.Characters.Wide_Latin_9` (:file:`a-cwila1.ads`)
-====================================================
+``Ada.Characters.Wide_Latin_9`` (:file:`a-cwila1.ads`)
+======================================================
.. index:: Ada.Characters.Wide_Latin_9 (a-cwila1.ads)
.. index:: Latin_9 constants for Wide_Character
-This child of `Ada.Characters`
+This child of ``Ada.Characters``
provides a set of definitions corresponding to those in the
-GNAT defined package `Ada.Characters.Latin_9` but with the
-types of the constants being `Wide_Character`
-instead of `Character`. The provision of such a package
+GNAT defined package ``Ada.Characters.Latin_9`` but with the
+types of the constants being ``Wide_Character``
+instead of ``Character``. The provision of such a package
is specifically authorized by the Ada Reference Manual
(RM A.3.3(27)).
.. _`Ada.Characters.Wide_Wide_Latin_1_(a-chzla1.ads)`:
-`Ada.Characters.Wide_Wide_Latin_1` (:file:`a-chzla1.ads`)
-=========================================================
+``Ada.Characters.Wide_Wide_Latin_1`` (:file:`a-chzla1.ads`)
+===========================================================
.. index:: Ada.Characters.Wide_Wide_Latin_1 (a-chzla1.ads)
.. index:: Latin_1 constants for Wide_Wide_Character
-This child of `Ada.Characters`
+This child of ``Ada.Characters``
provides a set of definitions corresponding to those in the
-RM-defined package `Ada.Characters.Latin_1` but with the
-types of the constants being `Wide_Wide_Character`
-instead of `Character`. The provision of such a package
+RM-defined package ``Ada.Characters.Latin_1`` but with the
+types of the constants being ``Wide_Wide_Character``
+instead of ``Character``. The provision of such a package
is specifically authorized by the Ada Reference Manual
(RM A.3.3(27)).
.. _`Ada.Characters.Wide_Wide_Latin_9_(a-chzla9.ads)`:
-`Ada.Characters.Wide_Wide_Latin_9` (:file:`a-chzla9.ads`)
-=========================================================
+``Ada.Characters.Wide_Wide_Latin_9`` (:file:`a-chzla9.ads`)
+===========================================================
.. index:: Ada.Characters.Wide_Wide_Latin_9 (a-chzla9.ads)
.. index:: Latin_9 constants for Wide_Wide_Character
-This child of `Ada.Characters`
+This child of ``Ada.Characters``
provides a set of definitions corresponding to those in the
-GNAT defined package `Ada.Characters.Latin_9` but with the
-types of the constants being `Wide_Wide_Character`
-instead of `Character`. The provision of such a package
+GNAT defined package ``Ada.Characters.Latin_9`` but with the
+types of the constants being ``Wide_Wide_Character``
+instead of ``Character``. The provision of such a package
is specifically authorized by the Ada Reference Manual
(RM A.3.3(27)).
.. _`Ada.Containers.Formal_Doubly_Linked_Lists_(a-cfdlli.ads)`:
-`Ada.Containers.Formal_Doubly_Linked_Lists` (:file:`a-cfdlli.ads`)
-==================================================================
+``Ada.Containers.Formal_Doubly_Linked_Lists`` (:file:`a-cfdlli.ads`)
+====================================================================
.. index:: Ada.Containers.Formal_Doubly_Linked_Lists (a-cfdlli.ads)
.. index:: Formal container for doubly linked lists
-This child of `Ada.Containers` defines a modified version of the
+This child of ``Ada.Containers`` defines a modified version of the
Ada 2005 container for doubly linked lists, meant to facilitate formal
verification of code using such containers. The specification of this
unit is compatible with SPARK 2014.
@@ -139,14 +141,14 @@ does not have the complex overhead required to detect cursor tampering.
.. _`Ada.Containers.Formal_Hashed_Maps_(a-cfhama.ads)`:
-`Ada.Containers.Formal_Hashed_Maps` (:file:`a-cfhama.ads`)
-==========================================================
+``Ada.Containers.Formal_Hashed_Maps`` (:file:`a-cfhama.ads`)
+============================================================
.. index:: Ada.Containers.Formal_Hashed_Maps (a-cfhama.ads)
.. index:: Formal container for hashed maps
-This child of `Ada.Containers` defines a modified version of the
+This child of ``Ada.Containers`` defines a modified version of the
Ada 2005 container for hashed maps, meant to facilitate formal
verification of code using such containers. The specification of this
unit is compatible with SPARK 2014.
@@ -158,14 +160,14 @@ does not have the complex overhead required to detect cursor tampering.
.. _`Ada.Containers.Formal_Hashed_Sets_(a-cfhase.ads)`:
-`Ada.Containers.Formal_Hashed_Sets` (:file:`a-cfhase.ads`)
-==========================================================
+``Ada.Containers.Formal_Hashed_Sets`` (:file:`a-cfhase.ads`)
+============================================================
.. index:: Ada.Containers.Formal_Hashed_Sets (a-cfhase.ads)
.. index:: Formal container for hashed sets
-This child of `Ada.Containers` defines a modified version of the
+This child of ``Ada.Containers`` defines a modified version of the
Ada 2005 container for hashed sets, meant to facilitate formal
verification of code using such containers. The specification of this
unit is compatible with SPARK 2014.
@@ -177,14 +179,14 @@ does not have the complex overhead required to detect cursor tampering.
.. _`Ada.Containers.Formal_Ordered_Maps_(a-cforma.ads)`:
-`Ada.Containers.Formal_Ordered_Maps` (:file:`a-cforma.ads`)
-===========================================================
+``Ada.Containers.Formal_Ordered_Maps`` (:file:`a-cforma.ads`)
+=============================================================
.. index:: Ada.Containers.Formal_Ordered_Maps (a-cforma.ads)
.. index:: Formal container for ordered maps
-This child of `Ada.Containers` defines a modified version of the
+This child of ``Ada.Containers`` defines a modified version of the
Ada 2005 container for ordered maps, meant to facilitate formal
verification of code using such containers. The specification of this
unit is compatible with SPARK 2014.
@@ -196,14 +198,14 @@ does not have the complex overhead required to detect cursor tampering.
.. _`Ada.Containers.Formal_Ordered_Sets_(a-cforse.ads)`:
-`Ada.Containers.Formal_Ordered_Sets` (:file:`a-cforse.ads`)
-===========================================================
+``Ada.Containers.Formal_Ordered_Sets`` (:file:`a-cforse.ads`)
+=============================================================
.. index:: Ada.Containers.Formal_Ordered_Sets (a-cforse.ads)
.. index:: Formal container for ordered sets
-This child of `Ada.Containers` defines a modified version of the
+This child of ``Ada.Containers`` defines a modified version of the
Ada 2005 container for ordered sets, meant to facilitate formal
verification of code using such containers. The specification of this
unit is compatible with SPARK 2014.
@@ -215,14 +217,14 @@ does not have the complex overhead required to detect cursor tampering.
.. _`Ada.Containers.Formal_Vectors_(a-cofove.ads)`:
-`Ada.Containers.Formal_Vectors` (:file:`a-cofove.ads`)
-======================================================
+``Ada.Containers.Formal_Vectors`` (:file:`a-cofove.ads`)
+========================================================
.. index:: Ada.Containers.Formal_Vectors (a-cofove.ads)
.. index:: Formal container for vectors
-This child of `Ada.Containers` defines a modified version of the
+This child of ``Ada.Containers`` defines a modified version of the
Ada 2005 container for vectors, meant to facilitate formal
verification of code using such containers. The specification of this
unit is compatible with SPARK 2014.
@@ -234,14 +236,14 @@ does not have the complex overhead required to detect cursor tampering.
.. _`Ada.Containers.Formal_Indefinite_Vectors_(a-cfinve.ads)`:
-`Ada.Containers.Formal_Indefinite_Vectors` (:file:`a-cfinve.ads`)
-=================================================================
+``Ada.Containers.Formal_Indefinite_Vectors`` (:file:`a-cfinve.ads`)
+===================================================================
.. index:: Ada.Containers.Formal_Indefinite_Vectors (a-cfinve.ads)
.. index:: Formal container for vectors
-This child of `Ada.Containers` defines a modified version of the
+This child of ``Ada.Containers`` defines a modified version of the
Ada 2005 container for vectors of indefinite elements, meant to
facilitate formal verification of code using such containers. The
specification of this unit is compatible with SPARK 2014.
@@ -251,35 +253,101 @@ in mind, it may well be generally useful in that it is a simplified more
efficient version than the one defined in the standard. In particular it
does not have the complex overhead required to detect cursor tampering.
+.. _`Ada.Containers.Functional_Vectors_(a-cofuve.ads)`:
+
+``Ada.Containers.Functional_Vectors`` (:file:`a-cofuve.ads`)
+=================================================================
+
+.. index:: Ada.Containers.Functional_Vectors (a-cofuve.ads)
+
+.. index:: Functional vectors
+
+This child of ``Ada.Containers`` defines immutable vectors. These
+containers are unbounded and may contain indefinite elements. Furthermore, to
+be usable in every context, they are neither controlled nor limited. As they
+are functional, that is, no primitives are provided which would allow modifying
+an existing container, these containers can still be used safely.
+
+Their API features functions creating new containers from existing ones.
+As a consequence, these containers are highly inefficient. They are also
+memory consuming, as the allocated memory is not reclaimed when the container
+is no longer referenced. Thus, they should in general be used in ghost code
+and annotations, so that they can be removed from the final executable. The
+specification of this unit is compatible with SPARK 2014.
+
+.. _`Ada.Containers.Functional_Sets_(a-cofuse.ads)`:
+
+``Ada.Containers.Functional_Sets`` (:file:`a-cofuse.ads`)
+=================================================================
+
+.. index:: Ada.Containers.Functional_Sets (a-cofuse.ads)
+
+.. index:: Functional sets
+
+This child of ``Ada.Containers`` defines immutable sets. These containers are
+unbounded and may contain indefinite elements. Furthermore, to be usable in
+every context, they are neither controlled nor limited. As they are functional,
+that is, no primitives are provided which would allow modifying an existing
+container, these containers can still be used safely.
+
+Their API features functions creating new containers from existing ones.
+As a consequence, these containers are highly inefficient. They are also
+memory consuming, as the allocated memory is not reclaimed when the container
+is no longer referenced. Thus, they should in general be used in ghost code
+and annotations, so that they can be removed from the final executable. The
+specification of this unit is compatible with SPARK 2014.
+
+.. _`Ada.Containers.Functional_Maps_(a-cofuma.ads)`:
+
+``Ada.Containers.Functional_Maps`` (:file:`a-cofuma.ads`)
+=================================================================
+
+.. index:: Ada.Containers.Functional_Maps (a-cofuma.ads)
+
+.. index:: Functional maps
+
+This child of ``Ada.Containers`` defines immutable maps. These containers are
+unbounded and may contain indefinite elements. Furthermore, to be usable in
+every context, they are neither controlled nor limited. As they are functional,
+that is, no primitives are provided which would allow modifying an existing
+container, these containers can still be used safely.
+
+Their API features functions creating new containers from existing ones.
+As a consequence, these containers are highly inefficient. They are also
+memory consuming, as the allocated memory is not reclaimed when the container
+is no longer referenced. Thus, they should in general be used in ghost code
+and annotations, so that they can be removed from the final executable. The
+specification of this unit is compatible with SPARK 2014.
+
.. _`Ada.Containers.Bounded_Holders_(a-coboho.ads)`:
-`Ada.Containers.Bounded_Holders` (:file:`a-coboho.ads`)
-=======================================================
+``Ada.Containers.Bounded_Holders`` (:file:`a-coboho.ads`)
+=========================================================
.. index:: Ada.Containers.Bounded_Holders (a-coboho.ads)
.. index:: Formal container for vectors
-This child of `Ada.Containers` defines a modified version of
+This child of ``Ada.Containers`` defines a modified version of
Indefinite_Holders that avoids heap allocation.
.. _`Ada.Command_Line.Environment_(a-colien.ads)`:
-`Ada.Command_Line.Environment` (:file:`a-colien.ads`)
-=====================================================
+``Ada.Command_Line.Environment`` (:file:`a-colien.ads`)
+=======================================================
.. index:: Ada.Command_Line.Environment (a-colien.ads)
.. index:: Environment entries
-This child of `Ada.Command_Line`
+This child of ``Ada.Command_Line``
provides a mechanism for obtaining environment values on systems
where this concept makes sense.
.. _`Ada.Command_Line.Remove_(a-colire.ads)`:
-`Ada.Command_Line.Remove` (:file:`a-colire.ads`)
-================================================
+``Ada.Command_Line.Remove`` (:file:`a-colire.ads`)
+==================================================
.. index:: Ada.Command_Line.Remove (a-colire.ads)
@@ -287,16 +355,16 @@ where this concept makes sense.
.. index:: Command line, argument removal
-This child of `Ada.Command_Line`
+This child of ``Ada.Command_Line``
provides a mechanism for logically removing
arguments from the argument list. Once removed, an argument is not visible
-to further calls on the subprograms in `Ada.Command_Line` will not
+to further calls on the subprograms in ``Ada.Command_Line`` will not
see the removed argument.
.. _`Ada.Command_Line.Response_File_(a-clrefi.ads)`:
-`Ada.Command_Line.Response_File` (:file:`a-clrefi.ads`)
-=======================================================
+``Ada.Command_Line.Response_File`` (:file:`a-clrefi.ads`)
+=========================================================
.. index:: Ada.Command_Line.Response_File (a-clrefi.ads)
@@ -306,42 +374,42 @@ see the removed argument.
.. index:: Command line, handling long command lines
-This child of `Ada.Command_Line` provides a mechanism facilities for
+This child of ``Ada.Command_Line`` provides a mechanism facilities for
getting command line arguments from a text file, called a "response file".
Using a response file allow passing a set of arguments to an executable longer
than the maximum allowed by the system on the command line.
.. _`Ada.Direct_IO.C_Streams_(a-diocst.ads)`:
-`Ada.Direct_IO.C_Streams` (:file:`a-diocst.ads`)
-================================================
+``Ada.Direct_IO.C_Streams`` (:file:`a-diocst.ads`)
+==================================================
.. index:: Ada.Direct_IO.C_Streams (a-diocst.ads)
.. index:: C Streams, Interfacing with Direct_IO
This package provides subprograms that allow interfacing between
-C streams and `Direct_IO`. The stream identifier can be
+C streams and ``Direct_IO``. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
.. _`Ada.Exceptions.Is_Null_Occurrence_(a-einuoc.ads)`:
-`Ada.Exceptions.Is_Null_Occurrence` (:file:`a-einuoc.ads`)
-==========================================================
+``Ada.Exceptions.Is_Null_Occurrence`` (:file:`a-einuoc.ads`)
+============================================================
.. index:: Ada.Exceptions.Is_Null_Occurrence (a-einuoc.ads)
.. index:: Null_Occurrence, testing for
This child subprogram provides a way of testing for the null
-exception occurrence (`Null_Occurrence`) without raising
+exception occurrence (``Null_Occurrence``) without raising
an exception.
.. _`Ada.Exceptions.Last_Chance_Handler_(a-elchha.ads)`:
-`Ada.Exceptions.Last_Chance_Handler` (:file:`a-elchha.ads`)
-===========================================================
+``Ada.Exceptions.Last_Chance_Handler`` (:file:`a-elchha.ads`)
+=============================================================
.. index:: Ada.Exceptions.Last_Chance_Handler (a-elchha.ads)
@@ -353,49 +421,49 @@ terminating the program. Note that this subprogram never returns.
.. _`Ada.Exceptions.Traceback_(a-exctra.ads)`:
-`Ada.Exceptions.Traceback` (:file:`a-exctra.ads`)
-=================================================
+``Ada.Exceptions.Traceback`` (:file:`a-exctra.ads`)
+===================================================
.. index:: Ada.Exceptions.Traceback (a-exctra.ads)
.. index:: Traceback for Exception Occurrence
-This child package provides the subprogram (`Tracebacks`) to
+This child package provides the subprogram (``Tracebacks``) to
give a traceback array of addresses based on an exception
occurrence.
.. _`Ada.Sequential_IO.C_Streams_(a-siocst.ads)`:
-`Ada.Sequential_IO.C_Streams` (:file:`a-siocst.ads`)
-====================================================
+``Ada.Sequential_IO.C_Streams`` (:file:`a-siocst.ads`)
+======================================================
.. index:: Ada.Sequential_IO.C_Streams (a-siocst.ads)
.. index:: C Streams, Interfacing with Sequential_IO
This package provides subprograms that allow interfacing between
-C streams and `Sequential_IO`. The stream identifier can be
+C streams and ``Sequential_IO``. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
.. _`Ada.Streams.Stream_IO.C_Streams_(a-ssicst.ads)`:
-`Ada.Streams.Stream_IO.C_Streams` (:file:`a-ssicst.ads`)
-========================================================
+``Ada.Streams.Stream_IO.C_Streams`` (:file:`a-ssicst.ads`)
+==========================================================
.. index:: Ada.Streams.Stream_IO.C_Streams (a-ssicst.ads)
.. index:: C Streams, Interfacing with Stream_IO
This package provides subprograms that allow interfacing between
-C streams and `Stream_IO`. The stream identifier can be
+C streams and ``Stream_IO``. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
.. _`Ada.Strings.Unbounded.Text_IO_(a-suteio.ads)`:
-`Ada.Strings.Unbounded.Text_IO` (:file:`a-suteio.ads`)
-======================================================
+``Ada.Strings.Unbounded.Text_IO`` (:file:`a-suteio.ads`)
+========================================================
.. index:: Ada.Strings.Unbounded.Text_IO (a-suteio.ads)
@@ -409,8 +477,8 @@ with ordinary strings.
.. _`Ada.Strings.Wide_Unbounded.Wide_Text_IO_(a-swuwti.ads)`:
-`Ada.Strings.Wide_Unbounded.Wide_Text_IO` (:file:`a-swuwti.ads`)
-================================================================
+``Ada.Strings.Wide_Unbounded.Wide_Text_IO`` (:file:`a-swuwti.ads`)
+==================================================================
.. index:: Ada.Strings.Wide_Unbounded.Wide_Text_IO (a-swuwti.ads)
@@ -424,8 +492,8 @@ with ordinary wide strings.
.. _`Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO_(a-szuzti.ads)`:
-`Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO` (:file:`a-szuzti.ads`)
-==========================================================================
+``Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO`` (:file:`a-szuzti.ads`)
+============================================================================
.. index:: Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO (a-szuzti.ads)
@@ -439,22 +507,22 @@ with ordinary wide wide strings.
.. _`Ada.Text_IO.C_Streams_(a-tiocst.ads)`:
-`Ada.Text_IO.C_Streams` (:file:`a-tiocst.ads`)
-==============================================
+``Ada.Text_IO.C_Streams`` (:file:`a-tiocst.ads`)
+================================================
.. index:: Ada.Text_IO.C_Streams (a-tiocst.ads)
-.. index:: C Streams, Interfacing with `Text_IO`
+.. index:: C Streams, Interfacing with ``Text_IO``
This package provides subprograms that allow interfacing between
-C streams and `Text_IO`. The stream identifier can be
+C streams and ``Text_IO``. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
.. _`Ada.Text_IO.Reset_Standard_Files_(a-tirsfi.ads)`:
-`Ada.Text_IO.Reset_Standard_Files` (:file:`a-tirsfi.ads`)
-=========================================================
+``Ada.Text_IO.Reset_Standard_Files`` (:file:`a-tirsfi.ads`)
+===========================================================
.. index:: Ada.Text_IO.Reset_Standard_Files (a-tirsfi.ads)
@@ -468,8 +536,8 @@ interactive).
.. _`Ada.Wide_Characters.Unicode_(a-wichun.ads)`:
-`Ada.Wide_Characters.Unicode` (:file:`a-wichun.ads`)
-====================================================
+``Ada.Wide_Characters.Unicode`` (:file:`a-wichun.ads`)
+======================================================
.. index:: Ada.Wide_Characters.Unicode (a-wichun.ads)
@@ -480,22 +548,22 @@ Wide_Character values according to Unicode categories.
.. _`Ada.Wide_Text_IO.C_Streams_(a-wtcstr.ads)`:
-`Ada.Wide_Text_IO.C_Streams` (:file:`a-wtcstr.ads`)
-===================================================
+``Ada.Wide_Text_IO.C_Streams`` (:file:`a-wtcstr.ads`)
+=====================================================
.. index:: Ada.Wide_Text_IO.C_Streams (a-wtcstr.ads)
-.. index:: C Streams, Interfacing with `Wide_Text_IO`
+.. index:: C Streams, Interfacing with ``Wide_Text_IO``
This package provides subprograms that allow interfacing between
-C streams and `Wide_Text_IO`. The stream identifier can be
+C streams and ``Wide_Text_IO``. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
.. _`Ada.Wide_Text_IO.Reset_Standard_Files_(a-wrstfi.ads)`:
-`Ada.Wide_Text_IO.Reset_Standard_Files` (:file:`a-wrstfi.ads`)
-==============================================================
+``Ada.Wide_Text_IO.Reset_Standard_Files`` (:file:`a-wrstfi.ads`)
+================================================================
.. index:: Ada.Wide_Text_IO.Reset_Standard_Files (a-wrstfi.ads)
@@ -509,8 +577,8 @@ interactive).
.. _`Ada.Wide_Wide_Characters.Unicode_(a-zchuni.ads)`:
-`Ada.Wide_Wide_Characters.Unicode` (:file:`a-zchuni.ads`)
-=========================================================
+``Ada.Wide_Wide_Characters.Unicode`` (:file:`a-zchuni.ads`)
+===========================================================
.. index:: Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads)
@@ -521,22 +589,22 @@ Wide_Wide_Character values according to Unicode categories.
.. _`Ada.Wide_Wide_Text_IO.C_Streams_(a-ztcstr.ads)`:
-`Ada.Wide_Wide_Text_IO.C_Streams` (:file:`a-ztcstr.ads`)
-========================================================
+``Ada.Wide_Wide_Text_IO.C_Streams`` (:file:`a-ztcstr.ads`)
+==========================================================
.. index:: Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads)
-.. index:: C Streams, Interfacing with `Wide_Wide_Text_IO`
+.. index:: C Streams, Interfacing with ``Wide_Wide_Text_IO``
This package provides subprograms that allow interfacing between
-C streams and `Wide_Wide_Text_IO`. The stream identifier can be
+C streams and ``Wide_Wide_Text_IO``. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
.. _`Ada.Wide_Wide_Text_IO.Reset_Standard_Files_(a-zrstfi.ads)`:
-`Ada.Wide_Wide_Text_IO.Reset_Standard_Files` (:file:`a-zrstfi.ads`)
-===================================================================
+``Ada.Wide_Wide_Text_IO.Reset_Standard_Files`` (:file:`a-zrstfi.ads`)
+=====================================================================
.. index:: Ada.Wide_Wide_Text_IO.Reset_Standard_Files (a-zrstfi.ads)
@@ -550,8 +618,8 @@ redefined to be interactive).
.. _`GNAT.Altivec_(g-altive.ads)`:
-`GNAT.Altivec` (:file:`g-altive.ads`)
-=====================================
+``GNAT.Altivec`` (:file:`g-altive.ads`)
+=======================================
.. index:: GNAT.Altivec (g-altive.ads)
@@ -563,8 +631,8 @@ binding.
.. _`GNAT.Altivec.Conversions_(g-altcon.ads)`:
-`GNAT.Altivec.Conversions` (:file:`g-altcon.ads`)
-=================================================
+``GNAT.Altivec.Conversions`` (:file:`g-altcon.ads`)
+===================================================
.. index:: GNAT.Altivec.Conversions (g-altcon.ads)
@@ -574,8 +642,8 @@ This package provides the Vector/View conversion routines.
.. _`GNAT.Altivec.Vector_Operations_(g-alveop.ads)`:
-`GNAT.Altivec.Vector_Operations` (:file:`g-alveop.ads`)
-=======================================================
+``GNAT.Altivec.Vector_Operations`` (:file:`g-alveop.ads`)
+=========================================================
.. index:: GNAT.Altivec.Vector_Operations (g-alveop.ads)
@@ -588,8 +656,8 @@ is common to both bindings.
.. _`GNAT.Altivec.Vector_Types_(g-alvety.ads)`:
-`GNAT.Altivec.Vector_Types` (:file:`g-alvety.ads`)
-==================================================
+``GNAT.Altivec.Vector_Types`` (:file:`g-alvety.ads`)
+====================================================
.. index:: GNAT.Altivec.Vector_Types (g-alvety.ads)
@@ -600,8 +668,8 @@ to AltiVec facilities.
.. _`GNAT.Altivec.Vector_Views_(g-alvevi.ads)`:
-`GNAT.Altivec.Vector_Views` (:file:`g-alvevi.ads`)
-==================================================
+``GNAT.Altivec.Vector_Views`` (:file:`g-alvevi.ads`)
+====================================================
.. index:: GNAT.Altivec.Vector_Views (g-alvevi.ads)
@@ -615,8 +683,8 @@ objects.
.. _`GNAT.Array_Split_(g-arrspl.ads)`:
-`GNAT.Array_Split` (:file:`g-arrspl.ads`)
-=========================================
+``GNAT.Array_Split`` (:file:`g-arrspl.ads`)
+===========================================
.. index:: GNAT.Array_Split (g-arrspl.ads)
@@ -628,8 +696,8 @@ to the resulting slices.
.. _`GNAT.AWK_(g-awk.ads)`:
-`GNAT.AWK` (:file:`g-awk.ads`)
-==============================
+``GNAT.AWK`` (:file:`g-awk.ads`)
+================================
.. index:: GNAT.AWK (g-awk.ads)
@@ -643,21 +711,21 @@ where each record is a line and a field is a data element in this line.
.. _`GNAT.Bind_Environment_(g-binenv.ads)`:
-`GNAT.Bind_Environment` (:file:`g-binenv.ads`)
-==============================================
+``GNAT.Bind_Environment`` (:file:`g-binenv.ads`)
+================================================
.. index:: GNAT.Bind_Environment (g-binenv.ads)
.. index:: Bind environment
Provides access to key=value associations captured at bind time.
-These associations can be specified using the `-V` binder command
+These associations can be specified using the :switch:`-V` binder command
line switch.
.. _`GNAT.Bounded_Buffers_(g-boubuf.ads)`:
-`GNAT.Bounded_Buffers` (:file:`g-boubuf.ads`)
-=============================================
+``GNAT.Bounded_Buffers`` (:file:`g-boubuf.ads`)
+===============================================
.. index:: GNAT.Bounded_Buffers (g-boubuf.ads)
@@ -671,8 +739,8 @@ such as mailboxes.
.. _`GNAT.Bounded_Mailboxes_(g-boumai.ads)`:
-`GNAT.Bounded_Mailboxes` (:file:`g-boumai.ads`)
-===============================================
+``GNAT.Bounded_Mailboxes`` (:file:`g-boumai.ads`)
+=================================================
.. index:: GNAT.Bounded_Mailboxes (g-boumai.ads)
@@ -684,8 +752,8 @@ Provides a thread-safe asynchronous intertask mailbox communication facility.
.. _`GNAT.Bubble_Sort_(g-bubsor.ads)`:
-`GNAT.Bubble_Sort` (:file:`g-bubsor.ads`)
-=========================================
+``GNAT.Bubble_Sort`` (:file:`g-bubsor.ads`)
+===========================================
.. index:: GNAT.Bubble_Sort (g-bubsor.ads)
@@ -699,8 +767,8 @@ access-to-procedure values.
.. _`GNAT.Bubble_Sort_A_(g-busora.ads)`:
-`GNAT.Bubble_Sort_A` (:file:`g-busora.ads`)
-===========================================
+``GNAT.Bubble_Sort_A`` (:file:`g-busora.ads`)
+=============================================
.. index:: GNAT.Bubble_Sort_A (g-busora.ads)
@@ -711,12 +779,12 @@ access-to-procedure values.
Provides a general implementation of bubble sort usable for sorting arbitrary
data items. Move and comparison procedures are provided by passing
access-to-procedure values. This is an older version, retained for
-compatibility. Usually `GNAT.Bubble_Sort` will be preferable.
+compatibility. Usually ``GNAT.Bubble_Sort`` will be preferable.
.. _`GNAT.Bubble_Sort_G_(g-busorg.ads)`:
-`GNAT.Bubble_Sort_G` (:file:`g-busorg.ads`)
-===========================================
+``GNAT.Bubble_Sort_G`` (:file:`g-busorg.ads`)
+=============================================
.. index:: GNAT.Bubble_Sort_G (g-busorg.ads)
@@ -724,15 +792,15 @@ compatibility. Usually `GNAT.Bubble_Sort` will be preferable.
.. index:: Bubble sort
-Similar to `Bubble_Sort_A` except that the move and sorting procedures
+Similar to ``Bubble_Sort_A`` except that the move and sorting procedures
are provided as generic parameters, this improves efficiency, especially
if the procedures can be inlined, at the expense of duplicating code for
multiple instantiations.
.. _`GNAT.Byte_Order_Mark_(g-byorma.ads)`:
-`GNAT.Byte_Order_Mark` (:file:`g-byorma.ads`)
-=============================================
+``GNAT.Byte_Order_Mark`` (:file:`g-byorma.ads`)
+===============================================
.. index:: GNAT.Byte_Order_Mark (g-byorma.ads)
@@ -747,8 +815,8 @@ sequences for various UCS input formats.
.. _`GNAT.Byte_Swapping_(g-bytswa.ads)`:
-`GNAT.Byte_Swapping` (:file:`g-bytswa.ads`)
-===========================================
+``GNAT.Byte_Swapping`` (:file:`g-bytswa.ads`)
+=============================================
.. index:: GNAT.Byte_Swapping (g-bytswa.ads)
@@ -761,22 +829,22 @@ Machine-specific implementations are available in some cases.
.. _`GNAT.Calendar_(g-calend.ads)`:
-`GNAT.Calendar` (:file:`g-calend.ads`)
-======================================
+``GNAT.Calendar`` (:file:`g-calend.ads`)
+========================================
.. index:: GNAT.Calendar (g-calend.ads)
.. index:: Calendar
-Extends the facilities provided by `Ada.Calendar` to include handling
-of days of the week, an extended `Split` and `Time_Of` capability.
-Also provides conversion of `Ada.Calendar.Time` values to and from the
-C `timeval` format.
+Extends the facilities provided by ``Ada.Calendar`` to include handling
+of days of the week, an extended ``Split`` and ``Time_Of`` capability.
+Also provides conversion of ``Ada.Calendar.Time`` values to and from the
+C ``timeval`` format.
.. _`GNAT.Calendar.Time_IO_(g-catiio.ads)`:
-`GNAT.Calendar.Time_IO` (:file:`g-catiio.ads`)
-==============================================
+``GNAT.Calendar.Time_IO`` (:file:`g-catiio.ads`)
+================================================
.. index:: Calendar
@@ -786,8 +854,8 @@ C `timeval` format.
.. _`GNAT.CRC32_(g-crc32.ads)`:
-`GNAT.CRC32` (:file:`g-crc32.ads`)
-==================================
+``GNAT.CRC32`` (:file:`g-crc32.ads`)
+====================================
.. index:: GNAT.CRC32 (g-crc32.ads)
@@ -803,23 +871,23 @@ Aug. 1988. Sarwate, D.V.
.. _`GNAT.Case_Util_(g-casuti.ads)`:
-`GNAT.Case_Util` (:file:`g-casuti.ads`)
-=======================================
+``GNAT.Case_Util`` (:file:`g-casuti.ads`)
+=========================================
.. index:: GNAT.Case_Util (g-casuti.ads)
.. index:: Casing utilities
-.. index:: Character handling (`GNAT.Case_Util`)
+.. index:: Character handling (``GNAT.Case_Util``)
A set of simple routines for handling upper and lower casing of strings
without the overhead of the full casing tables
-in `Ada.Characters.Handling`.
+in ``Ada.Characters.Handling``.
.. _`GNAT.CGI_(g-cgi.ads)`:
-`GNAT.CGI` (:file:`g-cgi.ads`)
-==============================
+``GNAT.CGI`` (:file:`g-cgi.ads`)
+================================
.. index:: GNAT.CGI (g-cgi.ads)
@@ -833,8 +901,8 @@ with this table.
.. _`GNAT.CGI.Cookie_(g-cgicoo.ads)`:
-`GNAT.CGI.Cookie` (:file:`g-cgicoo.ads`)
-========================================
+``GNAT.CGI.Cookie`` (:file:`g-cgicoo.ads`)
+==========================================
.. index:: GNAT.CGI.Cookie (g-cgicoo.ads)
@@ -848,8 +916,8 @@ cookies (piece of information kept in the Web client software).
.. _`GNAT.CGI.Debug_(g-cgideb.ads)`:
-`GNAT.CGI.Debug` (:file:`g-cgideb.ads`)
-=======================================
+``GNAT.CGI.Debug`` (:file:`g-cgideb.ads`)
+=========================================
.. index:: GNAT.CGI.Debug (g-cgideb.ads)
@@ -860,21 +928,21 @@ programs written in Ada.
.. _`GNAT.Command_Line_(g-comlin.ads)`:
-`GNAT.Command_Line` (:file:`g-comlin.ads`)
-==========================================
+``GNAT.Command_Line`` (:file:`g-comlin.ads`)
+============================================
.. index:: GNAT.Command_Line (g-comlin.ads)
.. index:: Command line
-Provides a high level interface to `Ada.Command_Line` facilities,
+Provides a high level interface to ``Ada.Command_Line`` facilities,
including the ability to scan for named switches with optional parameters
and expand file names using wild card notations.
.. _`GNAT.Compiler_Version_(g-comver.ads)`:
-`GNAT.Compiler_Version` (:file:`g-comver.ads`)
-==============================================
+``GNAT.Compiler_Version`` (:file:`g-comver.ads`)
+================================================
.. index:: GNAT.Compiler_Version (g-comver.ads)
@@ -890,8 +958,8 @@ of a partition).
.. _`GNAT.Ctrl_C_(g-ctrl_c.ads)`:
-`GNAT.Ctrl_C` (:file:`g-ctrl_c.ads`)
-====================================
+``GNAT.Ctrl_C`` (:file:`g-ctrl_c.ads`)
+======================================
.. index:: GNAT.Ctrl_C (g-ctrl_c.ads)
@@ -901,8 +969,8 @@ Provides a simple interface to handle Ctrl-C keyboard events.
.. _`GNAT.Current_Exception_(g-curexc.ads)`:
-`GNAT.Current_Exception` (:file:`g-curexc.ads`)
-===============================================
+``GNAT.Current_Exception`` (:file:`g-curexc.ads`)
+=================================================
.. index:: GNAT.Current_Exception (g-curexc.ads)
@@ -918,8 +986,8 @@ obtaining information about exceptions provided by Ada 83 compilers.
.. _`GNAT.Debug_Pools_(g-debpoo.ads)`:
-`GNAT.Debug_Pools` (:file:`g-debpoo.ads`)
-=========================================
+``GNAT.Debug_Pools`` (:file:`g-debpoo.ads`)
+===========================================
.. index:: GNAT.Debug_Pools (g-debpoo.ads)
@@ -931,12 +999,12 @@ obtaining information about exceptions provided by Ada 83 compilers.
Provide a debugging storage pools that helps tracking memory corruption
problems.
-See `The GNAT Debug_Pool Facility` section in the :title:`GNAT User's Guide`.
+See ``The GNAT Debug_Pool Facility`` section in the :title:`GNAT User's Guide`.
.. _`GNAT.Debug_Utilities_(g-debuti.ads)`:
-`GNAT.Debug_Utilities` (:file:`g-debuti.ads`)
-=============================================
+``GNAT.Debug_Utilities`` (:file:`g-debuti.ads`)
+===============================================
.. index:: GNAT.Debug_Utilities (g-debuti.ads)
@@ -948,8 +1016,8 @@ for hexadecimal literals.
.. _`GNAT.Decode_String_(g-decstr.ads)`:
-`GNAT.Decode_String` (:file:`g-decstr.ads`)
-===========================================
+``GNAT.Decode_String`` (:file:`g-decstr.ads`)
+=============================================
.. index:: GNAT.Decode_String (g-decstr.ads)
@@ -972,8 +1040,8 @@ preinstantiation for UTF-8. See next entry.
.. _`GNAT.Decode_UTF8_String_(g-deutst.ads)`:
-`GNAT.Decode_UTF8_String` (:file:`g-deutst.ads`)
-================================================
+``GNAT.Decode_UTF8_String`` (:file:`g-deutst.ads`)
+==================================================
.. index:: GNAT.Decode_UTF8_String (g-deutst.ads)
@@ -993,8 +1061,8 @@ A preinstantiation of GNAT.Decode_Strings for UTF-8 encoding.
.. _`GNAT.Directory_Operations_(g-dirope.ads)`:
-`GNAT.Directory_Operations` (:file:`g-dirope.ads`)
-==================================================
+``GNAT.Directory_Operations`` (:file:`g-dirope.ads`)
+====================================================
.. index:: GNAT.Directory_Operations (g-dirope.ads)
@@ -1006,8 +1074,8 @@ directory.
.. _`GNAT.Directory_Operations.Iteration_(g-diopit.ads)`:
-`GNAT.Directory_Operations.Iteration` (:file:`g-diopit.ads`)
-============================================================
+``GNAT.Directory_Operations.Iteration`` (:file:`g-diopit.ads`)
+==============================================================
.. index:: GNAT.Directory_Operations.Iteration (g-diopit.ads)
@@ -1018,8 +1086,8 @@ for iterating through directories.
.. _`GNAT.Dynamic_HTables_(g-dynhta.ads)`:
-`GNAT.Dynamic_HTables` (:file:`g-dynhta.ads`)
-=============================================
+``GNAT.Dynamic_HTables`` (:file:`g-dynhta.ads`)
+===============================================
.. index:: GNAT.Dynamic_HTables (g-dynhta.ads)
@@ -1029,15 +1097,15 @@ A generic implementation of hash tables that can be used to hash arbitrary
data. Provided in two forms, a simple form with built in hash functions,
and a more complex form in which the hash function is supplied.
-This package provides a facility similar to that of `GNAT.HTable`,
+This package provides a facility similar to that of ``GNAT.HTable``,
except that this package declares a type that can be used to define
dynamic instances of the hash table, while an instantiation of
-`GNAT.HTable` creates a single instance of the hash table.
+``GNAT.HTable`` creates a single instance of the hash table.
.. _`GNAT.Dynamic_Tables_(g-dyntab.ads)`:
-`GNAT.Dynamic_Tables` (:file:`g-dyntab.ads`)
-============================================
+``GNAT.Dynamic_Tables`` (:file:`g-dyntab.ads`)
+==============================================
.. index:: GNAT.Dynamic_Tables (g-dyntab.ads)
@@ -1048,15 +1116,15 @@ dynamic instances of the hash table, while an instantiation of
A generic package providing a single dimension array abstraction where the
length of the array can be dynamically modified.
-This package provides a facility similar to that of `GNAT.Table`,
+This package provides a facility similar to that of ``GNAT.Table``,
except that this package declares a type that can be used to define
dynamic instances of the table, while an instantiation of
-`GNAT.Table` creates a single instance of the table type.
+``GNAT.Table`` creates a single instance of the table type.
.. _`GNAT.Encode_String_(g-encstr.ads)`:
-`GNAT.Encode_String` (:file:`g-encstr.ads`)
-===========================================
+``GNAT.Encode_String`` (:file:`g-encstr.ads`)
+=============================================
.. index:: GNAT.Encode_String (g-encstr.ads)
@@ -1077,8 +1145,8 @@ Note there is a preinstantiation for UTF-8. See next entry.
.. _`GNAT.Encode_UTF8_String_(g-enutst.ads)`:
-`GNAT.Encode_UTF8_String` (:file:`g-enutst.ads`)
-================================================
+``GNAT.Encode_UTF8_String`` (:file:`g-enutst.ads`)
+==================================================
.. index:: GNAT.Encode_UTF8_String (g-enutst.ads)
@@ -1098,8 +1166,8 @@ A preinstantiation of GNAT.Encode_Strings for UTF-8 encoding.
.. _`GNAT.Exception_Actions_(g-excact.ads)`:
-`GNAT.Exception_Actions` (:file:`g-excact.ads`)
-===============================================
+``GNAT.Exception_Actions`` (:file:`g-excact.ads`)
+=================================================
.. index:: GNAT.Exception_Actions (g-excact.ads)
@@ -1111,8 +1179,8 @@ can be used for instance to force a core dump to ease debugging.
.. _`GNAT.Exception_Traces_(g-exctra.ads)`:
-`GNAT.Exception_Traces` (:file:`g-exctra.ads`)
-==============================================
+``GNAT.Exception_Traces`` (:file:`g-exctra.ads`)
+================================================
.. index:: GNAT.Exception_Traces (g-exctra.ads)
@@ -1125,8 +1193,8 @@ occurrences.
.. _`GNAT.Exceptions_(g-expect.ads)`:
-`GNAT.Exceptions` (:file:`g-expect.ads`)
-========================================
+``GNAT.Exceptions`` (:file:`g-expect.ads`)
+==========================================
.. index:: GNAT.Exceptions (g-expect.ads)
@@ -1136,16 +1204,16 @@ occurrences.
Normally it is not possible to raise an exception with
a message from a subprogram in a pure package, since the
-necessary types and subprograms are in `Ada.Exceptions`
-which is not a pure unit. `GNAT.Exceptions` provides a
+necessary types and subprograms are in ``Ada.Exceptions``
+which is not a pure unit. ``GNAT.Exceptions`` provides a
facility for getting around this limitation for a few
predefined exceptions, and for example allow raising
-`Constraint_Error` with a message from a pure subprogram.
+``Constraint_Error`` with a message from a pure subprogram.
.. _`GNAT.Expect_(g-expect.ads)`:
-`GNAT.Expect` (:file:`g-expect.ads`)
-====================================
+``GNAT.Expect`` (:file:`g-expect.ads`)
+======================================
.. index:: GNAT.Expect (g-expect.ads)
@@ -1153,27 +1221,27 @@ Provides a set of subprograms similar to what is available
with the standard Tcl Expect tool.
It allows you to easily spawn and communicate with an external process.
You can send commands or inputs to the process, and compare the output
-with some expected regular expression. Currently `GNAT.Expect`
+with some expected regular expression. Currently ``GNAT.Expect``
is implemented on all native GNAT ports.
It is not implemented for cross ports, and in particular is not
implemented for VxWorks or LynxOS.
.. _`GNAT.Expect.TTY_(g-exptty.ads)`:
-`GNAT.Expect.TTY` (:file:`g-exptty.ads`)
-========================================
+``GNAT.Expect.TTY`` (:file:`g-exptty.ads`)
+==========================================
.. index:: GNAT.Expect.TTY (g-exptty.ads)
As GNAT.Expect but using pseudo-terminal.
-Currently `GNAT.Expect.TTY` is implemented on all native GNAT
+Currently ``GNAT.Expect.TTY`` is implemented on all native GNAT
ports. It is not implemented for cross ports, and
in particular is not implemented for VxWorks or LynxOS.
.. _`GNAT.Float_Control_(g-flocon.ads)`:
-`GNAT.Float_Control` (:file:`g-flocon.ads`)
-===========================================
+``GNAT.Float_Control`` (:file:`g-flocon.ads`)
+=============================================
.. index:: GNAT.Float_Control (g-flocon.ads)
@@ -1186,8 +1254,8 @@ in this package can be used to reestablish the required mode.
.. _`GNAT.Formatted_String_(g-forstr.ads)`:
-`GNAT.Formatted_String` (:file:`g-forstr.ads`)
-==============================================
+``GNAT.Formatted_String`` (:file:`g-forstr.ads`)
+================================================
.. index:: GNAT.Formatted_String (g-forstr.ads)
@@ -1201,8 +1269,8 @@ formatted string.
.. _`GNAT.Heap_Sort_(g-heasor.ads)`:
-`GNAT.Heap_Sort` (:file:`g-heasor.ads`)
-=======================================
+``GNAT.Heap_Sort`` (:file:`g-heasor.ads`)
+=========================================
.. index:: GNAT.Heap_Sort (g-heasor.ads)
@@ -1215,8 +1283,8 @@ that performs approximately N*log(N) comparisons in the worst case.
.. _`GNAT.Heap_Sort_A_(g-hesora.ads)`:
-`GNAT.Heap_Sort_A` (:file:`g-hesora.ads`)
-=========================================
+``GNAT.Heap_Sort_A`` (:file:`g-hesora.ads`)
+===========================================
.. index:: GNAT.Heap_Sort_A (g-hesora.ads)
@@ -1226,27 +1294,27 @@ Provides a general implementation of heap sort usable for sorting arbitrary
data items. Move and comparison procedures are provided by passing
access-to-procedure values. The algorithm used is a modified heap sort
that performs approximately N*log(N) comparisons in the worst case.
-This differs from `GNAT.Heap_Sort` in having a less convenient
+This differs from ``GNAT.Heap_Sort`` in having a less convenient
interface, but may be slightly more efficient.
.. _`GNAT.Heap_Sort_G_(g-hesorg.ads)`:
-`GNAT.Heap_Sort_G` (:file:`g-hesorg.ads`)
-=========================================
+``GNAT.Heap_Sort_G`` (:file:`g-hesorg.ads`)
+===========================================
.. index:: GNAT.Heap_Sort_G (g-hesorg.ads)
.. index:: Sorting
-Similar to `Heap_Sort_A` except that the move and sorting procedures
+Similar to ``Heap_Sort_A`` except that the move and sorting procedures
are provided as generic parameters, this improves efficiency, especially
if the procedures can be inlined, at the expense of duplicating code for
multiple instantiations.
.. _`GNAT.HTable_(g-htable.ads)`:
-`GNAT.HTable` (:file:`g-htable.ads`)
-====================================
+``GNAT.HTable`` (:file:`g-htable.ads`)
+======================================
.. index:: GNAT.HTable (g-htable.ads)
@@ -1258,8 +1326,8 @@ allowing arbitrary dynamic hash tables.
.. _`GNAT.IO_(g-io.ads)`:
-`GNAT.IO` (:file:`g-io.ads`)
-============================
+``GNAT.IO`` (:file:`g-io.ads`)
+==============================
.. index:: GNAT.IO (g-io.ads)
@@ -1274,8 +1342,8 @@ Standard_Output or Standard_Error.
.. _`GNAT.IO_Aux_(g-io_aux.ads)`:
-`GNAT.IO_Aux` (:file:`g-io_aux.ads`)
-====================================
+``GNAT.IO_Aux`` (:file:`g-io_aux.ads`)
+======================================
.. index:: GNAT.IO_Aux (g-io_aux.ads)
@@ -1288,8 +1356,8 @@ for whether a file exists, and functions for reading a line of text.
.. _`GNAT.Lock_Files_(g-locfil.ads)`:
-`GNAT.Lock_Files` (:file:`g-locfil.ads`)
-========================================
+``GNAT.Lock_Files`` (:file:`g-locfil.ads`)
+==========================================
.. index:: GNAT.Lock_Files (g-locfil.ads)
@@ -1302,32 +1370,32 @@ providing program level synchronization.
.. _`GNAT.MBBS_Discrete_Random_(g-mbdira.ads)`:
-`GNAT.MBBS_Discrete_Random` (:file:`g-mbdira.ads`)
-==================================================
+``GNAT.MBBS_Discrete_Random`` (:file:`g-mbdira.ads`)
+====================================================
.. index:: GNAT.MBBS_Discrete_Random (g-mbdira.ads)
.. index:: Random number generation
-The original implementation of `Ada.Numerics.Discrete_Random`. Uses
+The original implementation of ``Ada.Numerics.Discrete_Random``. Uses
a modified version of the Blum-Blum-Shub generator.
.. _`GNAT.MBBS_Float_Random_(g-mbflra.ads)`:
-`GNAT.MBBS_Float_Random` (:file:`g-mbflra.ads`)
-===============================================
+``GNAT.MBBS_Float_Random`` (:file:`g-mbflra.ads`)
+=================================================
.. index:: GNAT.MBBS_Float_Random (g-mbflra.ads)
.. index:: Random number generation
-The original implementation of `Ada.Numerics.Float_Random`. Uses
+The original implementation of ``Ada.Numerics.Float_Random``. Uses
a modified version of the Blum-Blum-Shub generator.
.. _`GNAT.MD5_(g-md5.ads)`:
-`GNAT.MD5` (:file:`g-md5.ads`)
-==============================
+``GNAT.MD5`` (:file:`g-md5.ads`)
+================================
.. index:: GNAT.MD5 (g-md5.ads)
@@ -1339,8 +1407,8 @@ FIPS PUB 198.
.. _`GNAT.Memory_Dump_(g-memdum.ads)`:
-`GNAT.Memory_Dump` (:file:`g-memdum.ads`)
-=========================================
+``GNAT.Memory_Dump`` (:file:`g-memdum.ads`)
+===========================================
.. index:: GNAT.Memory_Dump (g-memdum.ads)
@@ -1352,8 +1420,8 @@ output.
.. _`GNAT.Most_Recent_Exception_(g-moreex.ads)`:
-`GNAT.Most_Recent_Exception` (:file:`g-moreex.ads`)
-===================================================
+``GNAT.Most_Recent_Exception`` (:file:`g-moreex.ads`)
+=====================================================
.. index:: GNAT.Most_Recent_Exception (g-moreex.ads)
@@ -1365,8 +1433,8 @@ Ada 83 implementation dependent extensions.
.. _`GNAT.OS_Lib_(g-os_lib.ads)`:
-`GNAT.OS_Lib` (:file:`g-os_lib.ads`)
-====================================
+``GNAT.OS_Lib`` (:file:`g-os_lib.ads`)
+======================================
.. index:: GNAT.OS_Lib (g-os_lib.ads)
@@ -1381,8 +1449,8 @@ and error return codes.
.. _`GNAT.Perfect_Hash_Generators_(g-pehage.ads)`:
-`GNAT.Perfect_Hash_Generators` (:file:`g-pehage.ads`)
-=====================================================
+``GNAT.Perfect_Hash_Generators`` (:file:`g-pehage.ads`)
+=======================================================
.. index:: GNAT.Perfect_Hash_Generators (g-pehage.ads)
@@ -1399,8 +1467,8 @@ convenient for use with realtime applications.
.. _`GNAT.Random_Numbers_(g-rannum.ads)`:
-`GNAT.Random_Numbers` (:file:`g-rannum.ads`)
-============================================
+``GNAT.Random_Numbers`` (:file:`g-rannum.ads`)
+==============================================
.. index:: GNAT.Random_Numbers (g-rannum.ads)
@@ -1411,8 +1479,8 @@ standard Ada library and are more convenient to use.
.. _`GNAT.Regexp_(g-regexp.ads)`:
-`GNAT.Regexp` (:file:`g-regexp.ads`)
-====================================
+``GNAT.Regexp`` (:file:`g-regexp.ads`)
+======================================
.. index:: GNAT.Regexp (g-regexp.ads)
@@ -1427,8 +1495,8 @@ suitable for 'file globbing' applications.
.. _`GNAT.Registry_(g-regist.ads)`:
-`GNAT.Registry` (:file:`g-regist.ads`)
-======================================
+``GNAT.Registry`` (:file:`g-regist.ads`)
+========================================
.. index:: GNAT.Registry (g-regist.ads)
@@ -1441,8 +1509,8 @@ package provided with the Win32Ada binding
.. _`GNAT.Regpat_(g-regpat.ads)`:
-`GNAT.Regpat` (:file:`g-regpat.ads`)
-====================================
+``GNAT.Regpat`` (:file:`g-regpat.ads`)
+======================================
.. index:: GNAT.Regpat (g-regpat.ads)
@@ -1456,8 +1524,8 @@ Henry Spencer (and binary compatible with this C library).
.. _`GNAT.Rewrite_Data_(g-rewdat.ads)`:
-`GNAT.Rewrite_Data` (:file:`g-rewdat.ads`)
-==========================================
+``GNAT.Rewrite_Data`` (:file:`g-rewdat.ads`)
+============================================
.. index:: GNAT.Rewrite_Data (g-rewdat.ads)
@@ -1470,8 +1538,8 @@ this interface usable for large files or socket streams.
.. _`GNAT.Secondary_Stack_Info_(g-sestin.ads)`:
-`GNAT.Secondary_Stack_Info` (:file:`g-sestin.ads`)
-==================================================
+``GNAT.Secondary_Stack_Info`` (:file:`g-sestin.ads`)
+====================================================
.. index:: GNAT.Secondary_Stack_Info (g-sestin.ads)
@@ -1482,8 +1550,8 @@ secondary stack.
.. _`GNAT.Semaphores_(g-semaph.ads)`:
-`GNAT.Semaphores` (:file:`g-semaph.ads`)
-========================================
+``GNAT.Semaphores`` (:file:`g-semaph.ads`)
+==========================================
.. index:: GNAT.Semaphores (g-semaph.ads)
@@ -1493,8 +1561,8 @@ Provides classic counting and binary semaphores using protected types.
.. _`GNAT.Serial_Communications_(g-sercom.ads)`:
-`GNAT.Serial_Communications` (:file:`g-sercom.ads`)
-===================================================
+``GNAT.Serial_Communications`` (:file:`g-sercom.ads`)
+=====================================================
.. index:: GNAT.Serial_Communications (g-sercom.ads)
@@ -1505,8 +1573,8 @@ port. This is only supported on GNU/Linux and Windows.
.. _`GNAT.SHA1_(g-sha1.ads)`:
-`GNAT.SHA1` (:file:`g-sha1.ads`)
-================================
+``GNAT.SHA1`` (:file:`g-sha1.ads`)
+==================================
.. index:: GNAT.SHA1 (g-sha1.ads)
@@ -1518,8 +1586,8 @@ in RFC 2104 and FIPS PUB 198.
.. _`GNAT.SHA224_(g-sha224.ads)`:
-`GNAT.SHA224` (:file:`g-sha224.ads`)
-====================================
+``GNAT.SHA224`` (:file:`g-sha224.ads`)
+======================================
.. index:: GNAT.SHA224 (g-sha224.ads)
@@ -1531,8 +1599,8 @@ in RFC 2104 and FIPS PUB 198.
.. _`GNAT.SHA256_(g-sha256.ads)`:
-`GNAT.SHA256` (:file:`g-sha256.ads`)
-====================================
+``GNAT.SHA256`` (:file:`g-sha256.ads`)
+======================================
.. index:: GNAT.SHA256 (g-sha256.ads)
@@ -1544,8 +1612,8 @@ in RFC 2104 and FIPS PUB 198.
.. _`GNAT.SHA384_(g-sha384.ads)`:
-`GNAT.SHA384` (:file:`g-sha384.ads`)
-====================================
+``GNAT.SHA384`` (:file:`g-sha384.ads`)
+======================================
.. index:: GNAT.SHA384 (g-sha384.ads)
@@ -1557,8 +1625,8 @@ in RFC 2104 and FIPS PUB 198.
.. _`GNAT.SHA512_(g-sha512.ads)`:
-`GNAT.SHA512` (:file:`g-sha512.ads`)
-====================================
+``GNAT.SHA512`` (:file:`g-sha512.ads`)
+======================================
.. index:: GNAT.SHA512 (g-sha512.ads)
@@ -1570,8 +1638,8 @@ in RFC 2104 and FIPS PUB 198.
.. _`GNAT.Signals_(g-signal.ads)`:
-`GNAT.Signals` (:file:`g-signal.ads`)
-=====================================
+``GNAT.Signals`` (:file:`g-signal.ads`)
+=======================================
.. index:: GNAT.Signals (g-signal.ads)
@@ -1582,8 +1650,8 @@ targets.
.. _`GNAT.Sockets_(g-socket.ads)`:
-`GNAT.Sockets` (:file:`g-socket.ads`)
-=====================================
+``GNAT.Sockets`` (:file:`g-socket.ads`)
+=======================================
.. index:: GNAT.Sockets (g-socket.ads)
@@ -1591,14 +1659,14 @@ targets.
A high level and portable interface to develop sockets based applications.
This package is based on the sockets thin binding found in
-`GNAT.Sockets.Thin`. Currently `GNAT.Sockets` is implemented
+``GNAT.Sockets.Thin``. Currently ``GNAT.Sockets`` is implemented
on all native GNAT ports and on VxWorks cross prots. It is not implemented for
the LynxOS cross port.
.. _`GNAT.Source_Info_(g-souinf.ads)`:
-`GNAT.Source_Info` (:file:`g-souinf.ads`)
-=========================================
+``GNAT.Source_Info`` (:file:`g-souinf.ads`)
+===========================================
.. index:: GNAT.Source_Info (g-souinf.ads)
@@ -1607,12 +1675,12 @@ the LynxOS cross port.
Provides subprograms that give access to source code information known at
compile time, such as the current file name and line number. Also provides
subprograms yielding the date and time of the current compilation (like the
-C macros `__DATE__` and `__TIME__`)
+C macros ``__DATE__`` and ``__TIME__``)
.. _`GNAT.Spelling_Checker_(g-speche.ads)`:
-`GNAT.Spelling_Checker` (:file:`g-speche.ads`)
-==============================================
+``GNAT.Spelling_Checker`` (:file:`g-speche.ads`)
+================================================
.. index:: GNAT.Spelling_Checker (g-speche.ads)
@@ -1623,8 +1691,8 @@ near misspelling of another string.
.. _`GNAT.Spelling_Checker_Generic_(g-spchge.ads)`:
-`GNAT.Spelling_Checker_Generic` (:file:`g-spchge.ads`)
-======================================================
+``GNAT.Spelling_Checker_Generic`` (:file:`g-spchge.ads`)
+========================================================
.. index:: GNAT.Spelling_Checker_Generic (g-spchge.ads)
@@ -1636,8 +1704,8 @@ string.
.. _`GNAT.Spitbol.Patterns_(g-spipat.ads)`:
-`GNAT.Spitbol.Patterns` (:file:`g-spipat.ads`)
-==============================================
+``GNAT.Spitbol.Patterns`` (:file:`g-spipat.ads`)
+================================================
.. index:: GNAT.Spitbol.Patterns (g-spipat.ads)
@@ -1652,8 +1720,8 @@ efficient algorithm developed by Robert Dewar for the SPITBOL system.
.. _`GNAT.Spitbol_(g-spitbo.ads)`:
-`GNAT.Spitbol` (:file:`g-spitbo.ads`)
-=====================================
+``GNAT.Spitbol`` (:file:`g-spitbo.ads`)
+=======================================
.. index:: GNAT.Spitbol (g-spitbo.ads)
@@ -1667,8 +1735,8 @@ the SNOBOL4 TABLE function.
.. _`GNAT.Spitbol.Table_Boolean_(g-sptabo.ads)`:
-`GNAT.Spitbol.Table_Boolean` (:file:`g-sptabo.ads`)
-===================================================
+``GNAT.Spitbol.Table_Boolean`` (:file:`g-sptabo.ads`)
+=====================================================
.. index:: GNAT.Spitbol.Table_Boolean (g-sptabo.ads)
@@ -1676,14 +1744,14 @@ the SNOBOL4 TABLE function.
.. index:: SPITBOL Tables
-A library level of instantiation of `GNAT.Spitbol.Patterns.Table`
-for type `Standard.Boolean`, giving an implementation of sets of
+A library level of instantiation of ``GNAT.Spitbol.Patterns.Table``
+for type ``Standard.Boolean``, giving an implementation of sets of
string values.
.. _`GNAT.Spitbol.Table_Integer_(g-sptain.ads)`:
-`GNAT.Spitbol.Table_Integer` (:file:`g-sptain.ads`)
-===================================================
+``GNAT.Spitbol.Table_Integer`` (:file:`g-sptain.ads`)
+=====================================================
.. index:: GNAT.Spitbol.Table_Integer (g-sptain.ads)
@@ -1693,14 +1761,14 @@ string values.
.. index:: SPITBOL Tables
-A library level of instantiation of `GNAT.Spitbol.Patterns.Table`
-for type `Standard.Integer`, giving an implementation of maps
+A library level of instantiation of ``GNAT.Spitbol.Patterns.Table``
+for type ``Standard.Integer``, giving an implementation of maps
from string to integer values.
.. _`GNAT.Spitbol.Table_VString_(g-sptavs.ads)`:
-`GNAT.Spitbol.Table_VString` (:file:`g-sptavs.ads`)
-===================================================
+``GNAT.Spitbol.Table_VString`` (:file:`g-sptavs.ads`)
+=====================================================
.. index:: GNAT.Spitbol.Table_VString (g-sptavs.ads)
@@ -1710,14 +1778,14 @@ from string to integer values.
.. index:: SPITBOL Tables
-A library level of instantiation of `GNAT.Spitbol.Patterns.Table` for
+A library level of instantiation of ``GNAT.Spitbol.Patterns.Table`` for
a variable length string type, giving an implementation of general
maps from strings to strings.
.. _`GNAT.SSE_(g-sse.ads)`:
-`GNAT.SSE` (:file:`g-sse.ads`)
-==============================
+``GNAT.SSE`` (:file:`g-sse.ads`)
+================================
.. index:: GNAT.SSE (g-sse.ads)
@@ -1728,8 +1796,8 @@ introduction to the binding contents and use.
.. _`GNAT.SSE.Vector_Types_(g-ssvety.ads)`:
-`GNAT.SSE.Vector_Types` (:file:`g-ssvety.ads`)
-==============================================
+``GNAT.SSE.Vector_Types`` (:file:`g-ssvety.ads`)
+================================================
.. index:: GNAT.SSE.Vector_Types (g-ssvety.ads)
@@ -1737,8 +1805,8 @@ SSE vector types for use with SSE related intrinsics.
.. _`GNAT.String_Hash(g-strhas.ads)`:
-`GNAT.String_Hash` (:file:`g-strhas.ads`)
-=========================================
+``GNAT.String_Hash`` (:file:`g-strhas.ads`)
+===========================================
.. index:: GNAT.String_Hash (g-strhas.ads)
@@ -1749,8 +1817,8 @@ type and the hash result type are parameters.
.. _`GNAT.Strings_(g-string.ads)`:
-`GNAT.Strings` (:file:`g-string.ads`)
-=====================================
+``GNAT.Strings`` (:file:`g-string.ads`)
+=======================================
.. index:: GNAT.Strings (g-string.ads)
@@ -1759,8 +1827,8 @@ defines a string access and an array of string access types.
.. _`GNAT.String_Split_(g-strspl.ads)`:
-`GNAT.String_Split` (:file:`g-strspl.ads`)
-==========================================
+``GNAT.String_Split`` (:file:`g-strspl.ads`)
+============================================
.. index:: GNAT.String_Split (g-strspl.ads)
@@ -1769,12 +1837,12 @@ defines a string access and an array of string access types.
Useful string manipulation routines: given a set of separators, split
a string wherever the separators appear, and provide direct access
to the resulting slices. This package is instantiated from
-`GNAT.Array_Split`.
+``GNAT.Array_Split``.
.. _`GNAT.Table_(g-table.ads)`:
-`GNAT.Table` (:file:`g-table.ads`)
-==================================
+``GNAT.Table`` (:file:`g-table.ads`)
+====================================
.. index:: GNAT.Table (g-table.ads)
@@ -1785,15 +1853,15 @@ to the resulting slices. This package is instantiated from
A generic package providing a single dimension array abstraction where the
length of the array can be dynamically modified.
-This package provides a facility similar to that of `GNAT.Dynamic_Tables`,
+This package provides a facility similar to that of ``GNAT.Dynamic_Tables``,
except that this package declares a single instance of the table type,
-while an instantiation of `GNAT.Dynamic_Tables` creates a type that can be
+while an instantiation of ``GNAT.Dynamic_Tables`` creates a type that can be
used to define dynamic instances of the table.
.. _`GNAT.Task_Lock_(g-tasloc.ads)`:
-`GNAT.Task_Lock` (:file:`g-tasloc.ads`)
-=======================================
+``GNAT.Task_Lock`` (:file:`g-tasloc.ads`)
+=========================================
.. index:: GNAT.Task_Lock (g-tasloc.ads)
@@ -1809,8 +1877,8 @@ between tasks is very rarely expected.
.. _`GNAT.Time_Stamp_(g-timsta.ads)`:
-`GNAT.Time_Stamp` (:file:`g-timsta.ads`)
-========================================
+``GNAT.Time_Stamp`` (:file:`g-timsta.ads`)
+==========================================
.. index:: GNAT.Time_Stamp (g-timsta.ads)
@@ -1824,8 +1892,8 @@ routine with minimal code and there are no dependencies on any other unit.
.. _`GNAT.Threads_(g-thread.ads)`:
-`GNAT.Threads` (:file:`g-thread.ads`)
-=====================================
+``GNAT.Threads`` (:file:`g-thread.ads`)
+=======================================
.. index:: GNAT.Threads (g-thread.ads)
@@ -1840,8 +1908,8 @@ environment which then accesses Ada code.
.. _`GNAT.Traceback_(g-traceb.ads)`:
-`GNAT.Traceback` (:file:`g-traceb.ads`)
-=======================================
+``GNAT.Traceback`` (:file:`g-traceb.ads`)
+=========================================
.. index:: GNAT.Traceback (g-traceb.ads)
@@ -1852,8 +1920,8 @@ in various debugging situations.
.. _`GNAT.Traceback.Symbolic_(g-trasym.ads)`:
-`GNAT.Traceback.Symbolic` (:file:`g-trasym.ads`)
-================================================
+``GNAT.Traceback.Symbolic`` (:file:`g-trasym.ads`)
+==================================================
.. index:: GNAT.Traceback.Symbolic (g-trasym.ads)
@@ -1861,17 +1929,17 @@ in various debugging situations.
.. _`GNAT.UTF_32_(g-table.ads)`:
-`GNAT.UTF_32` (:file:`g-table.ads`)
-===================================
+``GNAT.UTF_32`` (:file:`g-table.ads`)
+=====================================
.. index:: GNAT.UTF_32 (g-table.ads)
.. index:: Wide character codes
This is a package intended to be used in conjunction with the
-`Wide_Character` type in Ada 95 and the
-`Wide_Wide_Character` type in Ada 2005 (available
-in `GNAT` in Ada 2005 mode). This package contains
+``Wide_Character`` type in Ada 95 and the
+``Wide_Wide_Character`` type in Ada 2005 (available
+in ``GNAT`` in Ada 2005 mode). This package contains
Unicode categorization routines, as well as lexical
categorization routines corresponding to the Ada 2005
lexical rules for identifiers and strings, and also a
@@ -1880,8 +1948,8 @@ the Ada 2005 rules for identifier equivalence.
.. _`GNAT.Wide_Spelling_Checker_(g-u3spch.ads)`:
-`GNAT.Wide_Spelling_Checker` (:file:`g-u3spch.ads`)
-===================================================
+``GNAT.Wide_Spelling_Checker`` (:file:`g-u3spch.ads`)
+=====================================================
.. index:: GNAT.Wide_Spelling_Checker (g-u3spch.ads)
@@ -1893,8 +1961,8 @@ using the UTF_32_String type defined in System.Wch_Cnv.
.. _`GNAT.Wide_Spelling_Checker_(g-wispch.ads)`:
-`GNAT.Wide_Spelling_Checker` (:file:`g-wispch.ads`)
-===================================================
+``GNAT.Wide_Spelling_Checker`` (:file:`g-wispch.ads`)
+=====================================================
.. index:: GNAT.Wide_Spelling_Checker (g-wispch.ads)
@@ -1905,8 +1973,8 @@ near misspelling of another wide string.
.. _`GNAT.Wide_String_Split_(g-wistsp.ads)`:
-`GNAT.Wide_String_Split` (:file:`g-wistsp.ads`)
-===============================================
+``GNAT.Wide_String_Split`` (:file:`g-wistsp.ads`)
+=================================================
.. index:: GNAT.Wide_String_Split (g-wistsp.ads)
@@ -1915,12 +1983,12 @@ near misspelling of another wide string.
Useful wide string manipulation routines: given a set of separators, split
a wide string wherever the separators appear, and provide direct access
to the resulting slices. This package is instantiated from
-`GNAT.Array_Split`.
+``GNAT.Array_Split``.
.. _`GNAT.Wide_Wide_Spelling_Checker_(g-zspche.ads)`:
-`GNAT.Wide_Wide_Spelling_Checker` (:file:`g-zspche.ads`)
-========================================================
+``GNAT.Wide_Wide_Spelling_Checker`` (:file:`g-zspche.ads`)
+==========================================================
.. index:: GNAT.Wide_Wide_Spelling_Checker (g-zspche.ads)
@@ -1931,8 +1999,8 @@ near misspelling of another wide wide string.
.. _`GNAT.Wide_Wide_String_Split_(g-zistsp.ads)`:
-`GNAT.Wide_Wide_String_Split` (:file:`g-zistsp.ads`)
-====================================================
+``GNAT.Wide_Wide_String_Split`` (:file:`g-zistsp.ads`)
+======================================================
.. index:: GNAT.Wide_Wide_String_Split (g-zistsp.ads)
@@ -1941,12 +2009,12 @@ near misspelling of another wide wide string.
Useful wide wide string manipulation routines: given a set of separators, split
a wide wide string wherever the separators appear, and provide direct access
to the resulting slices. This package is instantiated from
-`GNAT.Array_Split`.
+``GNAT.Array_Split``.
.. _`Interfaces.C.Extensions_(i-cexten.ads)`:
-`Interfaces.C.Extensions` (:file:`i-cexten.ads`)
-================================================
+``Interfaces.C.Extensions`` (:file:`i-cexten.ads`)
+==================================================
.. index:: Interfaces.C.Extensions (i-cexten.ads)
@@ -1956,8 +2024,8 @@ to C libraries.
.. _`Interfaces.C.Streams_(i-cstrea.ads)`:
-`Interfaces.C.Streams` (:file:`i-cstrea.ads`)
-=============================================
+``Interfaces.C.Streams`` (:file:`i-cstrea.ads`)
+===============================================
.. index:: Interfaces.C.Streams (i-cstrea.ads)
@@ -1968,8 +2036,8 @@ on C streams.
.. _`Interfaces.Packed_Decimal_(i-pacdec.ads)`:
-`Interfaces.Packed_Decimal` (:file:`i-pacdec.ads`)
-==================================================
+``Interfaces.Packed_Decimal`` (:file:`i-pacdec.ads`)
+====================================================
.. index:: Interfaces.Packed_Decimal (i-pacdec.ads)
@@ -1983,8 +2051,8 @@ mainframes.
.. _`Interfaces.VxWorks_(i-vxwork.ads)`:
-`Interfaces.VxWorks` (:file:`i-vxwork.ads`)
-===========================================
+``Interfaces.VxWorks`` (:file:`i-vxwork.ads`)
+=============================================
.. index:: Interfaces.VxWorks (i-vxwork.ads)
@@ -1998,8 +2066,8 @@ VxWorks hardware interrupt facilities.
.. _`Interfaces.VxWorks.Int_Connection_(i-vxinco.ads)`:
-`Interfaces.VxWorks.Int_Connection` (:file:`i-vxinco.ads`)
-==========================================================
+``Interfaces.VxWorks.Int_Connection`` (:file:`i-vxinco.ads`)
+============================================================
.. index:: Interfaces.VxWorks.Int_Connection (i-vxinco.ads)
@@ -2013,8 +2081,8 @@ handlers.
.. _`Interfaces.VxWorks.IO_(i-vxwoio.ads)`:
-`Interfaces.VxWorks.IO` (:file:`i-vxwoio.ads`)
-==============================================
+``Interfaces.VxWorks.IO`` (:file:`i-vxwoio.ads`)
+================================================
.. index:: Interfaces.VxWorks.IO (i-vxwoio.ads)
@@ -2033,8 +2101,8 @@ to enable the use of Get_Immediate under VxWorks.
.. _`System.Address_Image_(s-addima.ads)`:
-`System.Address_Image` (:file:`s-addima.ads`)
-=============================================
+``System.Address_Image`` (:file:`s-addima.ads`)
+===============================================
.. index:: System.Address_Image (s-addima.ads)
@@ -2048,8 +2116,8 @@ string which identifies an address.
.. _`System.Assertions_(s-assert.ads)`:
-`System.Assertions` (:file:`s-assert.ads`)
-==========================================
+``System.Assertions`` (:file:`s-assert.ads`)
+============================================
.. index:: System.Assertions (s-assert.ads)
@@ -2063,8 +2131,8 @@ is used internally to raise this assertion.
.. _`System.Atomic_Counters_(s-atocou.ads)`:
-`System.Atomic_Counters` (:file:`s-atocou.ads`)
-===============================================
+``System.Atomic_Counters`` (:file:`s-atocou.ads`)
+=================================================
.. index:: System.Atomic_Counters (s-atocou.ads)
@@ -2077,8 +2145,8 @@ x86, and x86_64 platforms.
.. _`System.Memory_(s-memory.ads)`:
-`System.Memory` (:file:`s-memory.ads`)
-======================================
+``System.Memory`` (:file:`s-memory.ads`)
+========================================
.. index:: System.Memory (s-memory.ads)
@@ -2091,12 +2159,12 @@ It also provides a reallocation interface analogous to the C routine
realloc. The body of this unit may be modified to provide alternative
allocation mechanisms for the default pool, and in addition, direct
calls to this unit may be made for low level allocation uses (for
-example see the body of `GNAT.Tables`).
+example see the body of ``GNAT.Tables``).
.. _`System.Multiprocessors_(s-multip.ads)`:
-`System.Multiprocessors` (:file:`s-multip.ads`)
-===============================================
+``System.Multiprocessors`` (:file:`s-multip.ads`)
+=================================================
.. index:: System.Multiprocessors (s-multip.ads)
@@ -2108,8 +2176,8 @@ technically an implementation-defined addition).
.. _`System.Multiprocessors.Dispatching_Domains_(s-mudido.ads)`:
-`System.Multiprocessors.Dispatching_Domains` (:file:`s-mudido.ads`)
-===================================================================
+``System.Multiprocessors.Dispatching_Domains`` (:file:`s-mudido.ads`)
+=====================================================================
.. index:: System.Multiprocessors.Dispatching_Domains (s-mudido.ads)
@@ -2121,8 +2189,8 @@ technically an implementation-defined addition).
.. _`System.Partition_Interface_(s-parint.ads)`:
-`System.Partition_Interface` (:file:`s-parint.ads`)
-===================================================
+``System.Partition_Interface`` (:file:`s-parint.ads`)
+=====================================================
.. index:: System.Partition_Interface (s-parint.ads)
@@ -2130,12 +2198,12 @@ technically an implementation-defined addition).
This package provides facilities for partition interfacing. It
is used primarily in a distribution context when using Annex E
-with `GLADE`.
+with ``GLADE``.
.. _`System.Pool_Global_(s-pooglo.ads)`:
-`System.Pool_Global` (:file:`s-pooglo.ads`)
-===========================================
+``System.Pool_Global`` (:file:`s-pooglo.ads`)
+=============================================
.. index:: System.Pool_Global (s-pooglo.ads)
@@ -2150,8 +2218,8 @@ do any automatic reclamation.
.. _`System.Pool_Local_(s-pooloc.ads)`:
-`System.Pool_Local` (:file:`s-pooloc.ads`)
-==========================================
+``System.Pool_Local`` (:file:`s-pooloc.ads`)
+============================================
.. index:: System.Pool_Local (s-pooloc.ads)
@@ -2166,8 +2234,8 @@ be freed automatically when the pool is finalized.
.. _`System.Restrictions_(s-restri.ads)`:
-`System.Restrictions` (:file:`s-restri.ads`)
-============================================
+``System.Restrictions`` (:file:`s-restri.ads`)
+==============================================
.. index:: System.Restrictions (s-restri.ads)
@@ -2182,8 +2250,8 @@ are violated by one or more packages in the partition.
.. _`System.Rident_(s-rident.ads)`:
-`System.Rident` (:file:`s-rident.ads`)
-======================================
+``System.Rident`` (:file:`s-rident.ads`)
+========================================
.. index:: System.Rident (s-rident.ads)
@@ -2192,14 +2260,14 @@ are violated by one or more packages in the partition.
This package provides definitions of the restrictions
identifiers supported by GNAT, and also the format of
the restrictions provided in package System.Restrictions.
-It is not normally necessary to `with` this generic package
+It is not normally necessary to ``with`` this generic package
since the necessary instantiation is included in
package System.Restrictions.
.. _`System.Strings.Stream_Ops_(s-ststop.ads)`:
-`System.Strings.Stream_Ops` (:file:`s-ststop.ads`)
-==================================================
+``System.Strings.Stream_Ops`` (:file:`s-ststop.ads`)
+====================================================
.. index:: System.Strings.Stream_Ops (s-ststop.ads)
@@ -2214,8 +2282,8 @@ package can be used directly by application programs.
.. _`System.Unsigned_Types_(s-unstyp.ads)`:
-`System.Unsigned_Types` (:file:`s-unstyp.ads`)
-==============================================
+``System.Unsigned_Types`` (:file:`s-unstyp.ads`)
+================================================
.. index:: System.Unsigned_Types (s-unstyp.ads)
@@ -2227,8 +2295,8 @@ used by the compiler in connection with packed array types.
.. _`System.Wch_Cnv_(s-wchcnv.ads)`:
-`System.Wch_Cnv` (:file:`s-wchcnv.ads`)
-=======================================
+``System.Wch_Cnv`` (:file:`s-wchcnv.ads`)
+=========================================
.. index:: System.Wch_Cnv (s-wchcnv.ads)
@@ -2240,18 +2308,18 @@ used by the compiler in connection with packed array types.
This package provides routines for converting between
wide and wide wide characters and a representation as a value of type
-`Standard.String`, using a specified wide character
+``Standard.String``, using a specified wide character
encoding method. It uses definitions in
-package `System.Wch_Con`.
+package ``System.Wch_Con``.
.. _`System.Wch_Con_(s-wchcon.ads)`:
-`System.Wch_Con` (:file:`s-wchcon.ads`)
-=======================================
+``System.Wch_Con`` (:file:`s-wchcon.ads`)
+=========================================
.. index:: System.Wch_Con (s-wchcon.ads)
This package provides definitions and descriptions of
the various methods used for encoding wide characters
in ordinary strings. These definitions are used by
-the package `System.Wch_Cnv`.
+the package ``System.Wch_Cnv``.
diff --git a/gcc/ada/doc/gnat_rm/the_implementation_of_standard_i_o.rst b/gcc/ada/doc/gnat_rm/the_implementation_of_standard_i_o.rst
index e04fb9a..653ace6 100644
--- a/gcc/ada/doc/gnat_rm/the_implementation_of_standard_i_o.rst
+++ b/gcc/ada/doc/gnat_rm/the_implementation_of_standard_i_o.rst
@@ -68,9 +68,9 @@ are implemented using the C
library streams facility; where
*
- All files are opened using `fopen`.
+ All files are opened using ``fopen``.
*
- All input/output operations use `fread`/`fwrite`.
+ All input/output operations use ``fread``/`fwrite`.
There is no internal buffering of any kind at the Ada library level. The only
buffering is that provided at the system level in the implementation of the
@@ -127,8 +127,8 @@ The records of a Direct_IO file are simply written to the file in index
sequence, with the first record starting at offset zero, and subsequent
records following. There is no control information of any kind. For
example, if 32-bit integers are being written, each record takes
-4-bytes, so the record at index `K` starts at offset
-(`K`-1)*4.
+4-bytes, so the record at index ``K`` starts at offset
+(``K``-1)*4.
There is no limit on the size of Direct_IO files, they are expanded as
necessary to accommodate whatever records are written to the file.
@@ -148,17 +148,17 @@ checking is performed on input.
For the indefinite type case, the elements written consist of two
parts. First is the size of the data item, written as the memory image
-of a `Interfaces.C.size_t` value, followed by the memory image of
+of a ``Interfaces.C.size_t`` value, followed by the memory image of
the data value. The resulting file can only be read using the same
(unconstrained) type. Normal assignment checks are performed on these
-read operations, and if these checks fail, `Data_Error` is
+read operations, and if these checks fail, ``Data_Error`` is
raised. In particular, in the array case, the lengths must match, and in
the variant record case, if the variable for a particular read operation
is constrained, the discriminants must match.
Note that it is not possible to use Sequential_IO to write variable
length array items, and then read the data back into different length
-arrays. For example, the following will raise `Data_Error`:
+arrays. For example, the following will raise ``Data_Error``:
.. code-block:: ada
@@ -175,9 +175,9 @@ arrays. For example, the following will raise `Data_Error`:
-On some Ada implementations, this will print `hell`, but the program is
+On some Ada implementations, this will print ``hell``, but the program is
clearly incorrect, since there is only one element in the file, and that
-element is the string `hello!`.
+element is the string ``hello!``.
In Ada 95 and Ada 2005, this kind of behavior can be legitimately achieved
using Stream_IO, and this is the preferred mechanism. In particular, the
@@ -202,23 +202,23 @@ A canonical Text_IO file is defined as one in which the following
conditions are met:
*
- The character `LF` is used only as a line mark, i.e., to mark the end
+ The character ``LF`` is used only as a line mark, i.e., to mark the end
of the line.
*
- The character `FF` is used only as a page mark, i.e., to mark the
+ The character ``FF`` is used only as a page mark, i.e., to mark the
end of a page and consequently can appear only immediately following a
- `LF` (line mark) character.
+ ``LF`` (line mark) character.
*
- The file ends with either `LF` (line mark) or `LF`-`FF`
+ The file ends with either ``LF`` (line mark) or ``LF``-`FF`
(line mark, page mark). In the former case, the page mark is implicitly
assumed to be present.
A file written using Text_IO will be in canonical form provided that no
-explicit `LF` or `FF` characters are written using `Put`
-or `Put_Line`. There will be no `FF` character at the end of
-the file unless an explicit `New_Page` operation was performed
+explicit ``LF`` or ``FF`` characters are written using ``Put``
+or ``Put_Line``. There will be no ``FF`` character at the end of
+the file unless an explicit ``New_Page`` operation was performed
before closing the file.
A canonical Text_IO file that is a regular file (i.e., not a device or a
@@ -230,24 +230,24 @@ A text file that does not meet the requirements for a canonical Text_IO
file has one of the following:
*
- The file contains `FF` characters not immediately following a
- `LF` character.
+ The file contains ``FF`` characters not immediately following a
+ ``LF`` character.
*
- The file contains `LF` or `FF` characters written by
- `Put` or `Put_Line`, which are not logically considered to be
+ The file contains ``LF`` or ``FF`` characters written by
+ ``Put`` or ``Put_Line``, which are not logically considered to be
line marks or page marks.
*
- The file ends in a character other than `LF` or `FF`,
+ The file ends in a character other than ``LF`` or ``FF``,
i.e., there is no explicit line mark or page mark at the end of the file.
Text_IO can be used to read such non-standard text files but subprograms
to do with line or page numbers do not have defined meanings. In
-particular, a `FF` character that does not follow a `LF`
+particular, a ``FF`` character that does not follow a ``LF``
character may or may not be treated as a page mark from the point of
-view of page and line numbering. Every `LF` character is considered
-to end a line, and there is an implied `LF` character at the end of
+view of page and line numbering. Every ``LF`` character is considered
+to end a line, and there is an implied ``LF`` character at the end of
the file.
.. _Stream_Pointer_Positioning:
@@ -255,20 +255,20 @@ the file.
Stream Pointer Positioning
--------------------------
-`Ada.Text_IO` has a definition of current position for a file that
+``Ada.Text_IO`` has a definition of current position for a file that
is being read. No internal buffering occurs in Text_IO, and usually the
physical position in the stream used to implement the file corresponds
to this logical position defined by Text_IO. There are two exceptions:
*
- After a call to `End_Of_Page` that returns `True`, the stream
- is positioned past the `LF` (line mark) that precedes the page
+ After a call to ``End_Of_Page`` that returns ``True``, the stream
+ is positioned past the ``LF`` (line mark) that precedes the page
mark. Text_IO maintains an internal flag so that subsequent read
operations properly handle the logical position which is unchanged by
- the `End_Of_Page` call.
+ the ``End_Of_Page`` call.
*
- After a call to `End_Of_File` that returns `True`, if the
+ After a call to ``End_Of_File`` that returns ``True``, if the
Text_IO file was positioned before the line mark at the end of file
before the call, then the logical position is unchanged, but the stream
is physically positioned right at the end of file (past the line mark,
@@ -294,12 +294,12 @@ for reading, the behavior of Text_IO is modified to avoid undesirable
look-ahead as follows:
An input file that is not a regular file is considered to have no page
-marks. Any `Ascii.FF` characters (the character normally used for a
+marks. Any ``Ascii.FF`` characters (the character normally used for a
page mark) appearing in the file are considered to be data
characters. In particular:
*
- `Get_Line` and `Skip_Line` do not test for a page mark
+ ``Get_Line`` and ``Skip_Line`` do not test for a page mark
following a line mark. If a page mark appears, it will be treated as a
data character.
@@ -308,14 +308,14 @@ characters. In particular:
entered from the pipe to complete one of these operations.
*
- `End_Of_Page` always returns `False`
+ ``End_Of_Page`` always returns ``False``
*
- `End_Of_File` will return `False` if there is a page mark at
+ ``End_Of_File`` will return ``False`` if there is a page mark at
the end of the file.
Output to non-regular files is the same as for regular files. Page marks
-may be written to non-regular files using `New_Page`, but as noted
+may be written to non-regular files using ``New_Page``, but as noted
above they will not be treated as page marks on input if the output is
piped to another Ada program.
@@ -323,9 +323,9 @@ Another important discrepancy when reading non-regular files is that the end
of file indication is not 'sticky'. If an end of file is entered, e.g., by
pressing the :kbd:`EOT` key,
then end of file
-is signaled once (i.e., the test `End_Of_File`
-will yield `True`, or a read will
-raise `End_Error`), but then reading can resume
+is signaled once (i.e., the test ``End_Of_File``
+will yield ``True``, or a read will
+raise ``End_Error``), but then reading can resume
to read data past that end of
file indication, until another end of file indication is entered.
@@ -354,14 +354,14 @@ Treating Text_IO Files as Streams
.. index:: Stream files
-The package `Text_IO.Streams` allows a Text_IO file to be treated
-as a stream. Data written to a Text_IO file in this stream mode is
-binary data. If this binary data contains bytes 16#0A# (`LF`) or
-16#0C# (`FF`), the resulting file may have non-standard
+The package ``Text_IO.Streams`` allows a ``Text_IO`` file to be treated
+as a stream. Data written to a ``Text_IO`` file in this stream mode is
+binary data. If this binary data contains bytes 16#0A# (``LF``) or
+16#0C# (``FF``), the resulting file may have non-standard
format. Similarly if read operations are used to read from a Text_IO
-file treated as a stream, then `LF` and `FF` characters may be
+file treated as a stream, then ``LF`` and ``FF`` characters may be
skipped and the effect is similar to that described above for
-`Get_Immediate`.
+``Get_Immediate``.
.. _Text_IO_Extensions:
@@ -371,7 +371,7 @@ Text_IO Extensions
.. index:: Text_IO extensions
A package GNAT.IO_Aux in the GNAT library provides some useful extensions
-to the standard `Text_IO` package:
+to the standard ``Text_IO`` package:
* function File_Exists (Name : String) return Boolean;
Determines if a file of the given name exists.
@@ -394,8 +394,8 @@ Text_IO Facilities for Unbounded Strings
.. index:: Unbounded_String, Text_IO operations
-The package `Ada.Strings.Unbounded.Text_IO`
-in library files `a-suteio.ads/adb` contains some GNAT-specific
+The package ``Ada.Strings.Unbounded.Text_IO``
+in library files :file:`a-suteio.ads/adb` contains some GNAT-specific
subprograms useful for Text_IO operations on unbounded strings:
@@ -406,32 +406,32 @@ subprograms useful for Text_IO operations on unbounded strings:
* procedure Put (File : File_Type; U : Unbounded_String);
Writes the value of the given unbounded string to the specified file
Similar to the effect of
- `Put (To_String (U))` except that an extra copy is avoided.
+ ``Put (To_String (U))`` except that an extra copy is avoided.
* procedure Put_Line (File : File_Type; U : Unbounded_String);
Writes the value of the given unbounded string to the specified file,
- followed by a `New_Line`.
- Similar to the effect of `Put_Line (To_String (U))` except
+ followed by a ``New_Line``.
+ Similar to the effect of ``Put_Line (To_String (U))`` except
that an extra copy is avoided.
-In the above procedures, `File` is of type `Ada.Text_IO.File_Type`
+In the above procedures, ``File`` is of type ``Ada.Text_IO.File_Type``
and is optional. If the parameter is omitted, then the standard input or
output file is referenced as appropriate.
-The package `Ada.Strings.Wide_Unbounded.Wide_Text_IO` in library
+The package ``Ada.Strings.Wide_Unbounded.Wide_Text_IO`` in library
files :file:`a-swuwti.ads` and :file:`a-swuwti.adb` provides similar extended
-`Wide_Text_IO` functionality for unbounded wide strings.
+``Wide_Text_IO`` functionality for unbounded wide strings.
-The package `Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO` in library
+The package ``Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO`` in library
files :file:`a-szuzti.ads` and :file:`a-szuzti.adb` provides similar extended
-`Wide_Wide_Text_IO` functionality for unbounded wide wide strings.
+``Wide_Wide_Text_IO`` functionality for unbounded wide wide strings.
.. _Wide_Text_IO:
Wide_Text_IO
============
-`Wide_Text_IO` is similar in most respects to Text_IO, except that
+``Wide_Text_IO`` is similar in most respects to Text_IO, except that
both input and output files may contain special sequences that represent
wide character values. The encoding scheme for a given file may be
specified using a FORM parameter:
@@ -443,7 +443,7 @@ specified using a FORM parameter:
as part of the FORM string (WCEM = wide character encoding method),
-where `x` is one of the following characters
+where ``x`` is one of the following characters
========== ====================
Character Encoding
@@ -480,11 +480,11 @@ being brackets encoding if no coding method was specified with -gnatW).
..
- where `a`, `b`, `c`, `d` are the four hexadecimal
+ where ``a``, ``b``, ``c``, ``d`` are the four hexadecimal
characters (using upper case letters) of the wide character code. For
example, ESC A345 is used to represent the wide character with code
16#A345#. This scheme is compatible with use of the full
- `Wide_Character` set.
+ ``Wide_Character`` set.
*Upper Half Coding*
@@ -527,7 +527,7 @@ being brackets encoding if no coding method was specified with -gnatW).
..
- where the `xxx` bits correspond to the left-padded bits of the
+ where the ``xxx`` bits correspond to the left-padded bits of the
16-bit character value. Note that all lower half ASCII characters
are represented as ASCII bytes and all upper half characters and
other wide characters are represented as sequences of upper-half
@@ -548,14 +548,14 @@ being brackets encoding if no coding method was specified with -gnatW).
..
- where `a`, `b`, `c`, `d` are the four hexadecimal
+ where ``a``, ``b``, ``c``, ``d`` are the four hexadecimal
characters (using uppercase letters) of the wide character code. For
- example, `["A345"]` is used to represent the wide character with code
- `16#A345#`.
+ example, ``["A345"]`` is used to represent the wide character with code
+ ``16#A345#``.
This scheme is compatible with use of the full Wide_Character set.
On input, brackets coding can also be used for upper half characters,
- e.g., `["C1"]` for lower case a. However, on output, brackets notation
- is only used for wide characters with a code greater than `16#FF#`.
+ e.g., ``["C1"]`` for lower case a. However, on output, brackets notation
+ is only used for wide characters with a code greater than ``16#FF#``.
Note that brackets coding is not normally used in the context of
Wide_Text_IO or Wide_Wide_Text_IO, since it is really just designed as
@@ -612,11 +612,11 @@ input also causes Constraint_Error to be raised.
Stream Pointer Positioning
--------------------------
-`Ada.Wide_Text_IO` is similar to `Ada.Text_IO` in its handling
+``Ada.Wide_Text_IO`` is similar to ``Ada.Text_IO`` in its handling
of stream pointer positioning (:ref:`Text_IO`). There is one additional
case:
-If `Ada.Wide_Text_IO.Look_Ahead` reads a character outside the
+If ``Ada.Wide_Text_IO.Look_Ahead`` reads a character outside the
normal lower ASCII set (i.e., a character in the range:
@@ -626,11 +626,11 @@ normal lower ASCII set (i.e., a character in the range:
then although the logical position of the file pointer is unchanged by
-the `Look_Ahead` call, the stream is physically positioned past the
+the ``Look_Ahead`` call, the stream is physically positioned past the
wide character sequence. Again this is to avoid the need for buffering
-or backup, and all `Wide_Text_IO` routines check the internal
+or backup, and all ``Wide_Text_IO`` routines check the internal
indication that this situation has occurred so that this is not visible
-to a normal program using `Wide_Text_IO`. However, this discrepancy
+to a normal program using ``Wide_Text_IO``. However, this discrepancy
can be observed if the wide text file shares a stream with another file.
.. _Reading_and_Writing_Non-Regular_Files_1:
@@ -640,8 +640,8 @@ Reading and Writing Non-Regular Files
As in the case of Text_IO, when a non-regular file is read, it is
assumed that the file contains no page marks (any form characters are
-treated as data characters), and `End_Of_Page` always returns
-`False`. Similarly, the end of file indication is not sticky, so
+treated as data characters), and ``End_Of_Page`` always returns
+``False``. Similarly, the end of file indication is not sticky, so
it is possible to read beyond an end of file.
.. _Wide_Wide_Text_IO:
@@ -649,7 +649,7 @@ it is possible to read beyond an end of file.
Wide_Wide_Text_IO
=================
-`Wide_Wide_Text_IO` is similar in most respects to Text_IO, except that
+``Wide_Wide_Text_IO`` is similar in most respects to Text_IO, except that
both input and output files may contain special sequences that represent
wide wide character values. The encoding scheme for a given file may be
specified using a FORM parameter:
@@ -661,7 +661,7 @@ specified using a FORM parameter:
as part of the FORM string (WCEM = wide character encoding method),
-where `x` is one of the following characters
+where ``x`` is one of the following characters
========== ====================
Character Encoding
@@ -704,7 +704,7 @@ being brackets encoding if no coding method was specified with -gnatW).
..
- where the `xxx` bits correspond to the left-padded bits of the
+ where the ``xxx`` bits correspond to the left-padded bits of the
21-bit character value. Note that all lower half ASCII characters
are represented as ASCII bytes and all upper half characters and
other wide characters are represented as sequences of upper-half
@@ -731,16 +731,16 @@ being brackets encoding if no coding method was specified with -gnatW).
..
- where `a`, `b`, `c`, `d`, `e`, and `f`
+ where ``a``, ``b``, ``c``, ``d``, ``e``, and ``f``
are the four or six hexadecimal
characters (using uppercase letters) of the wide wide character code. For
- example, `["01A345"]` is used to represent the wide wide character
- with code `16#01A345#`.
+ example, ``["01A345"]`` is used to represent the wide wide character
+ with code ``16#01A345#``.
This scheme is compatible with use of the full Wide_Wide_Character set.
On input, brackets coding can also be used for upper half characters,
- e.g., `["C1"]` for lower case a. However, on output, brackets notation
- is only used for wide characters with a code greater than `16#FF#`.
+ e.g., ``["C1"]`` for lower case a. However, on output, brackets notation
+ is only used for wide characters with a code greater than ``16#FF#``.
If is also possible to use the other Wide_Character encoding methods,
@@ -756,11 +756,11 @@ input also causes Constraint_Error to be raised.
Stream Pointer Positioning
--------------------------
-`Ada.Wide_Wide_Text_IO` is similar to `Ada.Text_IO` in its handling
+``Ada.Wide_Wide_Text_IO`` is similar to ``Ada.Text_IO`` in its handling
of stream pointer positioning (:ref:`Text_IO`). There is one additional
case:
-If `Ada.Wide_Wide_Text_IO.Look_Ahead` reads a character outside the
+If ``Ada.Wide_Wide_Text_IO.Look_Ahead`` reads a character outside the
normal lower ASCII set (i.e., a character in the range:
@@ -770,11 +770,11 @@ normal lower ASCII set (i.e., a character in the range:
then although the logical position of the file pointer is unchanged by
-the `Look_Ahead` call, the stream is physically positioned past the
+the ``Look_Ahead`` call, the stream is physically positioned past the
wide character sequence. Again this is to avoid the need for buffering
-or backup, and all `Wide_Wide_Text_IO` routines check the internal
+or backup, and all ``Wide_Wide_Text_IO`` routines check the internal
indication that this situation has occurred so that this is not visible
-to a normal program using `Wide_Wide_Text_IO`. However, this discrepancy
+to a normal program using ``Wide_Wide_Text_IO``. However, this discrepancy
can be observed if the wide text file shares a stream with another file.
.. _Reading_and_Writing_Non-Regular_Files_2:
@@ -784,8 +784,8 @@ Reading and Writing Non-Regular Files
As in the case of Text_IO, when a non-regular file is read, it is
assumed that the file contains no page marks (any form characters are
-treated as data characters), and `End_Of_Page` always returns
-`False`. Similarly, the end of file indication is not sticky, so
+treated as data characters), and ``End_Of_Page`` always returns
+``False``. Similarly, the end of file indication is not sticky, so
it is possible to read beyond an end of file.
.. _Stream_IO:
@@ -795,11 +795,11 @@ Stream_IO
A stream file is a sequence of bytes, where individual elements are
written to the file as described in the Ada Reference Manual. The type
-`Stream_Element` is simply a byte. There are two ways to read or
+``Stream_Element`` is simply a byte. There are two ways to read or
write a stream file.
*
- The operations `Read` and `Write` directly read or write a
+ The operations ``Read`` and ``Write`` directly read or write a
sequence of stream elements with no control information.
*
@@ -854,7 +854,7 @@ dependence, GNAT handles file sharing as follows:
*
In the absence of a ``shared=xxx`` form parameter, an attempt
to open two or more files with the same full name is considered an error
- and is not supported. The exception `Use_Error` will be
+ and is not supported. The exception ``Use_Error`` will be
raised. Note that a file that is not explicitly closed by the program
remains open until the program terminates.
@@ -873,12 +873,12 @@ dependence, GNAT handles file sharing as follows:
When a program that opens multiple files with the same name is ported
from another Ada compiler to GNAT, the effect will be that
-`Use_Error` is raised.
+``Use_Error`` is raised.
The documentation of the original compiler and the documentation of the
program should then be examined to determine if file sharing was
-expected, and ``shared=xxx`` parameters added to `Open`
-and `Create` calls as required.
+expected, and ``shared=xxx`` parameters added to ``Open``
+and ``Create`` calls as required.
When a program is ported from GNAT to some other Ada compiler, no
special attention is required unless the ``shared=xxx`` form
@@ -961,11 +961,11 @@ This encoding is only supported on the Windows platform.
Open Modes
==========
-`Open` and `Create` calls result in a call to `fopen`
+``Open`` and ``Create`` calls result in a call to ``fopen``
using the mode shown in the following table:
+----------------------------+---------------+------------------+
-| `Open` and `Create` Call Modes |
+| ``Open`` and ``Create`` Call Modes |
+----------------------------+---------------+------------------+
| | **OPEN** | **CREATE** |
+============================+===============+==================+
@@ -989,7 +989,7 @@ DOS-like systems, and is not relevant to other systems.
A special case occurs with Stream_IO. As shown in the above table, the
file is initially opened in ``r`` or ``w`` mode for the
-`In_File` and `Out_File` cases. If a `Set_Mode` operation
+``In_File`` and ``Out_File`` cases. If a ``Set_Mode`` operation
subsequently requires switching from reading to writing or vice-versa,
then the file is reopened in ``r+`` mode to permit the required operation.
@@ -998,7 +998,7 @@ then the file is reopened in ``r+`` mode to permit the required operation.
Operations on C Streams
=======================
-The package `Interfaces.C_Streams` provides an Ada program with direct
+The package ``Interfaces.C_Streams`` provides an Ada program with direct
access to the C library functions for operations on C streams:
@@ -1233,19 +1233,19 @@ operations.
end Ada.Stream_IO.C_Streams;
-In each of these six packages, the `C_Stream` function obtains the
-`FILE` pointer from a currently opened Ada file. It is then
-possible to use the `Interfaces.C_Streams` package to operate on
+In each of these six packages, the ``C_Stream`` function obtains the
+``FILE`` pointer from a currently opened Ada file. It is then
+possible to use the ``Interfaces.C_Streams`` package to operate on
this stream, or the stream can be passed to a C program which can
operate on it directly. Of course the program is responsible for
ensuring that only appropriate sequences of operations are executed.
One particular use of relevance to an Ada program is that the
-`setvbuf` function can be used to control the buffering of the
+``setvbuf`` function can be used to control the buffering of the
stream used by an Ada file. In the absence of such a call the standard
default buffering is used.
-The `Open` procedures in these packages open a file giving an
+The ``Open`` procedures in these packages open a file giving an
existing C Stream instead of a file name. Typically this stream is
imported from a C program, allowing an Ada file to operate on an
existing C file.
diff --git a/gcc/ada/doc/gnat_ugn.rst b/gcc/ada/doc/gnat_ugn.rst
index d6d2ba9..b6fd18f 100644
--- a/gcc/ada/doc/gnat_ugn.rst
+++ b/gcc/ada/doc/gnat_ugn.rst
@@ -1,38 +1,40 @@
GNAT User's Guide for Native Platforms
======================================
-*GNAT, The GNU Ada Development Environment*
+.. only:: not latex
-.. only:: PRO
+ *GNAT, The GNU Ada Development Environment*
- *GNAT Pro Edition*
+ .. only:: PRO
- | Version |version|
- | Date: |today|
+ *GNAT Pro Edition*
-.. only:: GPL
+ | Version |version|
+ | Date: |today|
- *GNAT GPL Edition*
+ .. only:: GPL
- | Version |version|
- | Date: |today|
+ *GNAT GPL Edition*
-.. only:: FSF
+ | Version |version|
+ | Date: |today|
- .. raw:: texinfo
+ .. only:: FSF
- @include gcc-common.texi
- GCC version @value{version-GCC}@*
+ .. raw:: texinfo
-AdaCore
+ @include gcc-common.texi
+ GCC version @value{version-GCC}@*
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, with the Front-Cover Texts being
-"GNAT User's Guide for Native Platforms",
-and with no Back-Cover Texts. A copy of the license is
-included in the section entitled :ref:`gnu_fdl`.
+ AdaCore
+
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3 or
+ any later version published by the Free Software Foundation; with no
+ Invariant Sections, with the Front-Cover Texts being
+ "GNAT User's Guide for Native Platforms",
+ and with no Back-Cover Texts. A copy of the license is
+ included in the section entitled :ref:`gnu_fdl`.
.. toctree::
:maxdepth: 3
diff --git a/gcc/ada/doc/gnat_ugn/about_this_guide.rst b/gcc/ada/doc/gnat_ugn/about_this_guide.rst
index 079b20b..e821729 100644
--- a/gcc/ada/doc/gnat_ugn/about_this_guide.rst
+++ b/gcc/ada/doc/gnat_ugn/about_this_guide.rst
@@ -117,7 +117,7 @@ the new document structure.
* :ref:`The_GNAT_Compilation_Model` has been extended so that it now covers
the following material:
- - The `gnatname`, `gnatkr`, and `gnatchop` tools
+ - The ``gnatname``, ``gnatkr``, and ``gnatchop`` tools
- :ref:`Configuration_Pragmas`
- :ref:`GNAT_and_Libraries`
- :ref:`Conditional_Compilation` including :ref:`Preprocessing_with_gnatprep`
@@ -173,9 +173,9 @@ the new document structure.
- :ref:`Microsoft_Windows_Topics`
- :ref:`Mac_OS_Topics`
-* The `Compatibility and Porting Guide` appendix has been moved to the
+* The *Compatibility and Porting Guide* appendix has been moved to the
:title:`GNAT Reference Manual`. It now includes a section
- `Writing Portable Fixed-Point Declarations` which was previously
+ *Writing Portable Fixed-Point Declarations* which was previously
a separate chapter in the :title:`GNAT User's Guide`.
@@ -188,14 +188,14 @@ Conventions
Following are examples of the typographical and graphic conventions used
in this guide:
-* `Functions`, `utility program names`, `standard names`,
- and `classes`.
+* ``Functions``, ``utility program names``, ``standard names``,
+ and ``classes``.
-* `Option flags`
+* ``Option flags``
* :file:`File names`
-* `Variables`
+* ``Variables``
* *Emphasis*
diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst
index 2c36592..0a85c7b 100644
--- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst
+++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst
@@ -5,7 +5,7 @@
.. -- Example: A |withing| unit has a |with| clause, it |withs| a |withed| unit
-
+.. role:: switch(samp)
.. _Building_Executable_Programs_With_GNAT:
@@ -39,8 +39,8 @@ in a GNAT context (see :ref:`Using_the_GNU_make_Utility`).
.. _The_GNAT_Make_Program_gnatmake:
-Building with *gnatmake*
-========================
+Building with ``gnatmake``
+==========================
.. index:: gnatmake
@@ -62,10 +62,10 @@ the following steps:
The third step in particular can be tricky, because not only do the modified
files have to be compiled, but any files depending on these files must also be
recompiled. The dependency rules in Ada can be quite complex, especially
-in the presence of overloading, `use` clauses, generics and inlined
+in the presence of overloading, ``use`` clauses, generics and inlined
subprograms.
-*gnatmake* automatically takes care of the third and fourth steps
+``gnatmake`` automatically takes care of the third and fourth steps
of this process. It determines which sources need to be compiled,
compiles them, and binds and links the resulting object files.
@@ -74,85 +74,85 @@ accurately recomputed from the new sources. The source based approach of
the GNAT compilation model makes this possible. This means that if
changes to the source program cause corresponding changes in
dependencies, they will always be tracked exactly correctly by
-*gnatmake*.
+``gnatmake``.
Note that for advanced forms of project structure, we recommend creating
a project file as explained in the *GNAT_Project_Manager* chapter in the
*GPRbuild User's Guide*, and using the
-*gprbuild* tool which supports building with project files and works similarly
-to *gnatmake*.
+``gprbuild`` tool which supports building with project files and works similarly
+to ``gnatmake``.
.. _Running_gnatmake:
-Running *gnatmake*
-------------------
+Running ``gnatmake``
+--------------------
-The usual form of the *gnatmake* command is
+The usual form of the ``gnatmake`` command is
.. code-block:: sh
$ gnatmake [<switches>] <file_name> [<file_names>] [<mode_switches>]
-The only required argument is one `file_name`, which specifies
-a compilation unit that is a main program. Several `file_names` can be
+The only required argument is one ``file_name``, which specifies
+a compilation unit that is a main program. Several ``file_names`` can be
specified: this will result in several executables being built.
-If `switches` are present, they can be placed before the first
-`file_name`, between `file_names` or after the last `file_name`.
-If `mode_switches` are present, they must always be placed after
-the last `file_name` and all `switches`.
+If ``switches`` are present, they can be placed before the first
+``file_name``, between ``file_names`` or after the last ``file_name``.
+If ``mode_switches`` are present, they must always be placed after
+the last ``file_name`` and all ``switches``.
If you are using standard file extensions (:file:`.adb` and
:file:`.ads`), then the
-extension may be omitted from the `file_name` arguments. However, if
+extension may be omitted from the ``file_name`` arguments. However, if
you are using non-standard extensions, then it is required that the
extension be given. A relative or absolute directory path can be
-specified in a `file_name`, in which case, the input source file will
+specified in a ``file_name``, in which case, the input source file will
be searched for in the specified directory only. Otherwise, the input
source file will first be searched in the directory where
-*gnatmake* was invoked and if it is not found, it will be search on
+``gnatmake`` was invoked and if it is not found, it will be search on
the source path of the compiler as described in
:ref:`Search_Paths_and_the_Run-Time_Library_RTL`.
-All *gnatmake* output (except when you specify *-M*) is sent to
+All ``gnatmake`` output (except when you specify :switch:`-M`) is sent to
:file:`stderr`. The output produced by the
-*-M* switch is sent to :file:`stdout`.
+:switch:`-M` switch is sent to :file:`stdout`.
.. _Switches_for_gnatmake:
-Switches for *gnatmake*
------------------------
+Switches for ``gnatmake``
+-------------------------
-You may specify any of the following switches to *gnatmake*:
+You may specify any of the following switches to ``gnatmake``:
.. index:: --version (gnatmake)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatmake)
-:samp:`--help`
+:switch:`--help`
If ``--version`` was not used, display usage, then exit disregarding
all other options.
.. index:: --GCC=compiler_name (gnatmake)
-:samp:`--GCC={compiler_name}`
+:switch:`--GCC={compiler_name}`
Program used for compiling. The default is ``gcc``. You need to use
- quotes around `compiler_name` if `compiler_name` contains
+ quotes around ``compiler_name`` if ``compiler_name`` contains
spaces or other separator characters.
As an example ``--GCC="foo -x -y"``
- will instruct *gnatmake* to use ``foo -x -y`` as your
+ will instruct ``gnatmake`` to use ``foo -x -y`` as your
compiler. A limitation of this syntax is that the name and path name of
the executable itself must not include any embedded spaces. Note that
- switch ``-c`` is always inserted after your command name. Thus in the
- above example the compiler command that will be used by *gnatmake*
+ switch :switch:`-c` is always inserted after your command name. Thus in the
+ above example the compiler command that will be used by ``gnatmake``
will be ``foo -c -x -y``. If several ``--GCC=compiler_name`` are
- used, only the last `compiler_name` is taken into account. However,
+ used, only the last ``compiler_name`` is taken into account. However,
all the additional switches are also taken into account. Thus,
``--GCC="foo -x -y" --GCC="bar -z -t"`` is equivalent to
``--GCC="bar -x -y -z -t"``.
@@ -160,58 +160,58 @@ You may specify any of the following switches to *gnatmake*:
.. index:: --GNATBIND=binder_name (gnatmake)
-:samp:`--GNATBIND={binder_name}`
+:switch:`--GNATBIND={binder_name}`
Program used for binding. The default is ``gnatbind``. You need to
- use quotes around `binder_name` if `binder_name` contains spaces
+ use quotes around ``binder_name`` if ``binder_name`` contains spaces
or other separator characters.
As an example ``--GNATBIND="bar -x -y"``
- will instruct *gnatmake* to use `bar -x -y` as your
- binder. Binder switches that are normally appended by *gnatmake*
- to ``gnatbind`` are now appended to the end of `bar -x -y`.
+ will instruct ``gnatmake`` to use ``bar -x -y`` as your
+ binder. Binder switches that are normally appended by ``gnatmake``
+ to ``gnatbind`` are now appended to the end of ``bar -x -y``.
A limitation of this syntax is that the name and path name of the executable
itself must not include any embedded spaces.
.. index:: --GNATLINK=linker_name (gnatmake)
-:samp:`--GNATLINK={linker_name}`
+:switch:`--GNATLINK={linker_name}`
Program used for linking. The default is ``gnatlink``. You need to
- use quotes around `linker_name` if `linker_name` contains spaces
+ use quotes around ``linker_name`` if ``linker_name`` contains spaces
or other separator characters.
As an example ``--GNATLINK="lan -x -y"``
- will instruct *gnatmake* to use ``lan -x -y`` as your
+ will instruct ``gnatmake`` to use ``lan -x -y`` as your
linker. Linker switches that are normally appended by ``gnatmake`` to
``gnatlink`` are now appended to the end of ``lan -x -y``.
A limitation of this syntax is that the name and path name of the executable
itself must not include any embedded spaces.
-:samp:`--create-map-file`
+:switch:`--create-map-file`
When linking an executable, create a map file. The name of the map file
has the same name as the executable with extension ".map".
-:samp:`--create-map-file={mapfile}`
+:switch:`--create-map-file={mapfile}`
When linking an executable, create a map file with the specified name.
.. index:: --create-missing-dirs (gnatmake)
-:samp:`--create-missing-dirs`
- When using project files (:samp:`-P{project}`), automatically create
+:switch:`--create-missing-dirs`
+ When using project files (:switch:`-P{project}`), automatically create
missing object directories, library directories and exec
directories.
-:samp:`--single-compile-per-obj-dir`
+:switch:`--single-compile-per-obj-dir`
Disallow simultaneous compilations in the same object directory when
project files are used.
-:samp:`--subdirs={subdir}`
+:switch:`--subdirs={subdir}`
Actual object directory of each project file is the subdirectory subdir of the
object directory specified or defaulted in the project file.
-:samp:`--unchecked-shared-lib-imports`
+:switch:`--unchecked-shared-lib-imports`
By default, shared library projects are not allowed to import static library
projects. When this switch is used on the command line, this restriction is
relaxed.
-:samp:`--source-info={source info file}`
+:switch:`--source-info={source info file}`
Specify a source info file. This switch is active only when project files
are used. If the source info file is specified as a relative path, then it is
relative to the object directory of the main project. If the source info file
@@ -224,19 +224,19 @@ You may specify any of the following switches to *gnatmake*:
long time. If the source info file exists but cannot be parsed successfully,
the Project Manager will attempt to recreate it. If the Project Manager fails
to create the source info file, a message is issued, but gnatmake does not
- fail. *gnatmake* "trusts" the source info file. This means that
+ fail. ``gnatmake`` "trusts" the source info file. This means that
if the source files have changed (addition, deletion, moving to a different
source directory), then the source info file need to be deleted and recreated.
.. index:: -a (gnatmake)
-:samp:`-a`
+:switch:`-a`
Consider all files in the make process, even the GNAT internal system
files (for example, the predefined Ada library files), as well as any
locked files. Locked files are files whose ALI file is write-protected.
By default,
- *gnatmake* does not check these files,
+ ``gnatmake`` does not check these files,
because the assumption is that the GNAT internal files are properly up
to date, and also that any write protected ALI files have been properly
installed. Note that if there is an installation problem, such that one
@@ -247,7 +247,7 @@ You may specify any of the following switches to *gnatmake*:
in conjunction with ``-f``
if you need to recompile an entire application,
including run-time files, using special configuration pragmas,
- such as a `Normalize_Scalars` pragma.
+ such as a ``Normalize_Scalars`` pragma.
By default
``gnatmake -a`` compiles all GNAT
@@ -257,52 +257,52 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -b (gnatmake)
-:samp:`-b`
- Bind only. Can be combined with *-c* to do
+:switch:`-b`
+ Bind only. Can be combined with :switch:`-c` to do
compilation and binding, but no link.
- Can be combined with *-l*
+ Can be combined with :switch:`-l`
to do binding and linking. When not combined with
- *-c*
+ :switch:`-c`
all the units in the closure of the main program must have been previously
- compiled and must be up to date. The root unit specified by `file_name`
+ compiled and must be up to date. The root unit specified by ``file_name``
may be given without extension, with the source extension or, if no GNAT
Project File is specified, with the ALI file extension.
.. index:: -c (gnatmake)
-:samp:`-c`
- Compile only. Do not perform binding, except when *-b*
+:switch:`-c`
+ Compile only. Do not perform binding, except when :switch:`-b`
is also specified. Do not perform linking, except if both
- *-b* and
- *-l* are also specified.
- If the root unit specified by `file_name` is not a main unit, this is the
- default. Otherwise *gnatmake* will attempt binding and linking
+ :switch:`-b` and
+ :switch:`-l` are also specified.
+ If the root unit specified by ``file_name`` is not a main unit, this is the
+ default. Otherwise ``gnatmake`` will attempt binding and linking
unless all objects are up to date and the executable is more recent than
the objects.
.. index:: -C (gnatmake)
-:samp:`-C`
+:switch:`-C`
Use a temporary mapping file. A mapping file is a way to communicate
to the compiler two mappings: from unit names to file names (without
any directory information) and from file names to path names (with
full directory information). A mapping file can make the compiler's
file searches faster, especially if there are many source directories,
or the sources are read over a slow network connection. If
- *-P* is used, a mapping file is always used, so
- *-C* is unnecessary; in this case the mapping file
+ :switch:`-P` is used, a mapping file is always used, so
+ :switch:`-C` is unnecessary; in this case the mapping file
is initially populated based on the project file. If
- *-C* is used without
- *-P*,
+ :switch:`-C` is used without
+ :switch:`-P`,
the mapping file is initially empty. Each invocation of the compiler
will add any newly accessed sources to the mapping file.
.. index:: -C= (gnatmake)
-:samp:`-C={file}`
+:switch:`-C={file}`
Use a specific mapping file. The file, specified as a path name (absolute or
relative) by this switch, should already exist, otherwise the switch is
ineffective. The specified mapping file will be communicated to the compiler.
@@ -313,7 +313,7 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -d (gnatmake)
-:samp:`-d`
+:switch:`-d`
Display progress for each source, up to date or not, as a single line:
::
@@ -326,9 +326,9 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -D (gnatmake)
-:samp:`-D {dir}`
- Put all object files and ALI file in directory `dir`.
- If the *-D* switch is not used, all object files
+:switch:`-D {dir}`
+ Put all object files and ALI file in directory ``dir``.
+ If the :switch:`-D` switch is not used, all object files
and ALI files go in the current working directory.
This switch cannot be used when using a project file.
@@ -336,17 +336,17 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -eI (gnatmake)
-:samp:`-eI{nnn}`
+:switch:`-eI{nnn}`
Indicates that the main source is a multi-unit source and the rank of the unit
in the source file is nnn. nnn needs to be a positive number and a valid
- index in the source. This switch cannot be used when *gnatmake* is
+ index in the source. This switch cannot be used when ``gnatmake`` is
invoked for several mains.
.. index:: -eL (gnatmake)
.. index:: symbolic links
-:samp:`-eL`
+:switch:`-eL`
Follow all symbolic links when processing project files.
This should be used if your project uses symbolic links for files or
directories, but is not needed in other cases.
@@ -365,7 +365,7 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -eS (gnatmake)
-:samp:`-eS`
+:switch:`-eS`
Output the commands for the compiler, the binder and the linker
on standard output,
instead of standard error.
@@ -373,16 +373,16 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -f (gnatmake)
-:samp:`-f`
+:switch:`-f`
Force recompilations. Recompile all sources, even though some object
files may be up to date, but don't recompile predefined or GNAT internal
files or locked files (files with a write-protected ALI file),
- unless the *-a* switch is also specified.
+ unless the :switch:`-a` switch is also specified.
.. index:: -F (gnatmake)
-:samp:`-F`
+:switch:`-F`
When using project files, if some errors or warnings are detected during
parsing and verbose mode is not in effect (no use of switch
-v), then error lines start with the full path name of the project
@@ -391,26 +391,26 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -g (gnatmake)
-:samp:`-g`
+:switch:`-g`
Enable debugging. This switch is simply passed to the compiler and to the
linker.
.. index:: -i (gnatmake)
-:samp:`-i`
- In normal mode, *gnatmake* compiles all object files and ALI files
- into the current directory. If the *-i* switch is used,
+:switch:`-i`
+ In normal mode, ``gnatmake`` compiles all object files and ALI files
+ into the current directory. If the :switch:`-i` switch is used,
then instead object files and ALI files that already exist are overwritten
in place. This means that once a large project is organized into separate
- directories in the desired manner, then *gnatmake* will automatically
+ directories in the desired manner, then ``gnatmake`` will automatically
maintain and update this organization. If no ALI files are found on the
Ada object path (see :ref:`Search_Paths_and_the_Run-Time_Library_RTL`),
the new object and ALI files are created in the
directory containing the source being compiled. If another organization
is desired, where objects and sources are kept in different directories,
a useful technique is to create dummy ALI files in the desired directories.
- When detecting such a dummy file, *gnatmake* will be forced to
+ When detecting such a dummy file, ``gnatmake`` will be forced to
recompile the corresponding source file, and it will be put the resulting
object and ALI files in the directory where it found the dummy file.
@@ -418,57 +418,57 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -j (gnatmake)
.. index:: Parallel make
-:samp:`-j{n}`
- Use `n` processes to carry out the (re)compilations. On a multiprocessor
- machine compilations will occur in parallel. If `n` is 0, then the
+:switch:`-j{n}`
+ Use ``n`` processes to carry out the (re)compilations. On a multiprocessor
+ machine compilations will occur in parallel. If ``n`` is 0, then the
maximum number of parallel compilations is the number of core processors
on the platform. In the event of compilation errors, messages from various
- compilations might get interspersed (but *gnatmake* will give you the
+ compilations might get interspersed (but ``gnatmake`` will give you the
full ordered list of failing compiles at the end). If this is problematic,
rerun the make process with n set to 1 to get a clean list of messages.
.. index:: -k (gnatmake)
-:samp:`-k`
+:switch:`-k`
Keep going. Continue as much as possible after a compilation error. To
ease the programmer's task in case of compilation errors, the list of
- sources for which the compile fails is given when *gnatmake*
+ sources for which the compile fails is given when ``gnatmake``
terminates.
- If *gnatmake* is invoked with several :file:`file_names` and with this
+ If ``gnatmake`` is invoked with several :file:`file_names` and with this
switch, if there are compilation errors when building an executable,
- *gnatmake* will not attempt to build the following executables.
+ ``gnatmake`` will not attempt to build the following executables.
.. index:: -l (gnatmake)
-:samp:`-l`
- Link only. Can be combined with *-b* to binding
+:switch:`-l`
+ Link only. Can be combined with :switch:`-b` to binding
and linking. Linking will not be performed if combined with
- *-c*
- but not with *-b*.
- When not combined with *-b*
+ :switch:`-c`
+ but not with :switch:`-b`.
+ When not combined with :switch:`-b`
all the units in the closure of the main program must have been previously
compiled and must be up to date, and the main program needs to have been bound.
- The root unit specified by `file_name`
+ The root unit specified by ``file_name``
may be given without extension, with the source extension or, if no GNAT
Project File is specified, with the ALI file extension.
.. index:: -m (gnatmake)
-:samp:`-m`
+:switch:`-m`
Specify that the minimum necessary amount of recompilations
- be performed. In this mode *gnatmake* ignores time
+ be performed. In this mode ``gnatmake`` ignores time
stamp differences when the only
modifications to a source file consist in adding/removing comments,
empty lines, spaces or tabs. This means that if you have changed the
comments in a source file or have simply reformatted it, using this
- switch will tell *gnatmake* not to recompile files that depend on it
+ switch will tell ``gnatmake`` not to recompile files that depend on it
(provided other sources on which these files depend have undergone no
semantic modifications). Note that the debugging information may be
- out of date with respect to the sources if the *-m* switch causes
+ out of date with respect to the sources if the :switch:`-m` switch causes
a compilation to be switched, so the use of this switch represents a
trade-off between compilation time and accurate debugging information.
@@ -476,28 +476,28 @@ You may specify any of the following switches to *gnatmake*:
.. index:: Dependencies, producing list
.. index:: -M (gnatmake)
-:samp:`-M`
+:switch:`-M`
Check if all objects are up to date. If they are, output the object
dependences to :file:`stdout` in a form that can be directly exploited in
a :file:`Makefile`. By default, each source file is prefixed with its
(relative or absolute) directory name. This name is whatever you
- specified in the various *-aI*
- and *-I* switches. If you use
- `gnatmake -M` *-q*
+ specified in the various :switch:`-aI`
+ and :switch:`-I` switches. If you use
+ ``gnatmake -M`` :switch:`-q`
(see below), only the source file names,
- without relative paths, are output. If you just specify the *-M*
+ without relative paths, are output. If you just specify the :switch:`-M`
switch, dependencies of the GNAT internal system files are omitted. This
is typically what you want. If you also specify
- the *-a* switch,
+ the :switch:`-a` switch,
dependencies of the GNAT internal files are also listed. Note that
dependencies of the objects in external Ada libraries (see
- switch :samp:`-aL{dir}` in the following list)
+ switch :switch:`-aL{dir}` in the following list)
are never reported.
.. index:: -n (gnatmake)
-:samp:`-n`
+:switch:`-n`
Don't compile, bind, or link. Checks if all objects are up to date.
If they are not, the full name of the first file that needs to be
recompiled is printed.
@@ -507,25 +507,25 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -o (gnatmake)
-:samp:`-o {exec_name}`
+:switch:`-o {exec_name}`
Output executable name. The name of the final executable program will be
- `exec_name`. If the *-o* switch is omitted the default
+ ``exec_name``. If the :switch:`-o` switch is omitted the default
name for the executable will be the name of the input file in appropriate form
for an executable file on the host system.
- This switch cannot be used when invoking *gnatmake* with several
+ This switch cannot be used when invoking ``gnatmake`` with several
:file:`file_names`.
.. index:: -p (gnatmake)
-:samp:`-p`
- Same as :samp:`--create-missing-dirs`
+:switch:`-p`
+ Same as :switch:`--create-missing-dirs`
.. index:: -P (gnatmake)
-:samp:`-P{project}`
- Use project file `project`. Only one such switch can be used.
+:switch:`-P{project}`
+ Use project file ``project``. Only one such switch can be used.
.. -- Comment:
:ref:`gnatmake_and_Project_Files`.
@@ -533,28 +533,28 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -q (gnatmake)
-:samp:`-q`
+:switch:`-q`
Quiet. When this flag is not set, the commands carried out by
- *gnatmake* are displayed.
+ ``gnatmake`` are displayed.
.. index:: -s (gnatmake)
-:samp:`-s`
+:switch:`-s`
Recompile if compiler switches have changed since last compilation.
All compiler switches but -I and -o are taken into account in the
following way:
orders between different 'first letter' switches are ignored, but
orders between same switches are taken into account. For example,
- *-O -O2* is different than *-O2 -O*, but *-g -O*
- is equivalent to *-O -g*.
+ :switch:`-O -O2` is different than :switch:`-O2 -O`, but :switch:`-g -O`
+ is equivalent to :switch:`-O -g`.
This switch is recommended when Integrated Preprocessing is used.
.. index:: -u (gnatmake)
-:samp:`-u`
+:switch:`-u`
Unique. Recompile at most the main files. It implies -c. Combined with
-f, it is equivalent to calling the compiler directly. Note that using
-u with a project file and no main has a special meaning.
@@ -565,7 +565,7 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -U (gnatmake)
-:samp:`-U`
+:switch:`-U`
When used without a project file or with one or several mains on the command
line, is equivalent to -u. When used with a project file and no main
on the command line, all sources of all project files are checked and compiled
@@ -574,57 +574,57 @@ You may specify any of the following switches to *gnatmake*:
.. index:: -v (gnatmake)
-:samp:`-v`
- Verbose. Display the reason for all recompilations *gnatmake*
+:switch:`-v`
+ Verbose. Display the reason for all recompilations ``gnatmake``
decides are necessary, with the highest verbosity level.
.. index:: -vl (gnatmake)
-:samp:`-vl`
+:switch:`-vl`
Verbosity level Low. Display fewer lines than in verbosity Medium.
.. index:: -vm (gnatmake)
-:samp:`-vm`
+:switch:`-vm`
Verbosity level Medium. Potentially display fewer lines than in verbosity High.
.. index:: -vm (gnatmake)
-:samp:`-vh`
+:switch:`-vh`
Verbosity level High. Equivalent to -v.
-:samp:`-vP{x}`
+:switch:`-vP{x}`
Indicate the verbosity of the parsing of GNAT project files.
See :ref:`Switches_Related_to_Project_Files`.
.. index:: -x (gnatmake)
-:samp:`-x`
+:switch:`-x`
Indicate that sources that are not part of any Project File may be compiled.
Normally, when using Project Files, only sources that are part of a Project
File may be compile. When this switch is used, a source outside of all Project
Files may be compiled. The ALI file and the object file will be put in the
object directory of the main Project. The compilation switches used will only
be those specified on the command line. Even when
- *-x* is used, mains specified on the
+ :switch:`-x` is used, mains specified on the
command line need to be sources of a project file.
-:samp:`-X{name}={value}`
- Indicate that external variable `name` has the value `value`.
+:switch:`-X{name}={value}`
+ Indicate that external variable ``name`` has the value ``value``.
The Project Manager will use this value for occurrences of
- `external(name)` when parsing the project file.
+ ``external(name)`` when parsing the project file.
:ref:`Switches_Related_to_Project_Files`.
.. index:: -z (gnatmake)
-:samp:`-z`
+:switch:`-z`
No main subprogram. Bind and link the program even if the unit name
given on the command line is a package name. The resulting executable
will execute the elaboration routines of the package and its closure,
@@ -633,93 +633,93 @@ You may specify any of the following switches to *gnatmake*:
.. rubric:: GCC switches
-Any uppercase or multi-character switch that is not a *gnatmake* switch
-is passed to *gcc* (e.g., *-O*, *-gnato,* etc.)
+Any uppercase or multi-character switch that is not a ``gnatmake`` switch
+is passed to ``gcc`` (e.g., :switch:`-O`, :switch:`-gnato,` etc.)
.. rubric:: Source and library search path switches
.. index:: -aI (gnatmake)
-:samp:`-aI{dir}`
- When looking for source files also look in directory `dir`.
+:switch:`-aI{dir}`
+ When looking for source files also look in directory ``dir``.
The order in which source files search is undertaken is
described in :ref:`Search_Paths_and_the_Run-Time_Library_RTL`.
.. index:: -aL (gnatmake)
-:samp:`-aL{dir}`
- Consider `dir` as being an externally provided Ada library.
- Instructs *gnatmake* to skip compilation units whose :file:`.ALI`
- files have been located in directory `dir`. This allows you to have
- missing bodies for the units in `dir` and to ignore out of date bodies
+:switch:`-aL{dir}`
+ Consider ``dir`` as being an externally provided Ada library.
+ Instructs ``gnatmake`` to skip compilation units whose :file:`.ALI`
+ files have been located in directory ``dir``. This allows you to have
+ missing bodies for the units in ``dir`` and to ignore out of date bodies
for the same units. You still need to specify
the location of the specs for these units by using the switches
- :samp:`-aI{dir}` or :samp:`-I{dir}`.
+ :switch:`-aI{dir}` or :switch:`-I{dir}`.
Note: this switch is provided for compatibility with previous versions
- of *gnatmake*. The easier method of causing standard libraries
+ of ``gnatmake``. The easier method of causing standard libraries
to be excluded from consideration is to write-protect the corresponding
ALI files.
.. index:: -aO (gnatmake)
-:samp:`-aO{dir}`
+:switch:`-aO{dir}`
When searching for library and object files, look in directory
- `dir`. The order in which library files are searched is described in
+ ``dir``. The order in which library files are searched is described in
:ref:`Search_Paths_for_gnatbind`.
.. index:: Search paths, for gnatmake
.. index:: -A (gnatmake)
-:samp:`-A{dir}`
- Equivalent to :samp:`-aL{dir}` :samp:`-aI{dir}`.
+:switch:`-A{dir}`
+ Equivalent to :switch:`-aL{dir}` :switch:`-aI{dir}`.
.. index:: -I (gnatmake)
-:samp:`-I{dir}`
- Equivalent to :samp:`-aO{dir} -aI{dir}`.
+:switch:`-I{dir}`
+ Equivalent to :switch:`-aO{dir} -aI{dir}`.
.. index:: -I- (gnatmake)
.. index:: Source files, suppressing search
-:samp:`-I-`
+:switch:`-I-`
Do not look for source files in the directory containing the source
file named in the command line.
Do not look for ALI or object files in the directory
- where *gnatmake* was invoked.
+ where ``gnatmake`` was invoked.
.. index:: -L (gnatmake)
.. index:: Linker libraries
-:samp:`-L{dir}`
- Add directory `dir` to the list of directories in which the linker
+:switch:`-L{dir}`
+ Add directory ``dir`` to the list of directories in which the linker
will search for libraries. This is equivalent to
- :samp:`-largs` :samp:`-L{dir}`.
+ :switch:`-largs` :switch:`-L{dir}`.
Furthermore, under Windows, the sources pointed to by the libraries path
set in the registry are not searched for.
.. index:: -nostdinc (gnatmake)
-:samp:`-nostdinc`
+:switch:`-nostdinc`
Do not look for source files in the system default directory.
.. index:: -nostdlib (gnatmake)
-:samp:`-nostdlib`
+:switch:`-nostdlib`
Do not look for library files in the system default directory.
.. index:: --RTS (gnatmake)
-:samp:`--RTS={rts-path}`
+:switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. GNAT looks for the
runtime
in the following directories, and stops as soon as a valid runtime is found
@@ -737,10 +737,10 @@ is passed to *gcc* (e.g., *-O*, *-gnato,* etc.)
.. _Mode_Switches_for_gnatmake:
-Mode Switches for *gnatmake*
-----------------------------
+Mode Switches for ``gnatmake``
+------------------------------
-The mode switches (referred to as `mode_switches`) allow the
+The mode switches (referred to as ``mode_switches``) allow the
inclusion of switches that are to be passed to the compiler itself, the
binder or the linker. The effect of a mode switch is to cause all
subsequent switches up to the end of the switch list, or up to the next
@@ -749,34 +749,34 @@ designated component of GNAT.
.. index:: -cargs (gnatmake)
-:samp:`-cargs {switches}`
- Compiler switches. Here `switches` is a list of switches
- that are valid switches for *gcc*. They will be passed on to
- all compile steps performed by *gnatmake*.
+:switch:`-cargs {switches}`
+ Compiler switches. Here ``switches`` is a list of switches
+ that are valid switches for ``gcc``. They will be passed on to
+ all compile steps performed by ``gnatmake``.
.. index:: -bargs (gnatmake)
-:samp:`-bargs {switches}`
- Binder switches. Here `switches` is a list of switches
- that are valid switches for `gnatbind`. They will be passed on to
- all bind steps performed by *gnatmake*.
+:switch:`-bargs {switches}`
+ Binder switches. Here ``switches`` is a list of switches
+ that are valid switches for ``gnatbind``. They will be passed on to
+ all bind steps performed by ``gnatmake``.
.. index:: -largs (gnatmake)
-:samp:`-largs {switches}`
- Linker switches. Here `switches` is a list of switches
- that are valid switches for *gnatlink*. They will be passed on to
- all link steps performed by *gnatmake*.
+:switch:`-largs {switches}`
+ Linker switches. Here ``switches`` is a list of switches
+ that are valid switches for ``gnatlink``. They will be passed on to
+ all link steps performed by ``gnatmake``.
.. index:: -margs (gnatmake)
-:samp:`-margs {switches}`
- Make switches. The switches are directly interpreted by *gnatmake*,
- regardless of any previous occurrence of *-cargs*, *-bargs*
- or *-largs*.
+:switch:`-margs {switches}`
+ Make switches. The switches are directly interpreted by ``gnatmake``,
+ regardless of any previous occurrence of :switch:`-cargs`, :switch:`-bargs`
+ or :switch:`-largs`.
.. _Notes_on_the_Command_Line:
@@ -785,48 +785,48 @@ Notes on the Command Line
-------------------------
This section contains some additional useful notes on the operation
-of the *gnatmake* command.
+of the ``gnatmake`` command.
.. index:: Recompilation (by gnatmake)
-* If *gnatmake* finds no ALI files, it recompiles the main program
+* If ``gnatmake`` finds no ALI files, it recompiles the main program
and all other units required by the main program.
- This means that *gnatmake*
+ This means that ``gnatmake``
can be used for the initial compile, as well as during subsequent steps of
the development cycle.
* If you enter ``gnatmake foo.adb``, where ``foo``
- is a subunit or body of a generic unit, *gnatmake* recompiles
+ is a subunit or body of a generic unit, ``gnatmake`` recompiles
:file:`foo.adb` (because it finds no ALI) and stops, issuing a
warning.
-* In *gnatmake* the switch *-I*
+* In ``gnatmake`` the switch :switch:`-I`
is used to specify both source and
- library file paths. Use *-aI*
+ library file paths. Use :switch:`-aI`
instead if you just want to specify
- source paths only and *-aO*
+ source paths only and :switch:`-aO`
if you want to specify library paths
only.
-* *gnatmake* will ignore any files whose ALI file is write-protected.
+* ``gnatmake`` will ignore any files whose ALI file is write-protected.
This may conveniently be used to exclude standard libraries from
consideration and in particular it means that the use of the
- *-f* switch will not recompile these files
- unless *-a* is also specified.
+ :switch:`-f` switch will not recompile these files
+ unless :switch:`-a` is also specified.
-* *gnatmake* has been designed to make the use of Ada libraries
+* ``gnatmake`` has been designed to make the use of Ada libraries
particularly convenient. Assume you have an Ada library organized
as follows: *obj-dir* contains the objects and ALI files for
of your Ada compilation units,
whereas *include-dir* contains the
specs of these units, but no bodies. Then to compile a unit
- stored in `main.adb`, which uses this Ada library you would just type:
+ stored in ``main.adb``, which uses this Ada library you would just type:
.. code-block:: sh
$ gnatmake -aI`include-dir` -aL`obj-dir` main
-* Using *gnatmake* along with the *-m (minimal recompilation)*
+* Using ``gnatmake`` along with the :switch:`-m (minimal recompilation)`
switch provides a mechanism for avoiding unnecessary recompilations. Using
this switch,
you can update the comments/format of your
@@ -842,12 +842,12 @@ of the *gnatmake* command.
.. _How_gnatmake_Works:
-How *gnatmake* Works
---------------------
+How ``gnatmake`` Works
+----------------------
-Generally *gnatmake* automatically performs all necessary
+Generally ``gnatmake`` automatically performs all necessary
recompilations and you don't need to worry about how it works. However,
-it may be useful to have some basic understanding of the *gnatmake*
+it may be useful to have some basic understanding of the ``gnatmake``
approach and in particular to understand how it uses the results of
previous compilations without incorrectly depending on them.
@@ -858,15 +858,15 @@ the ALI file. This means that neither the source file itself nor any
files that it depends on have been modified, and hence there is no need
to recompile this file.
-*gnatmake* works by first checking if the specified main unit is up
+``gnatmake`` works by first checking if the specified main unit is up
to date. If so, no compilations are required for the main unit. If not,
-*gnatmake* compiles the main program to build a new ALI file that
+``gnatmake`` compiles the main program to build a new ALI file that
reflects the latest sources. Then the ALI file of the main unit is
examined to find all the source files on which the main program depends,
-and *gnatmake* recursively applies the above procedure on all these
+and ``gnatmake`` recursively applies the above procedure on all these
files.
-This process ensures that *gnatmake* only trusts the dependencies
+This process ensures that ``gnatmake`` only trusts the dependencies
in an existing ALI file if they are known to be correct. Otherwise it
always recompiles to determine a new, guaranteed accurate set of
dependencies. As a result the program is compiled 'upside down' from what may
@@ -874,52 +874,52 @@ be more familiar as the required order of compilation in some other Ada
systems. In particular, clients are compiled before the units on which
they depend. The ability of GNAT to compile in any order is critical in
allowing an order of compilation to be chosen that guarantees that
-*gnatmake* will recompute a correct set of new dependencies if
+``gnatmake`` will recompute a correct set of new dependencies if
necessary.
-When invoking *gnatmake* with several `file_names`, if a unit is
+When invoking ``gnatmake`` with several ``file_names``, if a unit is
imported by several of the executables, it will be recompiled at most once.
Note: when using non-standard naming conventions
(:ref:`Using_Other_File_Names`), changing through a configuration pragmas
-file the version of a source and invoking *gnatmake* to recompile may
+file the version of a source and invoking ``gnatmake`` to recompile may
have no effect, if the previous version of the source is still accessible
-by *gnatmake*. It may be necessary to use the switch
+by ``gnatmake``. It may be necessary to use the switch
-f.
.. _Examples_of_gnatmake_Usage:
-Examples of *gnatmake* Usage
-----------------------------
+Examples of ``gnatmake`` Usage
+------------------------------
*gnatmake hello.adb*
Compile all files necessary to bind and link the main program
- :file:`hello.adb` (containing unit `Hello`) and bind and link the
+ :file:`hello.adb` (containing unit ``Hello``) and bind and link the
resulting object files to generate an executable file :file:`hello`.
*gnatmake main1 main2 main3*
Compile all files necessary to bind and link the main programs
- :file:`main1.adb` (containing unit `Main1`), :file:`main2.adb`
- (containing unit `Main2`) and :file:`main3.adb`
- (containing unit `Main3`) and bind and link the resulting object files
+ :file:`main1.adb` (containing unit ``Main1``), :file:`main2.adb`
+ (containing unit ``Main2``) and :file:`main3.adb`
+ (containing unit ``Main3``) and bind and link the resulting object files
to generate three executable files :file:`main1`,
:file:`main2` and :file:`main3`.
*gnatmake -q Main_Unit -cargs -O2 -bargs -l*
Compile all files necessary to bind and link the main program unit
- `Main_Unit` (from file :file:`main_unit.adb`). All compilations will
+ ``Main_Unit`` (from file :file:`main_unit.adb`). All compilations will
be done with optimization level 2 and the order of elaboration will be
- listed by the binder. *gnatmake* will operate in quiet mode, not
+ listed by the binder. ``gnatmake`` will operate in quiet mode, not
displaying commands it is executing.
.. _Compiling_with_gcc:
-Compiling with *gcc*
-====================
+Compiling with ``gcc``
+======================
-This section discusses how to compile Ada programs using the *gcc*
+This section discusses how to compile Ada programs using the ``gcc``
command. It also describes the set of switches
that can be used to control the behavior of the compiler.
@@ -929,7 +929,7 @@ Compiling Programs
------------------
The first step in creating an executable program is to compile the units
-of the program using the *gcc* command. You must compile the
+of the program using the ``gcc`` command. You must compile the
following files:
* the body file (:file:`.adb`) for a library level subprogram or generic
@@ -955,27 +955,27 @@ compiled.
.. index:: cannot generate code
If you attempt to compile any of these files, you will get one of the
-following error messages (where `fff` is the name of the file you
+following error messages (where ``fff`` is the name of the file you
compiled):
::
- cannot generate code for file `fff` (package spec)
+ cannot generate code for file ``fff`` (package spec)
to check package spec, use -gnatc
- cannot generate code for file `fff` (missing subunits)
+ cannot generate code for file ``fff`` (missing subunits)
to check parent unit, use -gnatc
- cannot generate code for file `fff` (subprogram spec)
+ cannot generate code for file ``fff`` (subprogram spec)
to check subprogram spec, use -gnatc
- cannot generate code for file `fff` (subunit)
+ cannot generate code for file ``fff`` (subunit)
to check subunit, use -gnatc
As indicated by the above error messages, if you want to submit
one of these files to the compiler to check for correct semantics
-without generating code, then use the *-gnatc* switch.
+without generating code, then use the :switch:`-gnatc` switch.
The basic command for compiling a file containing an Ada unit is:
@@ -983,10 +983,10 @@ The basic command for compiling a file containing an Ada unit is:
$ gcc -c [switches] <file name>
-where `file name` is the name of the Ada file (usually
+where ``file name`` is the name of the Ada file (usually
having an extension :file:`.ads` for a spec or :file:`.adb` for a body).
You specify the
-:option:`-c` switch to tell *gcc* to compile, but not link, the file.
+:switch:`-c` switch to tell ``gcc`` to compile, but not link, the file.
The result of a successful compilation is an object file, which has the
same name as the source file but an extension of :file:`.o` and an Ada
Library Information (ALI) file, which also has the same name as the
@@ -995,19 +995,21 @@ two output files in the current directory, but you may specify a source
file in any directory using an absolute or relative path specification
containing the directory information.
+TESTING: the :switch:`--foobar{NN}` switch
+
.. index:: gnat1
-*gcc* is actually a driver program that looks at the extensions of
+``gcc`` is actually a driver program that looks at the extensions of
the file arguments and loads the appropriate compiler. For example, the
GNU C compiler is :file:`cc1`, and the Ada compiler is :file:`gnat1`.
These programs are in directories known to the driver program (in some
configurations via environment variables you set), but need not be in
-your path. The *gcc* driver also calls the assembler and any other
+your path. The ``gcc`` driver also calls the assembler and any other
utilities needed to complete the generation of the required object
files.
-It is possible to supply several file names on the same *gcc*
-command. This causes *gcc* to call the appropriate compiler for
+It is possible to supply several file names on the same ``gcc``
+command. This causes ``gcc`` to call the appropriate compiler for
each file. For example, the following command lists two separate
files to be compiled:
@@ -1016,13 +1018,13 @@ files to be compiled:
$ gcc -c x.adb y.adb
-calls `gnat1` (the Ada compiler) twice to compile :file:`x.adb` and
+calls ``gnat1`` (the Ada compiler) twice to compile :file:`x.adb` and
:file:`y.adb`.
The compiler generates two object files :file:`x.o` and :file:`y.o`
and the two ALI files :file:`x.ali` and :file:`y.ali`.
Any switches apply to all the files listed, see :ref:`Switches_for_gcc` for a
-list of available *gcc* switches.
+list of available ``gcc`` switches.
.. _Search_Paths_and_the_Run-Time_Library_RTL:
@@ -1042,7 +1044,7 @@ directories, in the following order:
* The directory containing the source file of the main unit being compiled
(the file name on the command line).
-* Each directory named by an *-I* switch given on the *gcc*
+* Each directory named by an :switch:`-I` switch given on the ``gcc``
command line, in the order given.
.. index:: ADA_PRJ_INCLUDE_FILE
@@ -1066,37 +1068,37 @@ directories, in the following order:
GNAT Run Time Library (RTL) source files.
:ref:`Installing_a_library`
-Specifying the switch *-I-*
+Specifying the switch :switch:`-I-`
inhibits the use of the directory
containing the source file named in the command line. You can still
have this directory on your search path, but in this case it must be
-explicitly requested with a *-I* switch.
+explicitly requested with a :switch:`-I` switch.
-Specifying the switch *-nostdinc*
+Specifying the switch :switch:`-nostdinc`
inhibits the search of the default location for the GNAT Run Time
Library (RTL) source files.
The compiler outputs its object files and ALI files in the current
working directory.
-Caution: The object file can be redirected with the *-o* switch;
-however, *gcc* and `gnat1` have not been coordinated on this
+Caution: The object file can be redirected with the :switch:`-o` switch;
+however, ``gcc`` and ``gnat1`` have not been coordinated on this
so the :file:`ALI` file will not go to the right place. Therefore, you should
-avoid using the *-o* switch.
+avoid using the :switch:`-o` switch.
.. index:: System.IO
-The packages `Ada`, `System`, and `Interfaces` and their
-children make up the GNAT RTL, together with the simple `System.IO`
-package used in the `"Hello World"` example. The sources for these units
+The packages ``Ada``, ``System``, and ``Interfaces`` and their
+children make up the GNAT RTL, together with the simple ``System.IO``
+package used in the ``"Hello World"`` example. The sources for these units
are needed by the compiler and are kept together in one directory. Not
all of the bodies are needed, but all of the sources are kept together
anyway. In a normal installation, you need not specify these directory
names when compiling or binding. Either the environment variables or
the built-in defaults cause these files to be found.
-In addition to the language-defined hierarchies (`System`, `Ada` and
-`Interfaces`), the GNAT distribution provides a fourth hierarchy,
-consisting of child units of `GNAT`. This is a collection of generally
+In addition to the language-defined hierarchies (``System``, ``Ada`` and
+``Interfaces``), the GNAT distribution provides a fourth hierarchy,
+consisting of child units of ``GNAT``. This is a collection of generally
useful types, subprograms, etc. See the :title:`GNAT_Reference_Manual`
for further details.
@@ -1109,7 +1111,7 @@ development environments much more flexible.
Order of Compilation Issues
---------------------------
-If, in our earlier example, there was a spec for the `hello`
+If, in our earlier example, there was a spec for the ``hello``
procedure, it would be contained in the file :file:`hello.ads`; yet this
file would not have to be explicitly compiled. This is the result of the
model we chose to implement library management. Some of the consequences
@@ -1155,7 +1157,7 @@ Compile body in file :file:`xyz.adb` with all default options.
$ gcc -c -O2 -gnata xyz-def.adb
Compile the child unit package in file :file:`xyz-def.adb` with extensive
-optimizations, and pragma `Assert`/`Debug` statements
+optimizations, and pragma ``Assert``/`Debug` statements
enabled.
.. code-block:: sh
@@ -1171,7 +1173,7 @@ mode.
Compiler Switches
=================
-The *gcc* command accepts switches that control the
+The ``gcc`` command accepts switches that control the
compilation process. These switches are fully described in this section:
first an alphabetical listing of all switches with a brief description,
and then functionally grouped sets of switches with more detailed
@@ -1190,51 +1192,51 @@ Alphabetical List of All Switches
.. index:: -b (gcc)
-:samp:`-b {target}`
- Compile your program to run on `target`, which is the name of a
+:switch:`-b {target}`
+ Compile your program to run on ``target``, which is the name of a
system configuration. You must have a GNAT cross-compiler built if
- `target` is not the same as your host system.
+ ``target`` is not the same as your host system.
.. index:: -B (gcc)
-:samp:`-B{dir}`
- Load compiler executables (for example, `gnat1`, the Ada compiler)
- from `dir` instead of the default location. Only use this switch
+:switch:`-B{dir}`
+ Load compiler executables (for example, ``gnat1``, the Ada compiler)
+ from ``dir`` instead of the default location. Only use this switch
when multiple versions of the GNAT compiler are available.
See the "Options for Directory Search" section in the
:title:`Using the GNU Compiler Collection (GCC)` manual for further details.
- You would normally use the *-b* or *-V* switch instead.
+ You would normally use the :switch:`-b` or :switch:`-V` switch instead.
.. index:: -c (gcc)
-:samp:`-c`
+:switch:`-c`
Compile. Always use this switch when compiling Ada programs.
- Note: for some other languages when using *gcc*, notably in
+ Note: for some other languages when using ``gcc``, notably in
the case of C and C++, it is possible to use
- use *gcc* without a *-c* switch to
+ use ``gcc`` without a :switch:`-c` switch to
compile and link in one step. In the case of GNAT, you
cannot use this approach, because the binder must be run
- and *gcc* cannot be used to run the GNAT binder.
+ and ``gcc`` cannot be used to run the GNAT binder.
.. index:: -fcallgraph-info (gcc)
-:samp:`-fcallgraph-info[=su,da]`
+:switch:`-fcallgraph-info[=su,da]`
Makes the compiler output callgraph information for the program, on a
per-file basis. The information is generated in the VCG format. It can
be decorated with additional, per-node and/or per-edge information, if a
list of comma-separated markers is additionally specified. When the
- `su` marker is specified, the callgraph is decorated with stack usage
- information; it is equivalent to *-fstack-usage*. When the `da`
+ ``su`` marker is specified, the callgraph is decorated with stack usage
+ information; it is equivalent to :switch:`-fstack-usage`. When the ``da``
marker is specified, the callgraph is decorated with information about
dynamically allocated objects.
.. index:: -fdump-scos (gcc)
-:samp:`-fdump-scos`
+:switch:`-fdump-scos`
Generates SCO (Source Coverage Obligation) information in the ALI file.
This information is used by advanced coverage tools. See unit :file:`SCOs`
in the compiler sources for details in files :file:`scos.ads` and
@@ -1243,69 +1245,69 @@ Alphabetical List of All Switches
.. index:: -fdump-xref (gcc)
-:samp:`-fdump-xref`
+:switch:`-fdump-xref`
Generates cross reference information in GLI files for C and C++ sources.
The GLI files have the same syntax as the ALI files for Ada, and can be used
for source navigation in IDEs and on the command line using e.g. gnatxref
- and the *--ext=gli* switch.
+ and the :switch:`--ext=gli` switch.
.. index:: -flto (gcc)
-:samp:`-flto[={n}]`
+:switch:`-flto[={n}]`
Enables Link Time Optimization. This switch must be used in conjunction
- with the traditional *-Ox* switches and instructs the compiler to
+ with the traditional :switch:`-Ox` switches and instructs the compiler to
defer most optimizations until the link stage. The advantage of this
approach is that the compiler can do a whole-program analysis and choose
the best interprocedural optimization strategy based on a complete view
of the program, instead of a fragmentary view with the usual approach.
This can also speed up the compilation of big programs and reduce the
size of the executable, compared with a traditional per-unit compilation
- with inlining across modules enabled by the *-gnatn* switch.
+ with inlining across modules enabled by the :switch:`-gnatn` switch.
The drawback of this approach is that it may require more memory and that
the debugging information generated by -g with it might be hardly usable.
- The switch, as well as the accompanying *-Ox* switches, must be
+ The switch, as well as the accompanying :switch:`-Ox` switches, must be
specified both for the compilation and the link phases.
- If the `n` parameter is specified, the optimization and final code
- generation at link time are executed using `n` parallel jobs by
- means of an installed *make* program.
+ If the ``n`` parameter is specified, the optimization and final code
+ generation at link time are executed using ``n`` parallel jobs by
+ means of an installed ``make`` program.
.. index:: -fno-inline (gcc)
-:samp:`-fno-inline`
- Suppresses all inlining, unless requested with pragma `Inline_Always`. The
+:switch:`-fno-inline`
+ Suppresses all inlining, unless requested with pragma ``Inline_Always``. The
effect is enforced regardless of other optimization or inlining switches.
Note that inlining can also be suppressed on a finer-grained basis with
- pragma `No_Inline`.
+ pragma ``No_Inline``.
.. index:: -fno-inline-functions (gcc)
-:samp:`-fno-inline-functions`
+:switch:`-fno-inline-functions`
Suppresses automatic inlining of subprograms, which is enabled
- if *-O3* is used.
+ if :switch:`-O3` is used.
.. index:: -fno-inline-small-functions (gcc)
-:samp:`-fno-inline-small-functions`
+:switch:`-fno-inline-small-functions`
Suppresses automatic inlining of small subprograms, which is enabled
- if *-O2* is used.
+ if :switch:`-O2` is used.
.. index:: -fno-inline-functions-called-once (gcc)
-:samp:`-fno-inline-functions-called-once`
+:switch:`-fno-inline-functions-called-once`
Suppresses inlining of subprograms local to the unit and called once
- from within it, which is enabled if *-O1* is used.
+ from within it, which is enabled if :switch:`-O1` is used.
.. index:: -fno-ivopts (gcc)
-:samp:`-fno-ivopts`
+:switch:`-fno-ivopts`
Suppresses high-level loop induction variable optimizations, which are
- enabled if *-O1* is used. These optimizations are generally
+ enabled if :switch:`-O1` is used. These optimizations are generally
profitable but, for some specific cases of loops with numerous uses
of the iteration variable that follow a common pattern, they may end
up destroying the regularity that could be exploited at a lower level
@@ -1314,7 +1316,7 @@ Alphabetical List of All Switches
.. index:: -fno-strict-aliasing (gcc)
-:samp:`-fno-strict-aliasing`
+:switch:`-fno-strict-aliasing`
Causes the compiler to avoid assumptions regarding non-aliasing
of objects of different types. See
:ref:`Optimization_and_Strict_Aliasing` for details.
@@ -1322,89 +1324,89 @@ Alphabetical List of All Switches
.. index:: -fno-strict-overflow (gcc)
-:samp:`-fno-strict-overflow`
+:switch:`-fno-strict-overflow`
Causes the compiler to avoid assumptions regarding the rules of signed
integer overflow. These rules specify that signed integer overflow will
result in a Constraint_Error exception at run time and are enforced in
default mode by the compiler, so this switch should not be necessary in
- normal operating mode. It might be useful in conjunction with *-gnato0*
+ normal operating mode. It might be useful in conjunction with :switch:`-gnato0`
for very peculiar cases of low-level programming.
.. index:: -fstack-check (gcc)
-:samp:`-fstack-check`
+:switch:`-fstack-check`
Activates stack checking.
See :ref:`Stack_Overflow_Checking` for details.
.. index:: -fstack-usage (gcc)
-:samp:`-fstack-usage`
+:switch:`-fstack-usage`
Makes the compiler output stack usage information for the program, on a
per-subprogram basis. See :ref:`Static_Stack_Usage_Analysis` for details.
.. index:: -g (gcc)
-:samp:`-g`
+:switch:`-g`
Generate debugging information. This information is stored in the object
file and copied from there to the final executable file by the linker,
where it can be read by the debugger. You must use the
- *-g* switch if you plan on using the debugger.
+ :switch:`-g` switch if you plan on using the debugger.
.. index:: -gnat05 (gcc)
-:samp:`-gnat05`
+:switch:`-gnat05`
Allow full Ada 2005 features.
.. index:: -gnat12 (gcc)
-:samp:`-gnat12`
+:switch:`-gnat12`
Allow full Ada 2012 features.
.. index:: -gnat83 (gcc)
.. index:: -gnat2005 (gcc)
-:samp:`-gnat2005`
- Allow full Ada 2005 features (same as *-gnat05*)
+:switch:`-gnat2005`
+ Allow full Ada 2005 features (same as :switch:`-gnat05`)
.. index:: -gnat2012 (gcc)
-:samp:`-gnat2012`
- Allow full Ada 2012 features (same as *-gnat12*)
+:switch:`-gnat2012`
+ Allow full Ada 2012 features (same as :switch:`-gnat12`)
-:samp:`-gnat83`
+:switch:`-gnat83`
Enforce Ada 83 restrictions.
.. index:: -gnat95 (gcc)
-:samp:`-gnat95`
+:switch:`-gnat95`
Enforce Ada 95 restrictions.
Note: for compatibility with some Ada 95 compilers which support only
- the `overriding` keyword of Ada 2005, the *-gnatd.D* switch can
- be used along with *-gnat95* to achieve a similar effect with GNAT.
+ the ``overriding`` keyword of Ada 2005, the :switch:`-gnatd.D` switch can
+ be used along with :switch:`-gnat95` to achieve a similar effect with GNAT.
- *-gnatd.D* instructs GNAT to consider `overriding` as a keyword
+ :switch:`-gnatd.D` instructs GNAT to consider ``overriding`` as a keyword
and handle its associated semantic checks, even in Ada 95 mode.
.. index:: -gnata (gcc)
-:samp:`-gnata`
- Assertions enabled. `Pragma Assert` and `pragma Debug` to be
+:switch:`-gnata`
+ Assertions enabled. ``Pragma Assert`` and ``pragma Debug`` to be
activated. Note that these pragmas can also be controlled using the
- configuration pragmas `Assertion_Policy` and `Debug_Policy`.
- It also activates pragmas `Check`, `Precondition`, and
- `Postcondition`. Note that these pragmas can also be controlled
- using the configuration pragma `Check_Policy`. In Ada 2012, it
+ configuration pragmas ``Assertion_Policy`` and ``Debug_Policy``.
+ It also activates pragmas ``Check``, ``Precondition``, and
+ ``Postcondition``. Note that these pragmas can also be controlled
+ using the configuration pragma ``Check_Policy``. In Ada 2012, it
also activates all assertions defined in the RM as aspects: preconditions,
postconditions, type invariants and (sub)type predicates. In all Ada modes,
corresponding pragmas for type invariants and (sub)type predicates are
@@ -1416,41 +1418,41 @@ Alphabetical List of All Switches
.. index:: -gnatA (gcc)
-:samp:`-gnatA`
+:switch:`-gnatA`
Avoid processing :file:`gnat.adc`. If a :file:`gnat.adc` file is present,
it will be ignored.
.. index:: -gnatb (gcc)
-:samp:`-gnatb`
+:switch:`-gnatb`
Generate brief messages to :file:`stderr` even if verbose mode set.
.. index:: -gnatB (gcc)
-:samp:`-gnatB`
+:switch:`-gnatB`
Assume no invalid (bad) values except for 'Valid attribute use
(:ref:`Validity_Checking`).
.. index:: -gnatc (gcc)
-:samp:`-gnatc`
+:switch:`-gnatc`
Check syntax and semantics only (no code generation attempted). When the
- compiler is invoked by *gnatmake*, if the switch *-gnatc* is
- only given to the compiler (after *-cargs* or in package Compiler of
- the project file, *gnatmake* will fail because it will not find the
- object file after compilation. If *gnatmake* is called with
- *-gnatc* as a builder switch (before *-cargs* or in package
- Builder of the project file) then *gnatmake* will not fail because
+ compiler is invoked by ``gnatmake``, if the switch :switch:`-gnatc` is
+ only given to the compiler (after :switch:`-cargs` or in package Compiler of
+ the project file, ``gnatmake`` will fail because it will not find the
+ object file after compilation. If ``gnatmake`` is called with
+ :switch:`-gnatc` as a builder switch (before :switch:`-cargs` or in package
+ Builder of the project file) then ``gnatmake`` will not fail because
it will not look for the object files after compilation, and it will not try
to build and link.
.. index:: -gnatC (gcc)
-:samp:`-gnatC`
+:switch:`-gnatC`
Generate CodePeer intermediate format (no code generation attempted).
This switch will generate an intermediate representation suitable for
use by CodePeer (:file:`.scil` files). This switch is not compatible with
@@ -1460,9 +1462,9 @@ Alphabetical List of All Switches
.. index:: -gnatd (gcc)
-:samp:`-gnatd`
+:switch:`-gnatd`
Specify debug options for the compiler. The string of characters after
- the *-gnatd* specify the specific debug options. The possible
+ the :switch:`-gnatd` specify the specific debug options. The possible
characters are 0-9, a-z, A-Z, optionally preceded by a dot. See
compiler source file :file:`debug.adb` for details of the implemented
debug options. Certain debug options are relevant to applications
@@ -1472,16 +1474,16 @@ Alphabetical List of All Switches
.. index:: -gnatD[nn] (gcc)
-:samp:`-gnatD`
+:switch:`-gnatD`
Create expanded source files for source level debugging. This switch
also suppresses generation of cross-reference information
- (see *-gnatx*). Note that this switch is not allowed if a previous
+ (see :switch:`-gnatx`). Note that this switch is not allowed if a previous
-gnatR switch has been given, since these two switches are not compatible.
.. index:: -gnateA (gcc)
-:samp:`-gnateA`
+:switch:`-gnateA`
Check that the actual parameters of a subprogram call are not aliases of one
another. To qualify as aliasing, the actuals must denote objects of a composite
type, their memory locations must be identical or overlapping, and at least one
@@ -1510,16 +1512,16 @@ Alphabetical List of All Switches
Detect_Aliasing (Obj, Self (Obj));
- In the example above, the first call to `Detect_Aliasing` fails with a
- `Program_Error` at runtime because the actuals for `Val_1` and
- `Val_2` denote the same object. The second call executes without raising
- an exception because `Self(Obj)` produces an anonymous object which does
- not share the memory location of `Obj`.
+ In the example above, the first call to ``Detect_Aliasing`` fails with a
+ ``Program_Error`` at runtime because the actuals for ``Val_1`` and
+ ``Val_2`` denote the same object. The second call executes without raising
+ an exception because ``Self(Obj)`` produces an anonymous object which does
+ not share the memory location of ``Obj``.
.. index:: -gnatec (gcc)
-:samp:`-gnatec={path}`
+:switch:`-gnatec={path}`
Specify a configuration pragma file
(the equal sign is optional)
(:ref:`The_Configuration_Pragmas_Files`).
@@ -1527,28 +1529,28 @@ Alphabetical List of All Switches
.. index:: -gnateC (gcc)
-:samp:`-gnateC`
+:switch:`-gnateC`
Generate CodePeer messages in a compiler-like format. This switch is only
- effective if *-gnatcC* is also specified and requires an installation
+ effective if :switch:`-gnatcC` is also specified and requires an installation
of CodePeer.
.. index:: -gnated (gcc)
-:samp:`-gnated`
+:switch:`-gnated`
Disable atomic synchronization
.. index:: -gnateD (gcc)
-:samp:`-gnateDsymbol[={value}]`
- Defines a symbol, associated with `value`, for preprocessing.
+:switch:`-gnateDsymbol[={value}]`
+ Defines a symbol, associated with ``value``, for preprocessing.
(:ref:`Integrated_Preprocessing`).
.. index:: -gnateE (gcc)
-:samp:`-gnateE`
+:switch:`-gnateE`
Generate extra information in exception messages. In particular, display
extra column information and the value and range associated with index and
range check failures, and extra column information for access checks.
@@ -1559,57 +1561,57 @@ Alphabetical List of All Switches
.. index:: -gnatef (gcc)
-:samp:`-gnatef`
+:switch:`-gnatef`
Display full source path name in brief error messages.
.. index:: -gnateF (gcc)
-:samp:`-gnateF`
+:switch:`-gnateF`
Check for overflow on all floating-point operations, including those
for unconstrained predefined types. See description of pragma
- `Check_Float_Overflow` in GNAT RM.
+ ``Check_Float_Overflow`` in GNAT RM.
.. index:: -gnateg (gcc)
-:samp:`-gnateg`
-:samp:`-gnatceg`
+:switch:`-gnateg`
+:switch:`-gnatceg`
- The `-gnatc` switch must always be specified before this switch, e.g.
- `-gnatceg`. Generate a C header from the Ada input file. See
+ The :switch:`-gnatc` switch must always be specified before this switch, e.g.
+ :switch:`-gnatceg`. Generate a C header from the Ada input file. See
:ref:`Generating_C_Headers_for_Ada_Specifications` for more
information.
.. index:: -gnateG (gcc)
-:samp:`-gnateG`
+:switch:`-gnateG`
Save result of preprocessing in a text file.
.. index:: -gnatei (gcc)
-:samp:`-gnatei{nnn}`
+:switch:`-gnatei{nnn}`
Set maximum number of instantiations during compilation of a single unit to
- `nnn`. This may be useful in increasing the default maximum of 8000 for
+ ``nnn``. This may be useful in increasing the default maximum of 8000 for
the rare case when a single unit legitimately exceeds this limit.
.. index:: -gnateI (gcc)
-:samp:`-gnateI{nnn}`
+:switch:`-gnateI{nnn}`
Indicates that the source is a multi-unit source and that the index of the
- unit to compile is `nnn`. `nnn` needs to be a positive number and need
+ unit to compile is ``nnn``. ``nnn`` needs to be a positive number and need
to be a valid index in the multi-unit source.
.. index:: -gnatel (gcc)
-:samp:`-gnatel`
+:switch:`-gnatel`
This switch can be used with the static elaboration model to issue info
messages showing
- where implicit `pragma Elaborate` and `pragma Elaborate_All`
+ where implicit ``pragma Elaborate`` and ``pragma Elaborate_All``
are generated. This is useful in diagnosing elaboration circularities
caused by these implicit pragmas when using the static elaboration
model. See See the section in this guide on elaboration checking for
@@ -1619,13 +1621,13 @@ Alphabetical List of All Switches
.. index:: -gnatel (gcc)
-:samp:`-gnateL`
+:switch:`-gnateL`
This switch turns off the info messages about implicit elaboration pragmas.
.. index:: -gnatem (gcc)
-:samp:`-gnatem={path}`
+:switch:`-gnatem={path}`
Specify a mapping file
(the equal sign is optional)
(:ref:`Units_to_Sources_Mapping_Files`).
@@ -1633,7 +1635,7 @@ Alphabetical List of All Switches
.. index:: -gnatep (gcc)
-:samp:`-gnatep={file}`
+:switch:`-gnatep={file}`
Specify a preprocessing data file
(the equal sign is optional)
(:ref:`Integrated_Preprocessing`).
@@ -1641,7 +1643,7 @@ Alphabetical List of All Switches
.. index:: -gnateP (gcc)
-:samp:`-gnateP`
+:switch:`-gnateP`
Turn categorization dependency errors into warnings.
Ada requires that units that WITH one another have compatible categories, for
example a Pure unit cannot WITH a Preelaborate unit. If this switch is used,
@@ -1652,20 +1654,20 @@ Alphabetical List of All Switches
.. index:: -gnateS (gcc)
-:samp:`-gnateS`
- Synonym of *-fdump-scos*, kept for backwards compatibility.
+:switch:`-gnateS`
+ Synonym of :switch:`-fdump-scos`, kept for backwards compatibility.
.. index:: -gnatet=file (gcc)
-:samp:`-gnatet={path}`
+:switch:`-gnatet={path}`
Generate target dependent information. The format of the output file is
- described in the section about switch *-gnateT*.
+ described in the section about switch :switch:`-gnateT`.
.. index:: -gnateT (gcc)
-:samp:`-gnateT={path}`
+:switch:`-gnateT={path}`
Read target dependent information, such as endianness or sizes and alignments
of base type. If this switch is passed, the default target dependent
information of the compiler is replaced by the one read from the input file.
@@ -1674,7 +1676,7 @@ Alphabetical List of All Switches
the machine on which the tool is run.
The following target dependent values should be defined,
- where `Nat` denotes a natural integer value, `Pos` denotes a
+ where ``Nat`` denotes a natural integer value, ``Pos`` denotes a
positive integer value, and fields marked with a question mark are
boolean fields, where a value of 0 is False, and a value of 1 is True:
@@ -1714,8 +1716,8 @@ Alphabetical List of All Switches
name value
- where `name` is the name of the parameter, spelled out in full,
- and cased as in the above list, and `value` is an unsigned decimal
+ where ``name`` is the name of the parameter, spelled out in full,
+ and cased as in the above list, and ``value`` is an unsigned decimal
integer. Two or more blanks separates the name from the value.
All the variables must be present, in alphabetical order (i.e. the
@@ -1731,11 +1733,11 @@ Alphabetical List of All Switches
name digs float_rep size alignment
- where `name` is the string name of the type (which can have
- single spaces embedded in the name (e.g. long double), `digs` is
- the number of digits for the floating-point type, `float_rep` is
+ where ``name`` is the string name of the type (which can have
+ single spaces embedded in the name (e.g. long double), ``digs`` is
+ the number of digits for the floating-point type, ``float_rep`` is
the float representation (I/V/A for IEEE-754-Binary, Vax_Native,
- AAMP), `size` is the size in bits, `alignment` is the
+ AAMP), ``size`` is the size in bits, ``alignment`` is the
alignment in bits. The name is followed by at least two blanks, fields
are separated by at least one blank, and a LF character immediately
follows the alignment field.
@@ -1777,7 +1779,7 @@ Alphabetical List of All Switches
.. index:: -gnateu (gcc)
-:samp:`-gnateu`
+:switch:`-gnateu`
Ignore unrecognized validity, warning, and style switches that
appear after this switch is given. This may be useful when
compiling sources developed on a later version of the compiler
@@ -1787,14 +1789,14 @@ Alphabetical List of All Switches
.. index:: -gnateV (gcc)
-:samp:`-gnateV`
+:switch:`-gnateV`
Check that all actual parameters of a subprogram call are valid according to
the rules of validity checking (:ref:`Validity_Checking`).
.. index:: -gnateY (gcc)
-:samp:`-gnateY`
+:switch:`-gnateY`
Ignore all STYLE_CHECKS pragmas. Full legality checks
are still carried out, but the pragmas have no effect
on what style checks are active. This allows all style
@@ -1803,59 +1805,59 @@ Alphabetical List of All Switches
.. index:: -gnatE (gcc)
-:samp:`-gnatE`
+:switch:`-gnatE`
Full dynamic elaboration checks.
.. index:: -gnatf (gcc)
-:samp:`-gnatf`
+:switch:`-gnatf`
Full errors. Multiple errors per line, all undefined references, do not
attempt to suppress cascaded errors.
.. index:: -gnatF (gcc)
-:samp:`-gnatF`
+:switch:`-gnatF`
Externals names are folded to all uppercase.
.. index:: -gnatg (gcc)
-:samp:`-gnatg`
+:switch:`-gnatg`
Internal GNAT implementation mode. This should not be used for
applications programs, it is intended only for use by the compiler
and its run-time library. For documentation, see the GNAT sources.
- Note that *-gnatg* implies
- *-gnatw.ge* and
- *-gnatyg*
+ Note that :switch:`-gnatg` implies
+ :switch:`-gnatw.ge` and
+ :switch:`-gnatyg`
so that all standard warnings and all standard style options are turned on.
All warnings and style messages are treated as errors.
.. index:: -gnatG[nn] (gcc)
-:samp:`-gnatG=nn`
+:switch:`-gnatG=nn`
List generated expanded code in source form.
.. index:: -gnath (gcc)
-:samp:`-gnath`
+:switch:`-gnath`
Output usage information. The output is written to :file:`stdout`.
.. index:: -gnati (gcc)
-:samp:`-gnati{c}`
- Identifier character set (`c` = 1/2/3/4/8/9/p/f/n/w).
- For details of the possible selections for `c`,
+:switch:`-gnati{c}`
+ Identifier character set (``c`` = 1/2/3/4/8/9/p/f/n/w).
+ For details of the possible selections for ``c``,
see :ref:`Character_Set_Control`.
.. index:: -gnatI (gcc)
-:samp:`-gnatI`
+:switch:`-gnatI`
Ignore representation clauses. When this switch is used,
representation clauses are treated as comments. This is useful
when initially porting code where you want to ignore rep clause
@@ -1864,36 +1866,37 @@ Alphabetical List of All Switches
are: enumeration_representation_clause, record_representation_clause,
and attribute_definition_clause for the following attributes:
Address, Alignment, Bit_Order, Component_Size, Machine_Radix,
- Object_Size, Size, Small, Stream_Size, and Value_Size.
+ Object_Size, Scalar_Storage_Order, Size, Small, Stream_Size,
+ and Value_Size. Pragma Default_Scalar_Storage_Order is also ignored.
Note that this option should be used only for compiling -- the
code is likely to malfunction at run time.
- Note that when `-gnatct` is used to generate trees for input
- into `ASIS` tools, these representation clauses are removed
+ Note that when :switch:`-gnatct` is used to generate trees for input
+ into ASIS tools, these representation clauses are removed
from the tree and ignored. This means that the tool will not see them.
.. index:: -gnatjnn (gcc)
-:samp:`-gnatj{nn}`
- Reformat error messages to fit on `nn` character lines
+:switch:`-gnatj{nn}`
+ Reformat error messages to fit on ``nn`` character lines
.. index:: -gnatk (gcc)
-:samp:`-gnatk={n}`
- Limit file names to `n` (1-999) characters (`k` = krunch).
+:switch:`-gnatk={n}`
+ Limit file names to ``n`` (1-999) characters (``k`` = krunch).
.. index:: -gnatl (gcc)
-:samp:`-gnatl`
+:switch:`-gnatl`
Output full source listing with embedded error messages.
.. index:: -gnatL (gcc)
-:samp:`-gnatL`
+:switch:`-gnatL`
Used in conjunction with -gnatG or -gnatD to intersperse original
source lines (as comment lines with line numbers) in the expanded
source output.
@@ -1901,9 +1904,9 @@ Alphabetical List of All Switches
.. index:: -gnatm (gcc)
-:samp:`-gnatm={n}`
- Limit number of detected error or warning messages to `n`
- where `n` is in the range 1..999999. The default setting if
+:switch:`-gnatm={n}`
+ Limit number of detected error or warning messages to ``n``
+ where ``n`` is in the range 1..999999. The default setting if
no switch is given is 9999. If the number of warnings reaches this
limit, then a message is output and further warnings are suppressed,
but the compilation is continued. If the number of error messages
@@ -1914,8 +1917,8 @@ Alphabetical List of All Switches
.. index:: -gnatn (gcc)
-:samp:`-gnatn[12]`
- Activate inlining across modules for subprograms for which pragma `Inline`
+:switch:`-gnatn[12]`
+ Activate inlining across modules for subprograms for which pragma ``Inline``
is specified. This inlining is performed by the GCC back-end. An optional
digit sets the inlining level: 1 for moderate inlining across modules
or 2 for full inlining across modules. If no inlining level is specified,
@@ -1924,42 +1927,42 @@ Alphabetical List of All Switches
.. index:: -gnatN (gcc)
-:samp:`-gnatN`
+:switch:`-gnatN`
Activate front end inlining for subprograms for which
- pragma `Inline` is specified. This inlining is performed
+ pragma ``Inline`` is specified. This inlining is performed
by the front end and will be visible in the
- *-gnatG* output.
+ :switch:`-gnatG` output.
When using a gcc-based back end (in practice this means using any version
of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of
- *-gnatN* is deprecated, and the use of *-gnatn* is preferred.
+ :switch:`-gnatN` is deprecated, and the use of :switch:`-gnatn` is preferred.
Historically front end inlining was more extensive than the gcc back end
inlining, but that is no longer the case.
.. index:: -gnato0 (gcc)
-:samp:`-gnato0`
+:switch:`-gnato0`
Suppresses overflow checking. This causes the behavior of the compiler to
match the default for older versions where overflow checking was suppressed
by default. This is equivalent to having
- `pragma Suppress (Overflow_Mode)` in a configuration pragma file.
+ ``pragma Suppress (Overflow_Check)`` in a configuration pragma file.
.. index:: -gnato?? (gcc)
-:samp:`-gnato??`
+:switch:`-gnato??`
Set default mode for handling generation of code to avoid intermediate
- arithmetic overflow. Here `??` is two digits, a
- single digit, or nothing. Each digit is one of the digits `1`
- through `3`:
+ arithmetic overflow. Here ``??`` is two digits, a
+ single digit, or nothing. Each digit is one of the digits ``1``
+ through ``3``:
===== ===============================================================
Digit Interpretation
----- ---------------------------------------------------------------
- *1* All intermediate overflows checked against base type (`STRICT`)
- *2* Minimize intermediate overflows (`MINIMIZED`)
- *3* Eliminate intermediate overflows (`ELIMINATED`)
+ *1* All intermediate overflows checked against base type (``STRICT``)
+ *2* Minimize intermediate overflows (``MINIMIZED``)
+ *3* Eliminate intermediate overflows (``ELIMINATED``)
===== ===============================================================
If only one digit appears, then it applies to all
@@ -1967,16 +1970,16 @@ Alphabetical List of All Switches
assertions, pre/postconditions, and type invariants, and the second
applies within assertions, pre/postconditions, and type invariants.
- If no digits follow the *-gnato*, then it is equivalent to
- *-gnato11*,
+ If no digits follow the :switch:`-gnato`, then it is equivalent to
+ :switch:`-gnato11`,
causing all intermediate overflows to be handled in strict
mode.
This switch also causes arithmetic overflow checking to be performed
- (as though `pragma Unsuppress (Overflow_Mode)` had been specified).
+ (as though ``pragma Unsuppress (Overflow_Check)`` had been specified).
- The default if no option *-gnato* is given is that overflow handling
- is in `STRICT` mode (computations done using the base type), and that
+ The default if no option :switch:`-gnato` is given is that overflow handling
+ is in ``STRICT`` mode (computations done using the base type), and that
overflow checking is enabled.
Note that division by zero is a separate check that is not
@@ -1987,160 +1990,157 @@ Alphabetical List of All Switches
.. index:: -gnatp (gcc)
-:samp:`-gnatp`
+:switch:`-gnatp`
Suppress all checks. See :ref:`Run-Time_Checks` for details. This switch
- has no effect if cancelled by a subsequent *-gnat-p* switch.
+ has no effect if cancelled by a subsequent :switch:`-gnat-p` switch.
.. index:: -gnat-p (gcc)
-:samp:`-gnat-p`
- Cancel effect of previous *-gnatp* switch.
+:switch:`-gnat-p`
+ Cancel effect of previous :switch:`-gnatp` switch.
.. index:: -gnatP (gcc)
-:samp:`-gnatP`
+:switch:`-gnatP`
Enable polling. This is required on some systems (notably Windows NT) to
obtain asynchronous abort and asynchronous transfer of control capability.
- See `Pragma_Polling` in the :title:`GNAT_Reference_Manual` for full
+ See ``Pragma_Polling`` in the :title:`GNAT_Reference_Manual` for full
details.
.. index:: -gnatq (gcc)
-:samp:`-gnatq`
+:switch:`-gnatq`
Don't quit. Try semantics, even if parse errors.
.. index:: -gnatQ (gcc)
-:samp:`-gnatQ`
+:switch:`-gnatQ`
Don't quit. Generate :file:`ALI` and tree files even if illegalities.
Note that code generation is still suppressed in the presence of any
- errors, so even with *-gnatQ* no object file is generated.
+ errors, so even with :switch:`-gnatQ` no object file is generated.
.. index:: -gnatr (gcc)
-:samp:`-gnatr`
+:switch:`-gnatr`
Treat pragma Restrictions as Restriction_Warnings.
.. index:: -gnatR (gcc)
-:samp:`-gnatR[0/1/2/3[s]]`
- Output representation information for declared types and objects.
- Note that this switch is not allowed if a previous `-gnatD` switch has
- been given, since these two switches are not compatible.
-
-
-:samp:`-gnatRm[s]`
- Output convention and parameter passing mechanisms for all subprograms.
+:switch:`-gnatR[0/1/2/3][e][m][s]`
+ Output representation information for declared types, objects and
+ subprograms. Note that this switch is not allowed if a previous
+ :switch:`-gnatD` switch has been given, since these two switches
+ are not compatible.
.. index:: -gnats (gcc)
-:samp:`-gnats`
+:switch:`-gnats`
Syntax check only.
.. index:: -gnatS (gcc)
-:samp:`-gnatS`
+:switch:`-gnatS`
Print package Standard.
.. index:: -gnatt (gcc)
-:samp:`-gnatt`
+:switch:`-gnatt`
Generate tree output file.
.. index:: -gnatT (gcc)
-:samp:`-gnatT{nnn}`
- All compiler tables start at `nnn` times usual starting size.
+:switch:`-gnatT{nnn}`
+ All compiler tables start at ``nnn`` times usual starting size.
.. index:: -gnatu (gcc)
-:samp:`-gnatu`
+:switch:`-gnatu`
List units for this compilation.
.. index:: -gnatU (gcc)
-:samp:`-gnatU`
+:switch:`-gnatU`
Tag all error messages with the unique string 'error:'
.. index:: -gnatv (gcc)
-:samp:`-gnatv`
+:switch:`-gnatv`
Verbose mode. Full error output with source lines to :file:`stdout`.
.. index:: -gnatV (gcc)
-:samp:`-gnatV`
+:switch:`-gnatV`
Control level of validity checking (:ref:`Validity_Checking`).
.. index:: -gnatw (gcc)
-:samp:`-gnatw{xxx}`
+:switch:`-gnatw{xxx}`
Warning mode where
- `xxx` is a string of option letters that denotes
+ ``xxx`` is a string of option letters that denotes
the exact warnings that
are enabled or disabled (:ref:`Warning_Message_Control`).
.. index:: -gnatW (gcc)
-:samp:`-gnatW{e}`
+:switch:`-gnatW{e}`
Wide character encoding method
- (`e`\ =n/h/u/s/e/8).
+ (``e``\ =n/h/u/s/e/8).
.. index:: -gnatx (gcc)
-:samp:`-gnatx`
+:switch:`-gnatx`
Suppress generation of cross-reference information.
.. index:: -gnatX (gcc)
-:samp:`-gnatX`
+:switch:`-gnatX`
Enable GNAT implementation extensions and latest Ada version.
.. index:: -gnaty (gcc)
-:samp:`-gnaty`
+:switch:`-gnaty`
Enable built-in style checks (:ref:`Style_Checking`).
.. index:: -gnatz (gcc)
-:samp:`-gnatz{m}`
+:switch:`-gnatz{m}`
Distribution stub generation and compilation
- (`m`\ =r/c for receiver/caller stubs).
+ (``m``\ =r/c for receiver/caller stubs).
.. index:: -I (gcc)
-:samp:`-I{dir}`
+:switch:`-I{dir}`
.. index:: RTL
- Direct GNAT to search the `dir` directory for source files needed by
+ Direct GNAT to search the ``dir`` directory for source files needed by
the current compilation
(see :ref:`Search_Paths_and_the_Run-Time_Library_RTL`).
.. index:: -I- (gcc)
-:samp:`-I-`
+:switch:`-I-`
.. index:: RTL
Except for the source file named in the command line, do not look for source
@@ -2150,8 +2150,8 @@ Alphabetical List of All Switches
.. index:: -o (gcc)
-:samp:`-o {file}`
- This switch is used in *gcc* to redirect the generated object file
+:switch:`-o {file}`
+ This switch is used in ``gcc`` to redirect the generated object file
and its associated ALI file. Beware of this switch with GNAT, because it may
cause the object file and ALI file to have different names which in turn
may confuse the binder and the linker.
@@ -2159,33 +2159,33 @@ Alphabetical List of All Switches
.. index:: -nostdinc (gcc)
-:samp:`-nostdinc`
+:switch:`-nostdinc`
Inhibit the search of the default location for the GNAT Run Time
Library (RTL) source files.
.. index:: -nostdlib (gcc)
-:samp:`-nostdlib`
+:switch:`-nostdlib`
Inhibit the search of the default location for the GNAT Run Time
Library (RTL) ALI files.
.. index:: -O (gcc)
-:samp:`-O[{n}]`
- `n` controls the optimization level:
+:switch:`-O[{n}]`
+ ``n`` controls the optimization level:
======= ==================================================================
*n* Effect
------- ------------------------------------------------------------------
- *0* No optimization, the default setting if no *-O* appears
- *1* Normal optimization, the default if you specify *-O* without an
+ *0* No optimization, the default setting if no :switch:`-O` appears
+ *1* Normal optimization, the default if you specify :switch:`-O` without an
operand. A good compromise between code quality and compilation
time.
*2* Extensive optimization, may improve execution time, possibly at
the cost of substantially increased compilation time.
- *3* Same as *-O2*, and also includes inline expansion for small
+ *3* Same as :switch:`-O2`, and also includes inline expansion for small
subprograms in the same unit.
*s* Optimize space usage
======= ==================================================================
@@ -2195,22 +2195,22 @@ Alphabetical List of All Switches
.. index:: -pass-exit-codes (gcc)
-:samp:`-pass-exit-codes`
+:switch:`-pass-exit-codes`
Catch exit codes from the compiler and use the most meaningful as
exit status.
.. index:: --RTS (gcc)
-:samp:`--RTS={rts-path}`
+:switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`).
.. index:: -S (gcc)
-:samp:`-S`
- Used in place of *-c* to
+:switch:`-S`
+ Used in place of :switch:`-c` to
cause the assembler source file to be
generated, using :file:`.s` as the extension,
instead of the object file.
@@ -2219,33 +2219,33 @@ Alphabetical List of All Switches
.. index:: -fverbose-asm (gcc)
-:samp:`-fverbose-asm`
- Used in conjunction with *-S*
+:switch:`-fverbose-asm`
+ Used in conjunction with :switch:`-S`
to cause the generated assembly code file to be annotated with variable
names, making it significantly easier to follow.
.. index:: -v (gcc)
-:samp:`-v`
- Show commands generated by the *gcc* driver. Normally used only for
+:switch:`-v`
+ Show commands generated by the ``gcc`` driver. Normally used only for
debugging purposes or if you need to be sure what version of the
compiler you are executing.
.. index:: -V (gcc)
-:samp:`-V {ver}`
- Execute `ver` version of the compiler. This is the *gcc*
+:switch:`-V {ver}`
+ Execute ``ver`` version of the compiler. This is the ``gcc``
version, not the GNAT version.
.. index:: -w (gcc)
-:samp:`-w`
+:switch:`-w`
Turn off warnings generated by the back end of the compiler. Use of
this switch also causes the default for front end warnings to be set
- to suppress (as though *-gnatws* had appeared at the start of
+ to suppress (as though :switch:`-gnatws` had appeared at the start of
the options).
@@ -2267,31 +2267,31 @@ is equivalent to specifying the following sequence of switches:
The following restrictions apply to the combination of switches
in this manner:
-* The switch *-gnatc* if combined with other switches must come
+* The switch :switch:`-gnatc` if combined with other switches must come
first in the string.
-* The switch *-gnats* if combined with other switches must come
+* The switch :switch:`-gnats` if combined with other switches must come
first in the string.
* The switches
- *-gnatzc* and *-gnatzr* may not be combined with any other
+ :switch:`-gnatzc` and :switch:`-gnatzr` may not be combined with any other
switches, and only one of them may appear in the command line.
-* The switch *-gnat-p* may not be combined with any other switch.
+* The switch :switch:`-gnat-p` may not be combined with any other switch.
-* Once a 'y' appears in the string (that is a use of the *-gnaty*
+* Once a 'y' appears in the string (that is a use of the :switch:`-gnaty`
switch), then all further characters in the switch are interpreted
- as style modifiers (see description of *-gnaty*).
+ as style modifiers (see description of :switch:`-gnaty`).
-* Once a 'd' appears in the string (that is a use of the *-gnatd*
+* Once a 'd' appears in the string (that is a use of the :switch:`-gnatd`
switch), then all further characters in the switch are interpreted
- as debug flags (see description of *-gnatd*).
+ as debug flags (see description of :switch:`-gnatd`).
-* Once a 'w' appears in the string (that is a use of the *-gnatw*
+* Once a 'w' appears in the string (that is a use of the :switch:`-gnatw`
switch), then all further characters in the switch are interpreted
- as warning mode modifiers (see description of *-gnatw*).
+ as warning mode modifiers (see description of :switch:`-gnatw`).
-* Once a 'V' appears in the string (that is a use of the *-gnatV*
+* Once a 'V' appears in the string (that is a use of the :switch:`-gnatV`
switch), then all further characters in the switch are interpreted
as validity checking options (:ref:`Validity_Checking`).
@@ -2316,7 +2316,7 @@ file) and have the following form:
The first integer after the file name is the line number in the file,
and the second integer is the column number within the line.
-`GPS` can parse the error messages
+``GPS`` can parse the error messages
and point to the referenced character.
The following switches provide control over the error message
format:
@@ -2324,12 +2324,12 @@ format:
.. index:: -gnatv (gcc)
-:samp:`-gnatv`
- The `v` stands for verbose.
+:switch:`-gnatv`
+ The ``v`` stands for verbose.
The effect of this setting is to write long-format error
messages to :file:`stdout` (the standard output file.
The same program compiled with the
- *-gnatv* switch would generate:
+ :switch:`-gnatv` switch would generate:
::
@@ -2341,15 +2341,15 @@ format:
>>> ";" should be "is"
- The vertical bar indicates the location of the error, and the :samp:`>>>`
+ The vertical bar indicates the location of the error, and the ``>>>``
prefix can be used to search for error messages. When this switch is
used the only source lines output are those with errors.
.. index:: -gnatl (gcc)
-:samp:`-gnatl`
- The `l` stands for list.
+:switch:`-gnatl`
+ The ``l`` stands for list.
This switch causes a full listing of
the file to be generated. In the case where a body is
compiled, the corresponding spec is also listed, along
@@ -2392,7 +2392,7 @@ format:
5. end;
- When you specify the *-gnatv* or *-gnatl* switches and
+ When you specify the :switch:`-gnatv` or :switch:`-gnatl` switches and
standard output is redirected, a brief summary is written to
:file:`stderr` (standard error) giving the number of error messages and
warning messages generated.
@@ -2400,19 +2400,19 @@ format:
.. index:: -gnatl=fname (gcc)
-:samp:`-gnatl={fname}`
- This has the same effect as *-gnatl* except that the output is
+:switch:`-gnatl={fname}`
+ This has the same effect as :switch:`-gnatl` except that the output is
written to a file instead of to standard output. If the given name
:file:`fname` does not start with a period, then it is the full name
of the file to be written. If :file:`fname` is an extension, it is
appended to the name of the file being compiled. For example, if
- file :file:`xyz.adb` is compiled with *-gnatl=.lst*,
+ file :file:`xyz.adb` is compiled with :switch:`-gnatl=.lst`,
then the output is written to file xyz.adb.lst.
.. index:: -gnatU (gcc)
-:samp:`-gnatU`
+:switch:`-gnatU`
This switch forces all error messages to be preceded by the unique
string 'error:'. This means that error messages take a few more
characters in space, but allows easy searching for and identification
@@ -2421,8 +2421,8 @@ format:
.. index:: -gnatb (gcc)
-:samp:`-gnatb`
- The `b` stands for brief.
+:switch:`-gnatb`
+ The ``b`` stands for brief.
This switch causes GNAT to generate the
brief format error messages to :file:`stderr` (the standard error
file) as well as the verbose
@@ -2432,12 +2432,12 @@ format:
.. index:: -gnatm (gcc)
-:samp:`-gnatm={n}`
- The `m` stands for maximum.
- `n` is a decimal integer in the
+:switch:`-gnatm={n}`
+ The ``m`` stands for maximum.
+ ``n`` is a decimal integer in the
range of 1 to 999999 and limits the number of error or warning
messages to be generated. For example, using
- *-gnatm2* might yield
+ :switch:`-gnatm2` might yield
::
@@ -2455,15 +2455,15 @@ format:
is abandoned. A value of zero means that no limit applies.
Note that the equal sign is optional, so the switches
- *-gnatm2* and *-gnatm=2* are equivalent.
+ :switch:`-gnatm2` and :switch:`-gnatm=2` are equivalent.
.. index:: -gnatf (gcc)
-:samp:`-gnatf`
+:switch:`-gnatf`
.. index:: Error messages, suppressing
- The `f` stands for full.
+ The ``f`` stands for full.
Normally, the compiler suppresses error messages that are likely to be
redundant. This switch causes all error
messages to be generated. In particular, in the case of
@@ -2475,8 +2475,8 @@ format:
e.adb:7:07: "V" is undefined (more references follow)
where the parenthetical comment warns that there are additional
- references to the variable `V`. Compiling the same program with the
- *-gnatf* switch yields
+ references to the variable ``V``. Compiling the same program with the
+ :switch:`-gnatf` switch yields
::
@@ -2487,7 +2487,7 @@ format:
e.adb:9:07: "V" is undefined
e.adb:9:12: "V" is undefined
- The *-gnatf* switch also generates additional information for
+ The :switch:`-gnatf` switch also generates additional information for
some error messages. Some examples are:
* Details on possibly non-portable unchecked conversion
@@ -2499,13 +2499,13 @@ format:
.. index:: -gnatjnn (gcc)
-:samp:`-gnatjnn`
- In normal operation mode (or if *-gnatj0* is used), then error messages
+:switch:`-gnatjnn`
+ In normal operation mode (or if :switch:`-gnatj0` is used), then error messages
with continuation lines are treated as though the continuation lines were
separate messages (and so a warning with two continuation lines counts as
three warnings, and is listed as three separate messages).
- If the *-gnatjnn* switch is used with a positive value for nn, then
+ If the :switch:`-gnatjnn` switch is used with a positive value for nn, then
messages are output in a different manner. A message and all its continuation
lines are treated as a unit, and count as only one warning or message in the
statistics totals. Furthermore, the message is reformatted so that no line
@@ -2514,8 +2514,8 @@ format:
.. index:: -gnatq (gcc)
-:samp:`-gnatq`
- The `q` stands for quit (really 'don't quit').
+:switch:`-gnatq`
+ The ``q`` stands for quit (really 'don't quit').
In normal operation mode, the compiler first parses the program and
determines if there are any syntax errors. If there are, appropriate
error messages are generated and compilation is immediately terminated.
@@ -2528,31 +2528,31 @@ format:
.. index:: -gnatQ (gcc)
-:samp:`-gnatQ`
+:switch:`-gnatQ`
In normal operation mode, the :file:`ALI` file is not generated if any
- illegalities are detected in the program. The use of *-gnatQ* forces
+ illegalities are detected in the program. The use of :switch:`-gnatQ` forces
generation of the :file:`ALI` file. This file is marked as being in
error, so it cannot be used for binding purposes, but it does contain
reasonably complete cross-reference information, and thus may be useful
for use by tools (e.g., semantic browsing tools or integrated development
environments) that are driven from the :file:`ALI` file. This switch
- implies *-gnatq*, since the semantic phase must be run to get a
+ implies :switch:`-gnatq`, since the semantic phase must be run to get a
meaningful ALI file.
- In addition, if *-gnatt* is also specified, then the tree file is
+ In addition, if :switch:`-gnatt` is also specified, then the tree file is
generated even if there are illegalities. It may be useful in this case
- to also specify *-gnatq* to ensure that full semantic processing
+ to also specify :switch:`-gnatq` to ensure that full semantic processing
occurs. The resulting tree file can be processed by ASIS, for the purpose
of providing partial information about illegal units, but if the error
causes the tree to be badly malformed, then ASIS may crash during the
analysis.
- When *-gnatQ* is used and the generated :file:`ALI` file is marked as
- being in error, *gnatmake* will attempt to recompile the source when it
- finds such an :file:`ALI` file, including with switch *-gnatc*.
+ When :switch:`-gnatQ` is used and the generated :file:`ALI` file is marked as
+ being in error, ``gnatmake`` will attempt to recompile the source when it
+ finds such an :file:`ALI` file, including with switch :switch:`-gnatc`.
- Note that *-gnatQ* has no effect if *-gnats* is specified,
- since ALI files are never generated if *-gnats* is set.
+ Note that :switch:`-gnatQ` has no effect if :switch:`-gnats` is specified,
+ since ALI files are never generated if :switch:`-gnats` is set.
.. _Warning_Message_Control:
@@ -2583,7 +2583,7 @@ GNAT considers a large number of situations as appropriate
for the generation of warning messages. As always, warnings are not
definite indications of errors. For example, if you do an out-of-range
assignment with the deliberate intention of raising a
-`Constraint_Error` exception, then the warning that may be
+``Constraint_Error`` exception, then the warning that may be
issued does not indicate an error. Some of the situations for which GNAT
issues warnings (at least some of the time) are given in the following
list. This list is not complete, and new warnings are often added to
@@ -2613,15 +2613,15 @@ of the kinds of warnings that are generated.
* Variables that are referenced before being initialized
-* Task entries with no corresponding `accept` statement
+* Task entries with no corresponding ``accept`` statement
-* Duplicate accepts for the same task entry in a `select`
+* Duplicate accepts for the same task entry in a ``select``
* Objects that take too much storage
* Unchecked conversion between types of differing sizes
-* Missing `return` statement along some execution path in a function
+* Missing ``return`` statement along some execution path in a function
* Incorrect (unrecognized) pragmas
@@ -2649,9 +2649,9 @@ of the kinds of warnings that are generated.
* Unused |with| clauses
-* `Bit_Order` usage that does not have any effect
+* ``Bit_Order`` usage that does not have any effect
-* `Standard.Duration` used to resolve universal fixed expression
+* ``Standard.Duration`` used to resolve universal fixed expression
* Dereference of possibly null value
@@ -2663,7 +2663,7 @@ of the kinds of warnings that are generated.
* Unreferenced or unmodified variables. Note that a special
exemption applies to variables which contain any of the substrings
- `DISCARD, DUMMY, IGNORE, JUNK, UNUSED`, in any casing. Such variables
+ ``DISCARD, DUMMY, IGNORE, JUNK, UNUSED``, in any casing. Such variables
are considered likely to be intentionally used in a situation where
otherwise a warning would be given, so warnings of this kind are
always suppressed for such variables.
@@ -2684,7 +2684,7 @@ of the kinds of warnings that are generated.
* Access before elaboration detected at compile time
-* A range in a `for` loop that is known to be null or might be null
+* A range in a ``for`` loop that is known to be null or might be null
The following section lists compiler switches that are available
@@ -2696,7 +2696,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwa (gcc)
-:samp:`-gnatwa`
+:switch:`-gnatwa`
*Activate most optional warnings.*
This switch activates most optional warning messages. See the remaining list
@@ -2705,61 +2705,63 @@ of the pragma in the :title:`GNAT_Reference_manual`).
switch are:
- * :samp:`-gnatwd` (implicit dereferencing)
+ * :switch:`-gnatwd` (implicit dereferencing)
+
+ * :switch:`-gnatw.d` (tag warnings with -gnatw switch)
- * :samp:`-gnatw.d` (tag warnings with -gnatw switch)
+ * :switch:`-gnatwh` (hiding)
- * :samp:`-gnatwh` (hiding)
+ * :switch:`-gnatw.h` (holes in record layouts)
- * :samp:`-gnatw.h` (holes in record layouts)
+ * :switch:`-gnatw.j` (late primitives of tagged types)
- * :samp:`-gnatw.j` (late primitives of tagged types)
+ * :switch:`-gnatw.k` (redefinition of names in standard)
- * :samp:`-gnatw.k` (redefinition of names in standard)
+ * :switch:`-gnatwl` (elaboration warnings)
- * :samp:`-gnatwl` (elaboration warnings)
+ * :switch:`-gnatw.l` (inherited aspects)
- * :samp:`-gnatw.l` (inherited aspects)
+ * :switch:`-gnatw.n` (atomic synchronization)
- * :samp:`-gnatw.n` (atomic synchronization)
+ * :switch:`-gnatwo` (address clause overlay)
- * :samp:`-gnatwo` (address clause overlay)
+ * :switch:`-gnatw.o` (values set by out parameters ignored)
- * :samp:`-gnatw.o` (values set by out parameters ignored)
+ * :switch:`-gnatw.q` (questionable layout of record types)
- * :samp:`-gnatw.s` (overridden size clause)
+ * :switch:`-gnatw.s` (overridden size clause)
- * :samp:`-gnatwt` (tracking of deleted conditional code)
+ * :switch:`-gnatwt` (tracking of deleted conditional code)
- * :samp:`-gnatw.u` (unordered enumeration)
+ * :switch:`-gnatw.u` (unordered enumeration)
- * :samp:`-gnatw.w` (use of Warnings Off)
+ * :switch:`-gnatw.w` (use of Warnings Off)
- * :samp:`-gnatw.y` (reasons for package needing body)
+ * :switch:`-gnatw.y` (reasons for package needing body)
All other optional warnings are turned on.
.. index:: -gnatwA (gcc)
-:samp:`-gnatwA`
+:switch:`-gnatwA`
*Suppress all optional errors.*
This switch suppresses all optional warning messages, see remaining list
in this section for details on optional warning messages that can be
- individually controlled. Note that unlike switch *-gnatws*, the
- use of switch *-gnatwA* does not suppress warnings that are
+ individually controlled. Note that unlike switch :switch:`-gnatws`, the
+ use of switch :switch:`-gnatwA` does not suppress warnings that are
normally given unconditionally and cannot be individually controlled
(for example, the warning about a missing exit path in a function).
- Also, again unlike switch *-gnatws*, warnings suppressed by
- the use of switch *-gnatwA* can be individually turned back
- on. For example the use of switch *-gnatwA* followed by
- switch *-gnatwd* will suppress all optional warnings except
+ Also, again unlike switch :switch:`-gnatws`, warnings suppressed by
+ the use of switch :switch:`-gnatwA` can be individually turned back
+ on. For example the use of switch :switch:`-gnatwA` followed by
+ switch :switch:`-gnatwd` will suppress all optional warnings except
the warnings for implicit dereferencing.
.. index:: -gnatw.a (gcc)
-:samp:`-gnatw.a`
+:switch:`-gnatw.a`
*Activate warnings on failing assertions.*
.. index:: Assert failures
@@ -2772,7 +2774,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.A (gcc)
-:samp:`-gnatw.A`
+:switch:`-gnatw.A`
*Suppress warnings on failing assertions.*
.. index:: Assert failures
@@ -2783,7 +2785,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwb (gcc)
-:samp:`-gnatwb`
+:switch:`-gnatwb`
*Activate warnings on bad fixed values.*
.. index:: Bad fixed values
@@ -2803,7 +2805,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwB (gcc)
-:samp:`-gnatwB`
+:switch:`-gnatwB`
*Suppress warnings on bad fixed values.*
This switch suppresses warnings for static fixed-point expressions whose
@@ -2812,7 +2814,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.b (gcc)
-:samp:`-gnatw.b`
+:switch:`-gnatw.b`
*Activate warnings on biased representation.*
.. index:: Biased representation
@@ -2825,7 +2827,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwB (gcc)
-:samp:`-gnatw.B`
+:switch:`-gnatw.B`
*Suppress warnings on biased representation.*
This switch suppresses warnings for representation clauses that force the use
@@ -2834,7 +2836,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwc (gcc)
-:samp:`-gnatwc`
+:switch:`-gnatwc`
*Activate warnings on conditionals.*
.. index:: Conditionals, constant
@@ -2853,7 +2855,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
If the compiler can tell that only the equality condition is possible,
then it will warn that the '>' or '<' part of the test
is useless and that the operator could be replaced by '='.
- An example would be comparing a `Natural` variable <= 0.
+ An example would be comparing a ``Natural`` variable <= 0.
This warning option also generates warnings if
one or both tests is optimized away in a membership test for integer
@@ -2861,12 +2863,12 @@ of the pragma in the :title:`GNAT_Reference_manual`).
enumeration types are not included, since it is common for such tests
to include an end point.
- This warning can also be turned on using *-gnatwa*.
+ This warning can also be turned on using :switch:`-gnatwa`.
.. index:: -gnatwC (gcc)
-:samp:`-gnatwC`
+:switch:`-gnatwC`
*Suppress warnings on conditionals.*
This switch suppresses warnings for conditional expressions used in
@@ -2875,7 +2877,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.c (gcc)
-:samp:`-gnatw.c`
+:switch:`-gnatw.c`
*Activate warnings on missing component clauses.*
.. index:: Component clause, missing
@@ -2888,7 +2890,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwC (gcc)
-:samp:`-gnatw.C`
+:switch:`-gnatw.C`
*Suppress warnings on missing component clauses.*
This switch suppresses warnings for record components that are
@@ -2897,21 +2899,21 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwd (gcc)
-:samp:`-gnatwd`
+:switch:`-gnatwd`
*Activate warnings on implicit dereferencing.*
If this switch is set, then the use of a prefix of an access type
in an indexed component, slice, or selected component without an
- explicit `.all` will generate a warning. With this warning
+ explicit ``.all`` will generate a warning. With this warning
enabled, access checks occur only at points where an explicit
- `.all` appears in the source code (assuming no warnings are
+ ``.all`` appears in the source code (assuming no warnings are
generated as a result of this switch). The default is that such
warnings are not generated.
.. index:: -gnatwD (gcc)
-:samp:`-gnatwD`
+:switch:`-gnatwD`
*Suppress warnings on implicit dereferencing.*
.. index:: Implicit dereferencing
@@ -2924,30 +2926,30 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.d (gcc)
-:samp:`-gnatw.d`
+:switch:`-gnatw.d`
*Activate tagging of warning and info messages.*
If this switch is set, then warning messages are tagged, with one of the
following strings:
- *[-gnatw?]*
- Used to tag warnings controlled by the switch *-gnatwx* where x
+ Used to tag warnings controlled by the switch :switch:`-gnatwx` where x
is a letter a-z.
- *[-gnatw.?]*
- Used to tag warnings controlled by the switch *-gnatw.x* where x
+ Used to tag warnings controlled by the switch :switch:`-gnatw.x` where x
is a letter a-z.
- *[-gnatel]*
Used to tag elaboration information (info) messages generated when the
- static model of elaboration is used and the *-gnatel* switch is set.
+ static model of elaboration is used and the :switch:`-gnatel` switch is set.
- *[restriction warning]*
Used to tag warning messages for restriction violations, activated by use
- of the pragma *Restriction_Warnings*.
+ of the pragma ``Restriction_Warnings``.
- *[warning-as-error]*
@@ -2959,24 +2961,24 @@ of the pragma in the :title:`GNAT_Reference_manual`).
- *[enabled by default]*
Used to tag all other warnings that are always given by default, unless
warnings are completely suppressed using pragma *Warnings(Off)* or
- the switch *-gnatws*.
+ the switch :switch:`-gnatws`.
.. index:: -gnatw.d (gcc)
-:samp:`-gnatw.D`
+:switch:`-gnatw.D`
*Deactivate tagging of warning and info messages messages.*
If this switch is set, then warning messages return to the default
mode in which warnings and info messages are not tagged as described above for
- `-gnatw.d`.
+ :switch:`-gnatw.d`.
.. index:: -gnatwe (gcc)
.. index:: Warnings, treat as error
-:samp:`-gnatwe`
+:switch:`-gnatwe`
*Treat warnings and style checks as errors.*
This switch causes warning messages and style check messages to be
@@ -2990,48 +2992,58 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.e (gcc)
-:samp:`-gnatw.e`
+:switch:`-gnatw.e`
*Activate every optional warning.*
.. index:: Warnings, activate every optional warning
This switch activates all optional warnings, including those which
- are not activated by `-gnatwa`. The use of this switch is not
+ are not activated by :switch:`-gnatwa`. The use of this switch is not
recommended for normal use. If you turn this switch on, it is almost
certain that you will get large numbers of useless warnings. The
- warnings that are excluded from `-gnatwa` are typically highly
+ warnings that are excluded from :switch:`-gnatwa` are typically highly
specialized warnings that are suitable for use only in code that has
been specifically designed according to specialized coding rules.
+.. index:: -gnatwE (gcc)
+.. index:: Warnings, treat as error
+
+:switch:`-gnatwE`
+ *Treat all run-time exception warnings as errors.*
+
+ This switch causes warning messages regarding errors that will be raised
+ during run-time execution to be treated as errors.
+
+
.. index:: -gnatwf (gcc)
-:samp:`-gnatwf`
+:switch:`-gnatwf`
*Activate warnings on unreferenced formals.*
.. index:: Formals, unreferenced
This switch causes a warning to be generated if a formal parameter
is not referenced in the body of the subprogram. This warning can
- also be turned on using *-gnatwu*. The
+ also be turned on using :switch:`-gnatwu`. The
default is that these warnings are not generated.
.. index:: -gnatwF (gcc)
-:samp:`-gnatwF`
+:switch:`-gnatwF`
*Suppress warnings on unreferenced formals.*
This switch suppresses warnings for unreferenced formal
parameters. Note that the
- combination *-gnatwu* followed by *-gnatwF* has the
+ combination :switch:`-gnatwu` followed by :switch:`-gnatwF` has the
effect of warning on unreferenced entities other than subprogram
formals.
.. index:: -gnatwg (gcc)
-:samp:`-gnatwg`
+:switch:`-gnatwg`
*Activate warnings on unrecognized pragmas.*
.. index:: Pragmas, unrecognized
@@ -3045,7 +3057,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwG (gcc)
-:samp:`-gnatwG`
+:switch:`-gnatwG`
*Suppress warnings on unrecognized pragmas.*
This switch suppresses warnings for unrecognized pragmas.
@@ -3053,18 +3065,18 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.g (gcc)
-:samp:`-gnatw.g`
+:switch:`-gnatw.g`
*Warnings used for GNAT sources.*
This switch sets the warning categories that are used by the standard
GNAT style. Currently this is equivalent to
- *-gnatwAao.sI.C.V.X*
+ :switch:`-gnatwAao.q.s.CI.V.X.Z`
but more warnings may be added in the future without advanced notice.
.. index:: -gnatwh (gcc)
-:samp:`-gnatwh`
+:switch:`-gnatwh`
*Activate warnings on hiding.*
.. index:: Hiding of Declarations
@@ -3077,7 +3089,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwH (gcc)
-:samp:`-gnatwH`
+:switch:`-gnatwH`
*Suppress warnings on hiding.*
This switch suppresses warnings on hiding declarations.
@@ -3085,7 +3097,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.h (gcc)
-:samp:`-gnatw.h`
+:switch:`-gnatw.h`
*Activate warnings on holes/gaps in records.*
.. index:: Record Representation (gaps)
@@ -3098,7 +3110,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.H (gcc)
-:samp:`-gnatw.H`
+:switch:`-gnatw.H`
*Suppress warnings on holes/gaps in records.*
This switch suppresses warnings on component clauses in record
@@ -3107,13 +3119,13 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwi (gcc)
-:samp:`-gnatwi`
+:switch:`-gnatwi`
*Activate warnings on implementation units.*
This switch activates warnings for a |with| of an internal GNAT
- implementation unit, defined as any unit from the `Ada`,
- `Interfaces`, `GNAT`,
- or `System`
+ implementation unit, defined as any unit from the ``Ada``,
+ ``Interfaces``, ``GNAT``,
+ or ``System``
hierarchies that is not
documented in either the Ada Reference Manual or the GNAT
Programmer's Reference Manual. Such units are intended only
@@ -3123,7 +3135,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwI (gcc)
-:samp:`-gnatwI`
+:switch:`-gnatwI`
*Disable warnings on implementation units.*
This switch disables warnings for a |with| of an internal GNAT
@@ -3132,7 +3144,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.i (gcc)
-:samp:`-gnatw.i`
+:switch:`-gnatw.i`
*Activate warnings on overlapping actuals.*
This switch enables a warning on statically detectable overlapping actuals in
@@ -3142,7 +3154,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.I (gcc)
-:samp:`-gnatw.I`
+:switch:`-gnatw.I`
*Disable warnings on overlapping actuals.*
This switch disables warnings on overlapping actuals in a call..
@@ -3150,7 +3162,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwj (gcc)
-:samp:`-gnatwj`
+:switch:`-gnatwj`
*Activate warnings on obsolescent features (Annex J).*
.. index:: Features, obsolescent
@@ -3158,31 +3170,31 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: Obsolescent features
If this warning option is activated, then warnings are generated for
- calls to subprograms marked with `pragma Obsolescent` and
+ calls to subprograms marked with ``pragma Obsolescent`` and
for use of features in Annex J of the Ada Reference Manual. In the
case of Annex J, not all features are flagged. In particular use
- of the renamed packages (like `Text_IO`) and use of package
- `ASCII` are not flagged, since these are very common and
+ of the renamed packages (like ``Text_IO``) and use of package
+ ``ASCII`` are not flagged, since these are very common and
would generate many annoying positive warnings. The default is that
such warnings are not generated.
In addition to the above cases, warnings are also generated for
GNAT features that have been provided in past versions but which
have been superseded (typically by features in the new Ada standard).
- For example, `pragma Ravenscar` will be flagged since its
- function is replaced by `pragma Profile(Ravenscar)`, and
- `pragma Interface_Name` will be flagged since its function
- is replaced by `pragma Import`.
+ For example, ``pragma Ravenscar`` will be flagged since its
+ function is replaced by ``pragma Profile(Ravenscar)``, and
+ ``pragma Interface_Name`` will be flagged since its function
+ is replaced by ``pragma Import``.
Note that this warning option functions differently from the
- restriction `No_Obsolescent_Features` in two respects.
+ restriction ``No_Obsolescent_Features`` in two respects.
First, the restriction applies only to annex J features.
- Second, the restriction does flag uses of package `ASCII`.
+ Second, the restriction does flag uses of package ``ASCII``.
.. index:: -gnatwJ (gcc)
-:samp:`-gnatwJ`
+:switch:`-gnatwJ`
*Suppress warnings on obsolescent features (Annex J).*
This switch disables warnings on use of obsolescent features.
@@ -3190,7 +3202,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.j (gcc)
-:samp:`-gnatw.j`
+:switch:`-gnatw.j`
*Activate warnings on late declarations of tagged type primitives.*
This switch activates warnings on visible primitives added to a
@@ -3199,7 +3211,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.J (gcc)
-:samp:`-gnatw.J`
+:switch:`-gnatw.J`
*Suppress warnings on late declarations of tagged type primitives.*
This switch suppresses warnings on visible primitives added to a
@@ -3208,7 +3220,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwk (gcc)
-:samp:`-gnatwk`
+:switch:`-gnatwk`
*Activate warnings on variables that could be constants.*
This switch activates warnings for variables that are initialized but
@@ -3218,7 +3230,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwK (gcc)
-:samp:`-gnatwK`
+:switch:`-gnatwK`
*Suppress warnings on variables that could be constants.*
This switch disables warnings on variables that could be declared constants.
@@ -3226,7 +3238,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.k (gcc)
-:samp:`-gnatw.k`
+:switch:`-gnatw.k`
*Activate warnings on redefinition of names in standard.*
This switch activates warnings for declarations that declare a name that
@@ -3239,7 +3251,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwK (gcc)
-:samp:`-gnatw.K`
+:switch:`-gnatw.K`
*Suppress warnings on redefinition of names in standard.*
This switch activates warnings for declarations that declare a name that
@@ -3248,15 +3260,15 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwl (gcc)
-:samp:`-gnatwl`
+:switch:`-gnatwl`
*Activate warnings for elaboration pragmas.*
.. index:: Elaboration, warnings
This switch activates warnings for possible elaboration problems,
including suspicious use
- of `Elaborate` pragmas, when using the static elaboration model, and
- possible situations that may raise `Program_Error` when using the
+ of ``Elaborate`` pragmas, when using the static elaboration model, and
+ possible situations that may raise ``Program_Error`` when using the
dynamic elaboration model.
See the section in this guide on elaboration checking for further details.
The default is that such warnings
@@ -3265,7 +3277,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwL (gcc)
-:samp:`-gnatwL`
+:switch:`-gnatwL`
*Suppress warnings for elaboration pragmas.*
This switch suppresses warnings for possible elaboration problems.
@@ -3273,7 +3285,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.l (gcc)
-:samp:`-gnatw.l`
+:switch:`-gnatw.l`
*List inherited aspects.*
This switch causes the compiler to list inherited invariants,
@@ -3283,7 +3295,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.L (gcc)
-:samp:`-gnatw.L`
+:switch:`-gnatw.L`
*Suppress listing of inherited aspects.*
This switch suppresses listing of inherited aspects.
@@ -3291,7 +3303,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwm (gcc)
-:samp:`-gnatwm`
+:switch:`-gnatwm`
*Activate warnings on modified but unreferenced variables.*
This switch activates warnings for variables that are assigned (using
@@ -3304,7 +3316,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwM (gcc)
-:samp:`-gnatwM`
+:switch:`-gnatwM`
*Disable warnings on modified but unreferenced variables.*
This switch disables warnings for variables that are assigned or
@@ -3313,7 +3325,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.m (gcc)
-:samp:`-gnatw.m`
+:switch:`-gnatw.m`
*Activate warnings on suspicious modulus values.*
This switch activates warnings for modulus values that seem suspicious.
@@ -3327,7 +3339,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.M (gcc)
-:samp:`-gnatw.M`
+:switch:`-gnatw.M`
*Disable warnings on suspicious modulus values.*
This switch disables warnings for suspicious modulus values.
@@ -3335,22 +3347,22 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwn (gcc)
-:samp:`-gnatwn`
+:switch:`-gnatwn`
*Set normal warnings mode.*
This switch sets normal warning mode, in which enabled warnings are
issued and treated as warnings rather than errors. This is the default
- mode. the switch *-gnatwn* can be used to cancel the effect of
- an explicit *-gnatws* or
- *-gnatwe*. It also cancels the effect of the
- implicit *-gnatwe* that is activated by the
- use of *-gnatg*.
+ mode. the switch :switch:`-gnatwn` can be used to cancel the effect of
+ an explicit :switch:`-gnatws` or
+ :switch:`-gnatwe`. It also cancels the effect of the
+ implicit :switch:`-gnatwe` that is activated by the
+ use of :switch:`-gnatg`.
.. index:: -gnatw.n (gcc)
.. index:: Atomic Synchronization, warnings
-:samp:`-gnatw.n`
+:switch:`-gnatw.n`
*Activate warnings on atomic synchronization.*
This switch actives warnings when an access to an atomic variable
@@ -3359,7 +3371,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.N (gcc)
-:samp:`-gnatw.N`
+:switch:`-gnatw.N`
*Suppress warnings on atomic synchronization.*
.. index:: Atomic Synchronization, warnings
@@ -3371,7 +3383,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwo (gcc)
.. index:: Address Clauses, warnings
-:samp:`-gnatwo`
+:switch:`-gnatwo`
*Activate warnings on address clause overlays.*
This switch activates warnings for possibly unintended initialization
@@ -3381,7 +3393,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwO (gcc)
-:samp:`-gnatwO`
+:switch:`-gnatwO`
*Suppress warnings on address clause overlays.*
This switch suppresses warnings on possibly unintended initialization
@@ -3391,7 +3403,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.o (gcc)
-:samp:`-gnatw.o`
+:switch:`-gnatw.o`
*Activate warnings on modified but unreferenced out parameters.*
This switch activates warnings for variables that are modified by using
@@ -3407,7 +3419,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.O (gcc)
-:samp:`-gnatw.O`
+:switch:`-gnatw.O`
*Disable warnings on modified but unreferenced out parameters.*
This switch suppresses warnings for variables that are modified by using
@@ -3418,11 +3430,11 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwp (gcc)
.. index:: Inlining, warnings
-:samp:`-gnatwp`
+:switch:`-gnatwp`
*Activate warnings on ineffective pragma Inlines.*
This switch activates warnings for failure of front end inlining
- (activated by *-gnatN*) to inline a particular call. There are
+ (activated by :switch:`-gnatN`) to inline a particular call. There are
many reasons for not being able to inline a call, including most
commonly that the call is too complex to inline. The default is
that such warnings are not given.
@@ -3432,7 +3444,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwP (gcc)
-:samp:`-gnatwP`
+:switch:`-gnatwP`
*Suppress warnings on ineffective pragma Inlines.*
This switch suppresses warnings on ineffective pragma Inlines. If the
@@ -3443,7 +3455,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.p (gcc)
.. index:: Parameter order, warnings
-:samp:`-gnatw.p`
+:switch:`-gnatw.p`
*Activate warnings on parameter ordering.*
This switch activates warnings for cases of suspicious parameter
@@ -3457,7 +3469,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.P (gcc)
-:samp:`-gnatw.P`
+:switch:`-gnatw.P`
*Suppress warnings on parameter ordering.*
This switch suppresses warnings on cases of suspicious parameter
@@ -3467,7 +3479,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwq (gcc)
.. index:: Parentheses, warnings
-:samp:`-gnatwq`
+:switch:`-gnatwq`
*Activate warnings on questionable missing parentheses.*
This switch activates warnings for cases where parentheses are not used and
@@ -3482,16 +3494,66 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwQ (gcc)
-:samp:`-gnatwQ`
+:switch:`-gnatwQ`
*Suppress warnings on questionable missing parentheses.*
This switch suppresses warnings for cases where the association is not
clear and the use of parentheses is preferred.
+.. index:: -gnatw.q (gcc)
+.. index:: Layout, warnings
+
+:switch:`-gnatw.q`
+ *Activate warnings on questionable layout of record types.*
+
+ This switch activates warnings for cases where the default layout of
+ a record type, that is to say the layout of its components in textual
+ order of the source code, would very likely cause inefficiencies in
+ the code generated by the compiler, both in terms of space and speed
+ during execution. One warning is issued for each problematic component
+ without representation clause in the nonvariant part and then in each
+ variant recursively, if any.
+
+ The purpose of these warnings is neither to prescribe an optimal layout
+ nor to force the use of representation clauses, but rather to get rid of
+ the most blatant inefficiencies in the layout. Therefore, the default
+ layout is matched against the following synthetic ordered layout and
+ the deviations are flagged on a component-by-component basis:
+
+ * first all components or groups of components whose length is fixed
+ and a multiple of the storage unit,
+
+ * then the remaining components whose length is fixed and not a multiple
+ of the storage unit,
+
+ * then the remaining components whose length doesn't depend on discriminants
+ (that is to say, with variable but uniform length for all objects),
+
+ * then all components whose length depends on discriminants,
+
+ * finally the variant part (if any),
+
+ for the nonvariant part and for each variant recursively, if any.
+
+ The exact wording of the warning depends on whether the compiler is allowed
+ to reorder the components in the record type or precluded from doing it by
+ means of pragma ``No_Component_Reordering``.
+
+ The default is that these warnings are not given.
+
+.. index:: -gnatw.Q (gcc)
+
+:switch:`-gnatw.Q`
+ *Suppress warnings on questionable layout of record types.*
+
+ This switch suppresses warnings for cases where the default layout of
+ a record type would very likely cause inefficiencies.
+
+
.. index:: -gnatwr (gcc)
-:samp:`-gnatwr`
+:switch:`-gnatwr`
*Activate warnings on redundant constructs.*
This switch activates warnings for redundant constructs. The following
@@ -3501,10 +3563,10 @@ of the pragma in the :title:`GNAT_Reference_manual`).
* Type conversion that converts an expression to its own type.
- * Use of the attribute `Base` where `typ'Base` is the same
- as `typ`.
+ * Use of the attribute ``Base`` where ``typ'Base`` is the same
+ as ``typ``.
- * Use of pragma `Pack` when all components are placed by a record
+ * Use of pragma ``Pack`` when all components are placed by a record
representation clause.
* Exception handler containing only a reraise statement (raise with no
@@ -3513,14 +3575,15 @@ of the pragma in the :title:`GNAT_Reference_manual`).
* Use of the operator abs on an operand that is known at compile time
to be non-negative
- * Comparison of boolean expressions to an explicit True value.
+ * Comparison of an object or (unary or binary) operation of boolean type to
+ an explicit True value.
The default is that warnings for redundant constructs are not given.
.. index:: -gnatwR (gcc)
-:samp:`-gnatwR`
+:switch:`-gnatwR`
*Suppress warnings on redundant constructs.*
This switch suppresses warnings for redundant constructs.
@@ -3528,7 +3591,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.r (gcc)
-:samp:`-gnatw.r`
+:switch:`-gnatw.r`
*Activate warnings for object renaming function.*
This switch activates warnings for an object renaming that renames a
@@ -3539,7 +3602,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwT (gcc)
-:samp:`-gnatw.R`
+:switch:`-gnatw.R`
*Suppress warnings for object renaming function.*
This switch suppresses warnings for object renaming function.
@@ -3547,7 +3610,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatws (gcc)
-:samp:`-gnatws`
+:switch:`-gnatws`
*Suppress all warnings.*
This switch completely suppresses the
@@ -3555,19 +3618,19 @@ of the pragma in the :title:`GNAT_Reference_manual`).
both warnings that can be controlled by switches described in this
section, and those that are normally given unconditionally. The
effect of this suppress action can only be cancelled by a subsequent
- use of the switch *-gnatwn*.
+ use of the switch :switch:`-gnatwn`.
- Note that switch *-gnatws* does not suppress
- warnings from the *gcc* back end.
- To suppress these back end warnings as well, use the switch *-w*
- in addition to *-gnatws*. Also this switch has no effect on the
+ Note that switch :switch:`-gnatws` does not suppress
+ warnings from the ``gcc`` back end.
+ To suppress these back end warnings as well, use the switch :switch:`-w`
+ in addition to :switch:`-gnatws`. Also this switch has no effect on the
handling of style check messages.
.. index:: -gnatw.s (gcc)
.. index:: Record Representation (component sizes)
-:samp:`-gnatw.s`
+:switch:`-gnatw.s`
*Activate warnings on overridden size clauses.*
This switch activates warnings on component clauses in record
@@ -3580,7 +3643,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.S (gcc)
-:samp:`-gnatw.S`
+:switch:`-gnatw.S`
*Suppress warnings on overridden size clauses.*
This switch suppresses warnings on component clauses in record
@@ -3592,7 +3655,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: Deactivated code, warnings
.. index:: Deleted code, warnings
-:samp:`-gnatwt`
+:switch:`-gnatwt`
*Activate warnings for tracking of deleted conditional code.*
This switch activates warnings for tracking of code in conditionals (IF and
@@ -3603,7 +3666,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwT (gcc)
-:samp:`-gnatwT`
+:switch:`-gnatwT`
*Suppress warnings for tracking of deleted conditional code.*
This switch suppresses warnings for tracking of deleted conditional code.
@@ -3611,13 +3674,13 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.t (gcc)
-:samp:`-gnatw.t`
+:switch:`-gnatw.t`
*Activate warnings on suspicious contracts.*
This switch activates warnings on suspicious contracts. This includes
- warnings on suspicious postconditions (whether a pragma `Postcondition` or a
- `Post` aspect in Ada 2012) and suspicious contract cases (pragma or aspect
- `Contract_Cases`). A function postcondition or contract case is suspicious
+ warnings on suspicious postconditions (whether a pragma ``Postcondition`` or a
+ ``Post`` aspect in Ada 2012) and suspicious contract cases (pragma or aspect
+ ``Contract_Cases``). A function postcondition or contract case is suspicious
when no postcondition or contract case for this function mentions the result
of the function. A procedure postcondition or contract case is suspicious
when it only refers to the pre-state of the procedure, because in that case
@@ -3629,7 +3692,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.T (gcc)
-:samp:`-gnatw.T`
+:switch:`-gnatw.T`
*Suppress warnings on suspicious contracts.*
This switch suppresses warnings on suspicious contracts.
@@ -3637,7 +3700,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwu (gcc)
-:samp:`-gnatwu`
+:switch:`-gnatwu`
*Activate warnings on unused entities.*
This switch activates warnings to be generated for entities that
@@ -3645,8 +3708,8 @@ of the pragma in the :title:`GNAT_Reference_manual`).
and not
referenced. In the case of packages, a warning is also generated if
no entities in the package are referenced. This means that if a with'ed
- package is referenced but the only references are in `use`
- clauses or `renames`
+ package is referenced but the only references are in ``use``
+ clauses or ``renames``
declarations, a warning is still generated. A warning is also generated
for a generic package that is |withed| but never instantiated.
In the case where a package or subprogram body is compiled, and there
@@ -3656,38 +3719,38 @@ of the pragma in the :title:`GNAT_Reference_manual`).
|with| can be moved to the body. The default is that
such warnings are not generated.
This switch also activates warnings on unreferenced formals
- (it includes the effect of *-gnatwf*).
+ (it includes the effect of :switch:`-gnatwf`).
.. index:: -gnatwU (gcc)
-:samp:`-gnatwU`
+:switch:`-gnatwU`
*Suppress warnings on unused entities.*
This switch suppresses warnings for unused entities and packages.
It also turns off warnings on unreferenced formals (and thus includes
- the effect of *-gnatwF*).
+ the effect of :switch:`-gnatwF`).
.. index:: -gnatw.u (gcc)
-:samp:`-gnatw.u`
+:switch:`-gnatw.u`
*Activate warnings on unordered enumeration types.*
This switch causes enumeration types to be considered as conceptually
- unordered, unless an explicit pragma `Ordered` is given for the type.
+ unordered, unless an explicit pragma ``Ordered`` is given for the type.
The effect is to generate warnings in clients that use explicit comparisons
or subranges, since these constructs both treat objects of the type as
ordered. (A *client* is defined as a unit that is other than the unit in
which the type is declared, or its body or subunits.) Please refer to
- the description of pragma `Ordered` in the
+ the description of pragma ``Ordered`` in the
:title:`GNAT Reference Manual` for further details.
The default is that such warnings are not generated.
.. index:: -gnatw.U (gcc)
-:samp:`-gnatw.U`
+:switch:`-gnatw.U`
*Deactivate warnings on unordered enumeration types.*
This switch causes all enumeration types to be considered as ordered, so
@@ -3697,7 +3760,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwv (gcc)
.. index:: Unassigned variable warnings
-:samp:`-gnatwv`
+:switch:`-gnatwv`
*Activate warnings on unassigned variables.*
This switch activates warnings for access to variables which
@@ -3707,7 +3770,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwV (gcc)
-:samp:`-gnatwV`
+:switch:`-gnatwV`
*Suppress warnings on unassigned variables.*
This switch suppresses warnings for access to variables which
@@ -3728,7 +3791,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.v (gcc)
.. index:: bit order warnings
-:samp:`-gnatw.v`
+:switch:`-gnatw.v`
*Activate info messages for non-default bit order.*
This switch activates messages (labeled "info", they are not warnings,
@@ -3741,7 +3804,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.V (gcc)
-:samp:`-gnatw.V`
+:switch:`-gnatw.V`
*Suppress info messages for non-default bit order.*
This switch suppresses information messages for the effects of specifying
@@ -3751,7 +3814,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatww (gcc)
.. index:: String indexing warnings
-:samp:`-gnatww`
+:switch:`-gnatww`
*Activate warnings on wrong low bound assumption.*
This switch activates warnings for indexing an unconstrained string parameter
@@ -3762,7 +3825,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwW (gcc)
-:samp:`-gnatwW`
+:switch:`-gnatwW`
*Suppress warnings on wrong low bound assumption.*
This switch suppresses warnings for indexing an unconstrained string parameter
@@ -3780,13 +3843,13 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.w (gcc)
.. index:: Warnings Off control
-:samp:`-gnatw.w`
+:switch:`-gnatw.w`
*Activate warnings on Warnings Off pragmas.*
- This switch activates warnings for use of `pragma Warnings (Off, entity)`
+ This switch activates warnings for use of ``pragma Warnings (Off, entity)``
where either the pragma is entirely useless (because it suppresses no
- warnings), or it could be replaced by `pragma Unreferenced` or
- `pragma Unmodified`.
+ warnings), or it could be replaced by ``pragma Unreferenced`` or
+ ``pragma Unmodified``.
Also activates warnings for the case of
Warnings (Off, String), where either there is no matching
Warnings (On, String), or the Warnings (Off) did not suppress any warning.
@@ -3795,16 +3858,16 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.W (gcc)
-:samp:`-gnatw.W`
+:switch:`-gnatw.W`
*Suppress warnings on unnecessary Warnings Off pragmas.*
- This switch suppresses warnings for use of `pragma Warnings (Off, ...)`.
+ This switch suppresses warnings for use of ``pragma Warnings (Off, ...)``.
.. index:: -gnatwx (gcc)
.. index:: Export/Import pragma warnings
-:samp:`-gnatwx`
+:switch:`-gnatwx`
*Activate warnings on Export/Import pragmas.*
This switch activates warnings on Export/Import pragmas when
@@ -3818,7 +3881,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwX (gcc)
-:samp:`-gnatwX`
+:switch:`-gnatwX`
*Suppress warnings on Export/Import pragmas.*
This switch suppresses warnings on Export/Import pragmas.
@@ -3829,7 +3892,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwm (gcc)
-:samp:`-gnatw.x`
+:switch:`-gnatw.x`
*Activate warnings for No_Exception_Propagation mode.*
This switch activates warnings for exception usage when pragma Restrictions
@@ -3839,7 +3902,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
warnings are not given.
-:samp:`-gnatw.X`
+:switch:`-gnatw.X`
*Disable warnings for No_Exception_Propagation mode.*
This switch disables warnings for exception usage when pragma Restrictions
@@ -3849,14 +3912,14 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwy (gcc)
.. index:: Ada compatibility issues warnings
-:samp:`-gnatwy`
+:switch:`-gnatwy`
*Activate warnings for Ada compatibility issues.*
For the most part, newer versions of Ada are upwards compatible
with older versions. For example, Ada 2005 programs will almost
always work when compiled as Ada 2012.
However there are some exceptions (for example the fact that
- `some` is now a reserved word in Ada 2012). This
+ ``some`` is now a reserved word in Ada 2012). This
switch activates several warnings to help in identifying
and correcting such incompatibilities. The default is that
these warnings are generated. Note that at one point Ada 2005
@@ -3866,7 +3929,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwY (gcc)
.. index:: Ada compatibility issues warnings
-:samp:`-gnatwY`
+:switch:`-gnatwY`
*Disable warnings for Ada compatibility issues.*
This switch suppresses the warnings intended to help in identifying
@@ -3876,7 +3939,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.y (gcc)
.. index:: Package spec needing body
-:samp:`-gnatw.y`
+:switch:`-gnatw.y`
*Activate information messages for why package spec needs body.*
There are a number of cases in which a package spec needs a body.
@@ -3891,7 +3954,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.Y (gcc)
.. index:: No information messages for why package spec needs body
-:samp:`-gnatw.Y`
+:switch:`-gnatw.Y`
*Disable information messages for why package spec needs body.*
This switch suppresses the output of information messages showing why
@@ -3901,7 +3964,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwz (gcc)
.. index:: Unchecked_Conversion warnings
-:samp:`-gnatwz`
+:switch:`-gnatwz`
*Activate warnings on unchecked conversions.*
This switch activates warnings for unchecked conversions
@@ -3912,7 +3975,7 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatwZ (gcc)
-:samp:`-gnatwZ`
+:switch:`-gnatwZ`
*Suppress warnings on unchecked conversions.*
This switch suppresses warnings for unchecked conversions
@@ -3923,11 +3986,11 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.z (gcc)
.. index:: Size/Alignment warnings
-:samp:`-gnatw.z`
+:switch:`-gnatw.z`
*Activate warnings for size not a multiple of alignment.*
This switch activates warnings for cases of record types with
- specified `Size` and `Alignment` attributes where the
+ specified ``Size`` and ``Alignment`` attributes where the
size is not a multiple of the alignment, resulting in an object
size that is greater than the specified size. The default
is that such warnings are generated.
@@ -3936,64 +3999,64 @@ of the pragma in the :title:`GNAT_Reference_manual`).
.. index:: -gnatw.Z (gcc)
.. index:: Size/Alignment warnings
-:samp:`-gnatw.Z`
+:switch:`-gnatw.Z`
*Suppress warnings for size not a multiple of alignment.*
This switch suppresses warnings for cases of record types with
- specified `Size` and `Alignment` attributes where the
+ specified ``Size`` and ``Alignment`` attributes where the
size is not a multiple of the alignment, resulting in an object
size that is greater than the specified size.
The warning can also be
- suppressed by giving an explicit `Object_Size` value.
+ suppressed by giving an explicit ``Object_Size`` value.
.. index:: -Wunused (gcc)
-:samp:`-Wunused`
- The warnings controlled by the *-gnatw* switch are generated by
- the front end of the compiler. The *GCC* back end can provide
- additional warnings and they are controlled by the *-W* switch.
- For example, *-Wunused* activates back end
+:switch:`-Wunused`
+ The warnings controlled by the :switch:`-gnatw` switch are generated by
+ the front end of the compiler. The GCC back end can provide
+ additional warnings and they are controlled by the :switch:`-W` switch.
+ For example, :switch:`-Wunused` activates back end
warnings for entities that are declared but not referenced.
.. index:: -Wuninitialized (gcc)
-:samp:`-Wuninitialized`
- Similarly, *-Wuninitialized* activates
+:switch:`-Wuninitialized`
+ Similarly, :switch:`-Wuninitialized` activates
the back end warning for uninitialized variables. This switch must be
used in conjunction with an optimization level greater than zero.
.. index:: -Wstack-usage (gcc)
-:samp:`-Wstack-usage={len}`
- Warn if the stack usage of a subprogram might be larger than `len` bytes.
+:switch:`-Wstack-usage={len}`
+ Warn if the stack usage of a subprogram might be larger than ``len`` bytes.
See :ref:`Static_Stack_Usage_Analysis` for details.
.. index:: -Wall (gcc)
-:samp:`-Wall`
- This switch enables most warnings from the *GCC* back end.
+:switch:`-Wall`
+ This switch enables most warnings from the GCC back end.
The code generator detects a number of warning situations that are missed
- by the *GNAT* front end, and this switch can be used to activate them.
+ by the GNAT front end, and this switch can be used to activate them.
The use of this switch also sets the default front end warning mode to
- *-gnatwa*, that is, most front end warnings activated as well.
+ :switch:`-gnatwa`, that is, most front end warnings activated as well.
.. index:: -w (gcc)
-:samp:`-w`
- Conversely, this switch suppresses warnings from the *GCC* back end.
+:switch:`-w`
+ Conversely, this switch suppresses warnings from the GCC back end.
The use of this switch also sets the default front end warning mode to
- *-gnatws*, that is, front end warnings suppressed as well.
+ :switch:`-gnatws`, that is, front end warnings suppressed as well.
.. index:: -Werror (gcc)
-:samp:`-Werror`
- This switch causes warnings from the *GCC* back end to be treated as
+:switch:`-Werror`
+ This switch causes warnings from the GCC back end to be treated as
errors. The warning string still appears, but the warning messages are
counted as errors, and prevent the generation of an object file.
@@ -4006,79 +4069,81 @@ A string of warning parameters can be used in the same parameter. For example::
will turn on all optional warnings except for unrecognized pragma warnings,
and also specify that warnings should be treated as errors.
-When no switch *-gnatw* is used, this is equivalent to:
+When no switch :switch:`-gnatw` is used, this is equivalent to:
+
+ * :switch:`-gnatw.a`
- * :samp:`-gnatw.a`
+ * :switch:`-gnatwB`
- * :samp:`-gnatwB`
+ * :switch:`-gnatw.b`
- * :samp:`-gnatw.b`
+ * :switch:`-gnatwC`
- * :samp:`-gnatwC`
+ * :switch:`-gnatw.C`
- * :samp:`-gnatw.C`
+ * :switch:`-gnatwD`
- * :samp:`-gnatwD`
+ * :switch:`-gnatwF`
- * :samp:`-gnatwF`
+ * :switch:`-gnatwg`
- * :samp:`-gnatwg`
+ * :switch:`-gnatwH`
- * :samp:`-gnatwH`
+ * :switch:`-gnatwi`
- * :samp:`-gnatwi`
+ * :switch:`-gnatw.I`
- * :samp:`-gnatw.I`
+ * :switch:`-gnatwJ`
- * :samp:`-gnatwJ`
+ * :switch:`-gnatwK`
- * :samp:`-gnatwK`
+ * :switch:`-gnatwL`
- * :samp:`-gnatwL`
+ * :switch:`-gnatw.L`
- * :samp:`-gnatw.L`
+ * :switch:`-gnatwM`
- * :samp:`-gnatwM`
+ * :switch:`-gnatw.m`
- * :samp:`-gnatw.m`
+ * :switch:`-gnatwn`
- * :samp:`-gnatwn`
+ * :switch:`-gnatwo`
- * :samp:`-gnatwo`
+ * :switch:`-gnatw.O`
- * :samp:`-gnatw.O`
+ * :switch:`-gnatwP`
- * :samp:`-gnatwP`
+ * :switch:`-gnatw.P`
- * :samp:`-gnatw.P`
+ * :switch:`-gnatwq`
- * :samp:`-gnatwq`
+ * :switch:`-gnatw.Q`
- * :samp:`-gnatwR`
+ * :switch:`-gnatwR`
- * :samp:`-gnatw.R`
+ * :switch:`-gnatw.R`
- * :samp:`-gnatw.S`
+ * :switch:`-gnatw.S`
- * :samp:`-gnatwT`
+ * :switch:`-gnatwT`
- * :samp:`-gnatw.T`
+ * :switch:`-gnatw.T`
- * :samp:`-gnatwU`
+ * :switch:`-gnatwU`
- * :samp:`-gnatwv`
+ * :switch:`-gnatwv`
- * :samp:`-gnatww`
+ * :switch:`-gnatww`
- * :samp:`-gnatw.W`
+ * :switch:`-gnatw.W`
- * :samp:`-gnatwx`
+ * :switch:`-gnatwx`
- * :samp:`-gnatw.X`
+ * :switch:`-gnatw.X`
- * :samp:`-gnatwy`
+ * :switch:`-gnatwy`
- * :samp:`-gnatwz`
+ * :switch:`-gnatwz`
.. _Debugging_and_Assertion_Control:
@@ -4089,7 +4154,7 @@ Debugging and Assertion Control
.. index:: -gnata (gcc)
-:samp:`-gnata`
+:switch:`-gnata`
.. index:: Assert
.. index:: Debug
.. index:: Assertions
@@ -4098,7 +4163,7 @@ Debugging and Assertion Control
.. index:: Type invariants
.. index:: Subtype predicates
- The `-gnata` option is equivalent to the following Assertion_Policy pragma::
+ The :switch:`-gnata` option is equivalent to the following ``Assertion_Policy`` pragma::
pragma Assertion_Policy (Check);
@@ -4115,9 +4180,9 @@ Debugging and Assertion Control
Type_Invariant => Check,
Type_Invariant'Class => Check);
- The pragmas `Assert` and `Debug` normally have no effect and
- are ignored. This switch, where :samp:`a` stands for assert, causes
- pragmas `Assert` and `Debug` to be activated. This switch also
+ The pragmas ``Assert`` and ``Debug`` normally have no effect and
+ are ignored. This switch, where ``a`` stands for 'assert', causes
+ pragmas ``Assert`` and ``Debug`` to be activated. This switch also
causes preconditions, postconditions, subtype predicates, and
type invariants to be activated.
@@ -4135,22 +4200,22 @@ Debugging and Assertion Control
with [Pre|Post|Type_Invariant|Dynamic_Predicate|Static_Predicate]
=> <Boolean-expression>;
- The `Assert` pragma causes `Boolean-expression` to be tested.
- If the result is `True`, the pragma has no effect (other than
+ The ``Assert`` pragma causes ``Boolean-expression`` to be tested.
+ If the result is ``True``, the pragma has no effect (other than
possible side effects from evaluating the expression). If the result is
- `False`, the exception `Assert_Failure` declared in the package
- `System.Assertions` is raised (passing `static-string-expression`, if
+ ``False``, the exception ``Assert_Failure`` declared in the package
+ ``System.Assertions`` is raised (passing ``static-string-expression``, if
present, as the message associated with the exception). If no string
expression is given, the default is a string containing the file name and
line number of the pragma.
- The `Debug` pragma causes `procedure` to be called. Note that
- `pragma Debug` may appear within a declaration sequence, allowing
+ The ``Debug`` pragma causes ``procedure`` to be called. Note that
+ ``pragma Debug`` may appear within a declaration sequence, allowing
debugging procedures to be called between declarations.
- For the aspect specification, the `<Boolean-expression>` is evaluated.
- If the result is `True`, the aspect has no effect. If the result
- is `False`, the exception `Assert_Failure` is raised.
+ For the aspect specification, the ``Boolean-expression`` is evaluated.
+ If the result is ``True``, the aspect has no effect. If the result
+ is ``False``, the exception ``Assert_Failure`` is raised.
.. _Validity_Checking:
@@ -4168,14 +4233,14 @@ composite types.
It is an error to read an invalid value, but the RM does not require
run-time checks to detect such errors, except for some minimal
checking to prevent erroneous execution (i.e. unpredictable
-behavior). This corresponds to the *-gnatVd* switch below,
+behavior). This corresponds to the :switch:`-gnatVd` switch below,
which is the default. For example, by default, if the expression of a
case statement is invalid, it will raise Constraint_Error rather than
causing a wild jump, and if an array index on the left-hand side of an
assignment is invalid, it will raise Constraint_Error rather than
overwriting an arbitrary memory location.
-The *-gnatVa* may be used to enable additional validity checks,
+The :switch:`-gnatVa` may be used to enable additional validity checks,
which are not required by the RM. These checks are often very
expensive (which is why the RM does not require them). These checks
are useful in tracking down uninitialized variables, but they are
@@ -4185,20 +4250,20 @@ combination with optimization, since this can confuse the optimizer.
If performance is a consideration, leading to the need to optimize,
then the validity checking options should not be used.
-The other *-gnatV*\ ``x`` switches below allow finer-grained
+The other :switch:`-gnatV{x}` switches below allow finer-grained
control; you can enable whichever validity checks you desire. However,
-for most debugging purposes, *-gnatVa* is sufficient, and the
-default *-gnatVd* (i.e. standard Ada behavior) is usually
+for most debugging purposes, :switch:`-gnatVa` is sufficient, and the
+default :switch:`-gnatVd` (i.e. standard Ada behavior) is usually
sufficient for non-debugging use.
-The *-gnatB* switch tells the compiler to assume that all
+The :switch:`-gnatB` switch tells the compiler to assume that all
values are valid (that is, within their declared subtype range)
except in the context of a use of the Valid attribute. This means
the compiler can generate more efficient code, since the range
of values is better known at compile time. However, an uninitialized
variable can cause wild jumps and memory corruption in this mode.
-The *-gnatV*\ ``x`` switch allows control over the validity
+The :switch:`-gnatV{x}` switch allows control over the validity
checking mode as described below.
The ``x`` argument is a string of letters that
indicate validity checks that are performed or not performed in addition
@@ -4207,17 +4272,17 @@ to the default checks required by Ada as described above.
.. index:: -gnatVa (gcc)
-:samp:`-gnatVa`
+:switch:`-gnatVa`
*All validity checks.*
All validity checks are turned on.
- That is, *-gnatVa* is
- equivalent to *gnatVcdfimorst*.
+ That is, :switch:`-gnatVa` is
+ equivalent to ``gnatVcdfimorst``.
.. index:: -gnatVc (gcc)
-:samp:`-gnatVc`
+:switch:`-gnatVc`
*Validity checks for copies.*
The right hand side of assignments, and the initializing values of
@@ -4226,7 +4291,7 @@ to the default checks required by Ada as described above.
.. index:: -gnatVd (gcc)
-:samp:`-gnatVd`
+:switch:`-gnatVd`
*Default (RM) validity checks.*
Some validity checks are done by default following normal Ada semantics
@@ -4235,10 +4300,10 @@ to the default checks required by Ada as described above.
of the subtype. If it is not, Constraint_Error is raised.
For assignments to array components, a check is done that the expression used
as index is within the range. If it is not, Constraint_Error is raised.
- Both these validity checks may be turned off using switch *-gnatVD*.
- They are turned on by default. If *-gnatVD* is specified, a subsequent
- switch *-gnatVd* will leave the checks turned on.
- Switch *-gnatVD* should be used only if you are sure that all such
+ Both these validity checks may be turned off using switch :switch:`-gnatVD`.
+ They are turned on by default. If :switch:`-gnatVD` is specified, a subsequent
+ switch :switch:`-gnatVd` will leave the checks turned on.
+ Switch :switch:`-gnatVD` should be used only if you are sure that all such
expressions have valid values. If you use this switch and invalid values
are present, then the program is erroneous, and wild jumps or memory
overwriting may occur.
@@ -4246,12 +4311,12 @@ to the default checks required by Ada as described above.
.. index:: -gnatVe (gcc)
-:samp:`-gnatVe`
+:switch:`-gnatVe`
*Validity checks for elementary components.*
In the absence of this switch, assignments to record or array components are
not validity checked, even if validity checks for assignments generally
- (*-gnatVc*) are turned on. In Ada, assignment of composite values do not
+ (:switch:`-gnatVc`) are turned on. In Ada, assignment of composite values do not
require valid data, but assignment of individual components does. So for
example, there is a difference between copying the elements of an array with a
slice assignment, compared to assigning element by element in a loop. This
@@ -4261,38 +4326,38 @@ to the default checks required by Ada as described above.
.. index:: -gnatVf (gcc)
-:samp:`-gnatVf`
+:switch:`-gnatVf`
*Validity checks for floating-point values.*
In the absence of this switch, validity checking occurs only for discrete
- values. If *-gnatVf* is specified, then validity checking also applies
+ values. If :switch:`-gnatVf` is specified, then validity checking also applies
for floating-point values, and NaNs and infinities are considered invalid,
as well as out of range values for constrained types. Note that this means
that standard IEEE infinity mode is not allowed. The exact contexts
in which floating-point values are checked depends on the setting of other
- options. For example, *-gnatVif* or *-gnatVfi*
+ options. For example, :switch:`-gnatVif` or :switch:`-gnatVfi`
(the order does not matter) specifies that floating-point parameters of mode
- `in` should be validity checked.
+ ``in`` should be validity checked.
.. index:: -gnatVi (gcc)
-:samp:`-gnatVi`
- *Validity checks for `in` mode parameters.*
+:switch:`-gnatVi`
+ *Validity checks for ``in`` mode parameters.*
- Arguments for parameters of mode `in` are validity checked in function
+ Arguments for parameters of mode ``in`` are validity checked in function
and procedure calls at the point of call.
.. index:: -gnatVm (gcc)
-:samp:`-gnatVm`
- *Validity checks for `in out` mode parameters.*
+:switch:`-gnatVm`
+ *Validity checks for ``in out`` mode parameters.*
- Arguments for parameters of mode `in out` are validity checked in
- procedure calls at the point of call. The `'m'` here stands for
+ Arguments for parameters of mode ``in out`` are validity checked in
+ procedure calls at the point of call. The ``'m'`` here stands for
modify, since this concerns parameters that can be modified by the call.
- Note that there is no specific option to test `out` parameters,
+ Note that there is no specific option to test ``out`` parameters,
but any reference within the subprogram will be tested in the usual
manner, and if an invalid value is copied back, any reference to it
will be subject to validity checking.
@@ -4300,25 +4365,25 @@ to the default checks required by Ada as described above.
.. index:: -gnatVn (gcc)
-:samp:`-gnatVn`
+:switch:`-gnatVn`
*No validity checks.*
This switch turns off all validity checking, including the default checking
for case statements and left hand side subscripts. Note that the use of
- the switch *-gnatp* suppresses all run-time checks, including
- validity checks, and thus implies *-gnatVn*. When this switch
- is used, it cancels any other *-gnatV* previously issued.
+ the switch :switch:`-gnatp` suppresses all run-time checks, including
+ validity checks, and thus implies :switch:`-gnatVn`. When this switch
+ is used, it cancels any other :switch:`-gnatV` previously issued.
.. index:: -gnatVo (gcc)
-:samp:`-gnatVo`
+:switch:`-gnatVo`
*Validity checks for operator and attribute operands.*
Arguments for predefined operators and attributes are validity checked.
- This includes all operators in package `Standard`,
- the shift operators defined as intrinsic in package `Interfaces`
- and operands for attributes such as `Pos`. Checks are also made
+ This includes all operators in package ``Standard``,
+ the shift operators defined as intrinsic in package ``Interfaces``
+ and operands for attributes such as ``Pos``. Checks are also made
on individual component values for composite comparisons, and on the
expressions in type conversions and qualified expressions. Checks are
also made on explicit ranges using :samp:`..` (e.g., slices, loops etc).
@@ -4326,31 +4391,31 @@ to the default checks required by Ada as described above.
.. index:: -gnatVp (gcc)
-:samp:`-gnatVp`
+:switch:`-gnatVp`
*Validity checks for parameters.*
This controls the treatment of parameters within a subprogram (as opposed
- to *-gnatVi* and *-gnatVm* which control validity testing
+ to :switch:`-gnatVi` and :switch:`-gnatVm` which control validity testing
of parameters on a call. If either of these call options is used, then
normally an assumption is made within a subprogram that the input arguments
have been validity checking at the point of call, and do not need checking
- again within a subprogram). If *-gnatVp* is set, then this assumption
+ again within a subprogram). If :switch:`-gnatVp` is set, then this assumption
is not made, and parameters are not assumed to be valid, so their validity
will be checked (or rechecked) within the subprogram.
.. index:: -gnatVr (gcc)
-:samp:`-gnatVr`
+:switch:`-gnatVr`
*Validity checks for function returns.*
- The expression in `return` statements in functions is validity
+ The expression in ``return`` statements in functions is validity
checked.
.. index:: -gnatVs (gcc)
-:samp:`-gnatVs`
+:switch:`-gnatVs`
*Validity checks for subscripts.*
All subscripts expressions are checked for validity, whether they appear
@@ -4360,33 +4425,33 @@ to the default checks required by Ada as described above.
.. index:: -gnatVt (gcc)
-:samp:`-gnatVt`
+:switch:`-gnatVt`
*Validity checks for tests.*
- Expressions used as conditions in `if`, `while` or `exit`
+ Expressions used as conditions in ``if``, ``while`` or ``exit``
statements are checked, as well as guard expressions in entry calls.
-The *-gnatV* switch may be followed by a string of letters
+The :switch:`-gnatV` switch may be followed by a string of letters
to turn on a series of validity checking options.
-For example, :samp:`-gnatVcr`
+For example, :switch:`-gnatVcr`
specifies that in addition to the default validity checking, copies and
function return expressions are to be validity checked.
In order to make it easier to specify the desired combination of effects,
-the upper case letters `CDFIMORST` may
+the upper case letters ``CDFIMORST`` may
be used to turn off the corresponding lower case option.
-Thus :samp:`-gnatVaM` turns on all validity checking options except for
-checking of `**in out**` procedure arguments.
+Thus :switch:`-gnatVaM` turns on all validity checking options except for
+checking of ``in out`` parameters.
The specification of additional validity checking generates extra code (and
-in the case of *-gnatVa* the code expansion can be substantial).
+in the case of :switch:`-gnatVa` the code expansion can be substantial).
However, these additional checks can be very useful in detecting
uninitialized variables, incorrect use of unchecked conversion, and other
-errors leading to invalid values. The use of pragma `Initialize_Scalars`
+errors leading to invalid values. The use of pragma ``Initialize_Scalars``
is useful in conjunction with the extra validity checking, since this
ensures that wherever possible uninitialized variables have invalid values.
-See also the pragma `Validity_Checks` which allows modification of
+See also the pragma ``Validity_Checks`` which allows modification of
the validity checking mode at the program source level, and also allows for
temporary disabling of validity checks.
@@ -4399,13 +4464,13 @@ Style Checking
.. index:: -gnaty (gcc)
-The *-gnatyx* switch causes the compiler to
+The :switch:`-gnatyx` switch causes the compiler to
enforce specified style rules. A limited set of style rules has been used
in writing the GNAT sources themselves. This switch allows user programs
to activate all or some of these checks. If the source program fails a
specified style check, an appropriate message is given, preceded by
the character sequence '(style)'. This message does not prevent
-successful compilation (unless the *-gnatwe* switch is used).
+successful compilation (unless the :switch:`-gnatwe` switch is used).
Note that this is by no means intended to be a general facility for
checking arbitrary coding standards. It is simply an embedding of the
@@ -4422,23 +4487,23 @@ some subset of them.
of an existing set of coding rules, you should look to the gnatcheck
tool, which is designed for that purpose.
-The string `x` is a sequence of letters or digits
+The string ``x`` is a sequence of letters or digits
indicating the particular style
checks to be performed. The following checks are defined:
.. index:: -gnaty[0-9] (gcc)
-:samp:`-gnaty0`
+:switch:`-gnaty0`
*Specify indentation level.*
If a digit from 1-9 appears
- in the string after *-gnaty*
+ in the string after :switch:`-gnaty`
then proper indentation is checked, with the digit indicating the
indentation level required. A value of zero turns off this style check.
The general style of required indentation is as specified by
the examples in the Ada Reference Manual. Full line comments must be
- aligned with the `--` starting on a column that is a multiple of
+ aligned with the ``--`` starting on a column that is a multiple of
the alignment level, or they may be aligned the same way as the following
non-blank line (this is useful when full line comments appear in the middle
of a statement, or they may be aligned with the source line on the previous
@@ -4446,10 +4511,10 @@ checks to be performed. The following checks are defined:
.. index:: -gnatya (gcc)
-:samp:`-gnatya`
+:switch:`-gnatya`
*Check attribute casing.*
- Attribute names, including the case of keywords such as `digits`
+ Attribute names, including the case of keywords such as ``digits``
used as attributes names, must be written in mixed case, that is, the
initial letter and any letter following an underscore must be uppercase.
All other letters must be lowercase.
@@ -4457,7 +4522,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyA (gcc)
-:samp:`-gnatyA`
+:switch:`-gnatyA`
*Use of array index numbers in array attributes.*
When using the array attributes First, Last, Range,
@@ -4467,7 +4532,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyb (gcc)
-:samp:`-gnatyb`
+:switch:`-gnatyb`
*Blanks not allowed at statement end.*
Trailing blanks are not allowed at the end of statements. The purpose of this
@@ -4477,51 +4542,51 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyB (gcc)
-:samp:`-gnatyB`
+:switch:`-gnatyB`
*Check Boolean operators.*
The use of AND/OR operators is not permitted except in the cases of modular
operands, array operands, and simple stand-alone boolean variables or
- boolean constants. In all other cases `and then`/`or else` are
+ boolean constants. In all other cases ``and then``/`or else` are
required.
.. index:: -gnatyc (gcc)
-:samp:`-gnatyc`
+:switch:`-gnatyc`
*Check comments, double space.*
Comments must meet the following set of rules:
- * The '`--`' that starts the column must either start in column one,
+ * The ``--`` that starts the column must either start in column one,
or else at least one blank must precede this sequence.
* Comments that follow other tokens on a line must have at least one blank
- following the '`--`' at the start of the comment.
+ following the ``--`` at the start of the comment.
* Full line comments must have at least two blanks following the
- '`--`' that starts the comment, with the following exceptions.
+ ``--`` that starts the comment, with the following exceptions.
- * A line consisting only of the '`--`' characters, possibly preceded
+ * A line consisting only of the ``--`` characters, possibly preceded
by blanks is permitted.
- * A comment starting with '`--x`' where `x` is a special character
+ * A comment starting with ``--x`` where ``x`` is a special character
is permitted.
- This allows proper processing of the output generated by specialized tools
- including *gnatprep* (where '`--!`' is used) and the SPARK
+ This allows proper processing of the output from specialized tools
+ such as ``gnatprep`` (where ``--!`` is used) and in earlier versions of the SPARK
annotation
- language (where '`--#`' is used). For the purposes of this rule, a
+ language (where ``--#`` is used). For the purposes of this rule, a
special character is defined as being in one of the ASCII ranges
- `16#21#...16#2F#` or `16#3A#...16#3F#`.
+ ``16#21#...16#2F#`` or ``16#3A#...16#3F#``.
Note that this usage is not permitted
- in GNAT implementation units (i.e., when *-gnatg* is used).
+ in GNAT implementation units (i.e., when :switch:`-gnatg` is used).
* A line consisting entirely of minus signs, possibly preceded by blanks, is
permitted. This allows the construction of box comments where lines of minus
signs are used to form the top and bottom of the box.
- * A comment that starts and ends with '`--`' is permitted as long as at
- least one blank follows the initial '`--`'. Together with the preceding
+ * A comment that starts and ends with ``--`` is permitted as long as at
+ least one blank follows the initial ``--``. Together with the preceding
rule, this allows the construction of box comments, as shown in the following
example:
@@ -4535,16 +4600,16 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyC (gcc)
-:samp:`-gnatyC`
+:switch:`-gnatyC`
*Check comments, single space.*
- This is identical to `c` except that only one space
- is required following the `--` of a comment instead of two.
+ This is identical to ``c`` except that only one space
+ is required following the ``--`` of a comment instead of two.
.. index:: -gnatyd (gcc)
-:samp:`-gnatyd`
+:switch:`-gnatyd`
*Check no DOS line terminators present.*
All lines must be terminated by a single ASCII.LF
@@ -4554,16 +4619,16 @@ checks to be performed. The following checks are defined:
.. index:: -gnatye (gcc)
-:samp:`-gnatye`
+:switch:`-gnatye`
*Check end/exit labels.*
- Optional labels on `end` statements ending subprograms and on
- `exit` statements exiting named loops, are required to be present.
+ Optional labels on ``end`` statements ending subprograms and on
+ ``exit`` statements exiting named loops, are required to be present.
.. index:: -gnatyf (gcc)
-:samp:`-gnatyf`
+:switch:`-gnatyf`
*No form feeds or vertical tabs.*
Neither form feeds nor vertical tab characters are permitted
@@ -4572,19 +4637,19 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyg (gcc)
-:samp:`-gnatyg`
+:switch:`-gnatyg`
*GNAT style mode.*
The set of style check switches is set to match that used by the GNAT sources.
This may be useful when developing code that is eventually intended to be
- incorporated into GNAT. Currently this is equivalent to *-gnatwydISux*)
+ incorporated into GNAT. Currently this is equivalent to :switch:`-gnatwydISux`)
but additional style switches may be added to this set in the future without
advance notice.
.. index:: -gnatyh (gcc)
-:samp:`-gnatyh`
+:switch:`-gnatyh`
*No horizontal tabs.*
Horizontal tab characters are not permitted in the source text.
@@ -4595,49 +4660,49 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyi (gcc)
-:samp:`-gnatyi`
+:switch:`-gnatyi`
*Check if-then layout.*
- The keyword `then` must appear either on the same
- line as corresponding `if`, or on a line on its own, lined
- up under the `if`.
+ The keyword ``then`` must appear either on the same
+ line as corresponding ``if``, or on a line on its own, lined
+ up under the ``if``.
.. index:: -gnatyI (gcc)
-:samp:`-gnatyI`
+:switch:`-gnatyI`
*check mode IN keywords.*
- Mode `in` (the default mode) is not
- allowed to be given explicitly. `in out` is fine,
- but not `in` on its own.
+ Mode ``in`` (the default mode) is not
+ allowed to be given explicitly. ``in out`` is fine,
+ but not ``in`` on its own.
.. index:: -gnatyk (gcc)
-:samp:`-gnatyk`
+:switch:`-gnatyk`
*Check keyword casing.*
All keywords must be in lower case (with the exception of keywords
- such as `digits` used as attribute names to which this check
+ such as ``digits`` used as attribute names to which this check
does not apply).
.. index:: -gnatyl (gcc)
-:samp:`-gnatyl`
+:switch:`-gnatyl`
*Check layout.*
Layout of statement and declaration constructs must follow the
recommendations in the Ada Reference Manual, as indicated by the
- form of the syntax rules. For example an `else` keyword must
- be lined up with the corresponding `if` keyword.
+ form of the syntax rules. For example an ``else`` keyword must
+ be lined up with the corresponding ``if`` keyword.
There are two respects in which the style rule enforced by this check
option are more liberal than those in the Ada Reference Manual. First
in the case of record declarations, it is permissible to put the
- `record` keyword on the same line as the `type` keyword, and
- then the `end` in `end record` must line up under `type`.
+ ``record`` keyword on the same line as the ``type`` keyword, and
+ then the ``end`` in ``end record`` must line up under ``type``.
This is also permitted when the type declaration is split on two lines.
For example, any of the following three layouts is acceptable:
@@ -4661,8 +4726,8 @@ checks to be performed. The following checks are defined:
end record;
Second, in the case of a block statement, a permitted alternative
- is to put the block label on the same line as the `declare` or
- `begin` keyword, and then line the `end` keyword up under
+ is to put the block label on the same line as the ``declare`` or
+ ``begin`` keyword, and then line the ``end`` keyword up under
the block label. For example both the following are permitted:
.. code-block:: ada
@@ -4697,7 +4762,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyLnnn (gcc)
-:samp:`-gnatyL`
+:switch:`-gnatyL`
*Set maximum nesting level.*
The maximum level of nesting of constructs (including subprograms, loops,
@@ -4707,7 +4772,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatym (gcc)
-:samp:`-gnatym`
+:switch:`-gnatym`
*Check maximum line length.*
The length of source lines must not exceed 79 characters, including
@@ -4721,7 +4786,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyMnnn (gcc)
-:samp:`-gnatyM`
+:switch:`-gnatyM`
*Set maximum line length.*
The length of lines must not exceed the
@@ -4733,17 +4798,17 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyn (gcc)
-:samp:`-gnatyn`
+:switch:`-gnatyn`
*Check casing of entities in Standard.*
Any identifier from Standard must be cased
to match the presentation in the Ada Reference Manual (for example,
- `Integer` and `ASCII.NUL`).
+ ``Integer`` and ``ASCII.NUL``).
.. index:: -gnatyN (gcc)
-:samp:`-gnatyN`
+:switch:`-gnatyN`
*Turn off all style checks.*
All style check options are turned off.
@@ -4751,7 +4816,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyo (gcc)
-:samp:`-gnatyo`
+:switch:`-gnatyo`
*Check order of subprogram bodies.*
All subprogram bodies in a given scope
@@ -4764,7 +4829,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyO (gcc)
-:samp:`-gnatyO`
+:switch:`-gnatyO`
*Check that overriding subprograms are explicitly marked as such.*
This applies to all subprograms of a derived type that override a primitive
@@ -4777,7 +4842,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyp (gcc)
-:samp:`-gnatyp`
+:switch:`-gnatyp`
*Check pragma casing.*
Pragma names must be written in mixed case, that is, the
@@ -4788,7 +4853,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyr (gcc)
-:samp:`-gnatyr`
+:switch:`-gnatyr`
*Check references.*
All identifier references must be cased in the same way as the
@@ -4799,7 +4864,7 @@ checks to be performed. The following checks are defined:
.. index:: -gnatys (gcc)
-:samp:`-gnatys`
+:switch:`-gnatys`
*Check separate specs.*
Separate declarations ('specs') are required for subprograms (a
@@ -4811,30 +4876,30 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyS (gcc)
-:samp:`-gnatyS`
+:switch:`-gnatyS`
*Check no statements after then/else.*
No statements are allowed
- on the same line as a `then` or `else` keyword following the
- keyword in an `if` statement. `or else` and `and then` are not
- affected, and a special exception allows a pragma to appear after `else`.
+ on the same line as a ``then`` or ``else`` keyword following the
+ keyword in an ``if`` statement. ``or else`` and ``and then`` are not
+ affected, and a special exception allows a pragma to appear after ``else``.
.. index:: -gnatyt (gcc)
-:samp:`-gnatyt`
+:switch:`-gnatyt`
*Check token spacing.*
The following token spacing rules are enforced:
- * The keywords `abs` and `not` must be followed by a space.
+ * The keywords ``abs`` and ``not`` must be followed by a space.
- * The token `=>` must be surrounded by spaces.
+ * The token ``=>`` must be surrounded by spaces.
- * The token `<>` must be preceded by a space or a left parenthesis.
+ * The token ``<>`` must be preceded by a space or a left parenthesis.
- * Binary operators other than `**` must be surrounded by spaces.
- There is no restriction on the layout of the `**` binary operator.
+ * Binary operators other than ``**`` must be surrounded by spaces.
+ There is no restriction on the layout of the ``**`` binary operator.
* Colon must be surrounded by spaces.
@@ -4861,12 +4926,12 @@ checks to be performed. The following checks are defined:
* A vertical bar must be surrounded by spaces.
Exactly one blank (and no other white space) must appear between
- a `not` token and a following `in` token.
+ a ``not`` token and a following ``in`` token.
.. index:: -gnatyu (gcc)
-:samp:`-gnatyu`
+:switch:`-gnatyu`
*Check unnecessary blank lines.*
Unnecessary blank lines are not allowed. A blank line is considered
@@ -4876,42 +4941,42 @@ checks to be performed. The following checks are defined:
.. index:: -gnatyx (gcc)
-:samp:`-gnatyx`
+:switch:`-gnatyx`
*Check extra parentheses.*
Unnecessary extra level of parentheses (C-style) are not allowed
- around conditions in `if` statements, `while` statements and
- `exit` statements.
+ around conditions in ``if`` statements, ``while`` statements and
+ ``exit`` statements.
.. index:: -gnatyy (gcc)
-:samp:`-gnatyy`
+:switch:`-gnatyy`
*Set all standard style check options.*
- This is equivalent to `gnaty3aAbcefhiklmnprst`, that is all checking
- options enabled with the exception of *-gnatyB*, *-gnatyd*,
- *-gnatyI*, *-gnatyLnnn*, *-gnatyo*, *-gnatyO*,
- *-gnatyS*, *-gnatyu*, and *-gnatyx*.
+ This is equivalent to ``gnaty3aAbcefhiklmnprst``, that is all checking
+ options enabled with the exception of :switch:`-gnatyB`, :switch:`-gnatyd`,
+ :switch:`-gnatyI`, :switch:`-gnatyLnnn`, :switch:`-gnatyo`, :switch:`-gnatyO`,
+ :switch:`-gnatyS`, :switch:`-gnatyu`, and :switch:`-gnatyx`.
.. index:: -gnaty- (gcc)
-:samp:`-gnaty-`
+:switch:`-gnaty-`
*Remove style check options.*
This causes any subsequent options in the string to act as canceling the
corresponding style check option. To cancel maximum nesting level control,
- use *L* parameter witout any integer value after that, because any
- digit following *-* in the parameter string of the *-gnaty*
- option will be threated as canceling indentation check. The same is true
- for *M* parameter. *y* and *N* parameters are not
+ use the ``L`` parameter without any integer value after that, because any
+ digit following *-* in the parameter string of the :switch:`-gnaty`
+ option will be treated as canceling the indentation check. The same is true
+ for the ``M`` parameter. ``y`` and ``N`` parameters are not
allowed after *-*.
.. index:: -gnaty+ (gcc)
-:samp:`-gnaty+`
+:switch:`-gnaty+`
*Enable style check options.*
This causes any subsequent options in the string to enable the corresponding
@@ -4934,15 +4999,15 @@ If any of these style rules is violated, a message is generated giving
details on the violation. The initial characters of such messages are
always '`(style)`'. Note that these messages are treated as warning
messages, so they normally do not prevent the generation of an object
-file. The *-gnatwe* switch can be used to treat warning messages,
+file. The :switch:`-gnatwe` switch can be used to treat warning messages,
including style messages, as fatal errors.
-The switch :samp:`-gnaty` on its own (that is not
+The switch :switch:`-gnaty` on its own (that is not
followed by any letters or digits) is equivalent
-to the use of *-gnatyy* as described above, that is all
+to the use of :switch:`-gnatyy` as described above, that is all
built-in standard style check options are enabled.
-The switch :samp:`-gnatyN` clears any previously set style checks.
+The switch :switch:`-gnatyN` clears any previously set style checks.
.. _Run-Time_Checks:
@@ -4962,20 +5027,20 @@ Run-Time Checks
By default, the following checks are suppressed: stack overflow
checks, and checks for access before elaboration on subprogram
calls. All other checks, including overflow checks, range checks and
-array bounds checks, are turned on by default. The following *gcc*
+array bounds checks, are turned on by default. The following ``gcc``
switches refine this default behavior.
.. index:: -gnatp (gcc)
-:samp:`-gnatp`
+:switch:`-gnatp`
.. index:: Suppressing checks
.. index:: Checks, suppressing
This switch causes the unit to be compiled
- as though `pragma Suppress (All_checks)`
+ as though ``pragma Suppress (All_checks)``
had been present in the source. Validity checks are also eliminated (in
- other words *-gnatp* also implies *-gnatVn*.
+ other words :switch:`-gnatp` also implies :switch:`-gnatVn`.
Use this switch to improve the performance
of the code at the expense of safety in the presence of invalid data or
program bugs.
@@ -5003,19 +5068,18 @@ switches refine this default behavior.
execution if that assumption is wrong.
The checks subject to suppression include all the checks defined by the Ada
- standard, the additional implementation defined checks `Alignment_Check`,
- `Duplicated_Tag_Check`, `Predicate_Check`, Container_Checks, Tampering_Check,
- and `Validity_Check`, as well as any checks introduced using `pragma
- Check_Name`. Note that `Atomic_Synchronization` is not automatically
- suppressed by use of this option.
+ standard, the additional implementation defined checks ``Alignment_Check``,
+ ``Duplicated_Tag_Check``, ``Predicate_Check``, ``Container_Checks``, ``Tampering_Check``,
+ and ``Validity_Check``, as well as any checks introduced using ``pragma Check_Name``.
+ Note that ``Atomic_Synchronization`` is not automatically suppressed by use of this option.
If the code depends on certain checks being active, you can use
- pragma `Unsuppress` either as a configuration pragma or as
+ pragma ``Unsuppress`` either as a configuration pragma or as
a local pragma to make sure that a specified check is performed
- even if *gnatp* is specified.
+ even if ``gnatp`` is specified.
- The *-gnatp* switch has no effect if a subsequent
- *-gnat-p* switch appears.
+ The :switch:`-gnatp` switch has no effect if a subsequent
+ :switch:`-gnat-p` switch appears.
.. index:: -gnat-p (gcc)
@@ -5023,8 +5087,8 @@ switches refine this default behavior.
.. index:: Checks, suppressing
.. index:: Suppress
-:samp:`-gnat-p`
- This switch cancels the effect of a previous *gnatp* switch.
+:switch:`-gnat-p`
+ This switch cancels the effect of a previous ``gnatp`` switch.
.. index:: -gnato?? (gcc)
@@ -5032,7 +5096,7 @@ switches refine this default behavior.
.. index:: Overflow mode
.. index:: Check, overflow
-:samp:`-gnato??`
+:switch:`-gnato??`
This switch controls the mode used for computing intermediate
arithmetic integer operations, and also enables overflow checking.
For a full description of overflow mode and checking control, see
@@ -5052,7 +5116,7 @@ switches refine this default behavior.
*2 = MINIMIZED*
In MINIMIZED mode, overflows in intermediate operations are avoided
where possible by using a larger integer type for the computation
- (typically `Long_Long_Integer`). Overflow checking ensures that
+ (typically ``Long_Long_Integer``). Overflow checking ensures that
the result fits in this larger integer type.
@@ -5061,7 +5125,7 @@ switches refine this default behavior.
by using multi-precision arithmetic. In this case, overflow checking
has no effect on intermediate operations (since overflow is impossible).
- If two digits are present after *-gnato* then the first digit
+ If two digits are present after :switch:`-gnato` then the first digit
sets the mode for expressions outside assertions, and the second digit
sets the mode for expressions within assertions. Here assertions is used
in the technical sense (which includes for example precondition and
@@ -5072,14 +5136,14 @@ switches refine this default behavior.
If no digits are present, the default is to enable overflow checks
and set STRICT mode for both kinds of expressions. This is compatible
- with the use of *-gnato* in previous versions of GNAT.
+ with the use of :switch:`-gnato` in previous versions of GNAT.
.. index:: Machine_Overflows
- Note that the *-gnato??* switch does not affect the code generated
+ Note that the :switch:`-gnato??` switch does not affect the code generated
for any floating-point operations; it applies only to integer semantics.
- For floating-point, GNAT has the `Machine_Overflows`
- attribute set to `False` and the normal mode of operation is to
+ For floating-point, GNAT has the ``Machine_Overflows``
+ attribute set to ``False`` and the normal mode of operation is to
generate IEEE NaN and infinite values on overflow or invalid operations
(such as dividing 0.0 by 0.0).
@@ -5091,7 +5155,7 @@ switches refine this default behavior.
checking is also quite expensive in time and space, since in general it
requires the use of double length arithmetic.
- Note again that the default is *-gnato11* (equivalent to *-gnato1*),
+ Note again that the default is :switch:`-gnato11` (equivalent to :switch:`-gnato1`),
so overflow checking is performed in STRICT mode by default.
@@ -5099,10 +5163,10 @@ switches refine this default behavior.
.. index:: Elaboration checks
.. index:: Check, elaboration
-:samp:`-gnatE`
+:switch:`-gnatE`
Enables dynamic checks for access-before-elaboration
on subprogram calls and generic instantiations.
- Note that *-gnatE* is not necessary for safety, because in the
+ Note that :switch:`-gnatE` is not necessary for safety, because in the
default mode, GNAT ensures statically that the checks would not fail.
For full details of the effect and use of this switch,
:ref:`Compiling_with_gcc`.
@@ -5112,27 +5176,27 @@ switches refine this default behavior.
.. index:: Stack Overflow Checking
.. index:: Checks, stack overflow checking
-:samp:`-fstack-check`
+:switch:`-fstack-check`
Activates stack overflow checking. For full details of the effect and use of
this switch see :ref:`Stack_Overflow_Checking`.
.. index:: Unsuppress
The setting of these switches only controls the default setting of the
-checks. You may modify them using either `Suppress` (to remove
-checks) or `Unsuppress` (to add back suppressed checks) pragmas in
+checks. You may modify them using either ``Suppress`` (to remove
+checks) or ``Unsuppress`` (to add back suppressed checks) pragmas in
the program source.
.. _Using_gcc_for_Syntax_Checking:
-Using *gcc* for Syntax Checking
--------------------------------
+Using ``gcc`` for Syntax Checking
+---------------------------------
.. index:: -gnats (gcc)
-:samp:`-gnats`
- The `s` stands for 'syntax'.
+:switch:`-gnats`
+ The ``s`` stands for 'syntax'.
Run GNAT in syntax checking only mode. For
example, the command
@@ -5144,11 +5208,11 @@ Using *gcc* for Syntax Checking
compiles file :file:`x.adb` in syntax-check-only mode. You can check a
series of files in a single command
, and can use wild cards to specify such a group of files.
- Note that you must specify the *-c* (compile
- only) flag in addition to the *-gnats* flag.
+ Note that you must specify the :switch:`-c` (compile
+ only) flag in addition to the :switch:`-gnats` flag.
- You may use other switches in conjunction with *-gnats*. In
- particular, *-gnatl* and *-gnatv* are useful to control the
+ You may use other switches in conjunction with :switch:`-gnats`. In
+ particular, :switch:`-gnatl` and :switch:`-gnatv` are useful to control the
format of any generated error messages.
When the source file is empty or contains only empty lines and/or comments,
@@ -5164,30 +5228,30 @@ Using *gcc* for Syntax Checking
Otherwise, the output is simply the error messages, if any. No object file or
ALI file is generated by a syntax-only compilation. Also, no units other
- than the one specified are accessed. For example, if a unit `X`
- |withs| a unit `Y`, compiling unit `X` in syntax
+ than the one specified are accessed. For example, if a unit ``X``
+ |withs| a unit ``Y``, compiling unit ``X`` in syntax
check only mode does not access the source file containing unit
- `Y`.
+ ``Y``.
.. index:: Multiple units, syntax checking
Normally, GNAT allows only a single unit in a source file. However, this
restriction does not apply in syntax-check-only mode, and it is possible
to check a file containing multiple compilation units concatenated
- together. This is primarily used by the `gnatchop` utility
+ together. This is primarily used by the ``gnatchop`` utility
(:ref:`Renaming_Files_with_gnatchop`).
.. _Using_gcc_for_Semantic_Checking:
-Using *gcc* for Semantic Checking
----------------------------------
+Using ``gcc`` for Semantic Checking
+-----------------------------------
.. index:: -gnatc (gcc)
-:samp:`-gnatc`
- The `c` stands for 'check'.
+:switch:`-gnatc`
+ The ``c`` stands for 'check'.
Causes the compiler to operate in semantic check mode,
with full checking for all illegalities specified in the
Ada Reference Manual, but without generation of any object code
@@ -5231,10 +5295,10 @@ indicate Ada 83 compatibility mode.
.. index:: ACVC, Ada 83 tests
.. index:: Ada 83 mode
-:samp:`-gnat83` (Ada 83 Compatibility Mode)
+:switch:`-gnat83` (Ada 83 Compatibility Mode)
Although GNAT is primarily an Ada 95 / Ada 2005 compiler, this switch
specifies that the program is to be compiled in Ada 83 mode. With
- *-gnat83*, GNAT rejects most post-Ada 83 extensions and applies Ada 83
+ :switch:`-gnat83`, GNAT rejects most post-Ada 83 extensions and applies Ada 83
semantics where this can be done easily.
It is not possible to guarantee this switch does a perfect
job; some subtle tests, such as are
@@ -5244,35 +5308,35 @@ indicate Ada 83 compatibility mode.
where, due to contractual reasons, existing code needs to be maintained
using only Ada 83 features.
- With few exceptions (most notably the need to use `<>` on
+ With few exceptions (most notably the need to use ``<>`` on
unconstrained :index:`generic formal parameters <Generic formal parameters>`,
the use of the new Ada 95 / Ada 2005
reserved words, and the use of packages
with optional bodies), it is not necessary to specify the
- *-gnat83* switch when compiling Ada 83 programs, because, with rare
+ :switch:`-gnat83` switch when compiling Ada 83 programs, because, with rare
exceptions, Ada 95 and Ada 2005 are upwardly compatible with Ada 83. Thus
a correct Ada 83 program is usually also a correct program
in these later versions of the language standard. For further information
- please refer to the `Compatibility_and_Porting_Guide` chapter in the
+ please refer to the *Compatibility and Porting Guide* chapter in the
:title:`GNAT Reference Manual`.
.. index:: -gnat95 (gcc)
.. index:: Ada 95 mode
-:samp:`-gnat95` (Ada 95 mode)
+:switch:`-gnat95` (Ada 95 mode)
This switch directs the compiler to implement the Ada 95 version of the
language.
Since Ada 95 is almost completely upwards
compatible with Ada 83, Ada 83 programs may generally be compiled using
- this switch (see the description of the *-gnat83* switch for further
+ this switch (see the description of the :switch:`-gnat83` switch for further
information about Ada 83 mode).
If an Ada 2005 program is compiled in Ada 95 mode,
uses of the new Ada 2005 features will cause error
messages or warnings.
This switch also can be used to cancel the effect of a previous
- *-gnat83*, *-gnat05/2005*, or *-gnat12/2012*
+ :switch:`-gnat83`, :switch:`-gnat05/2005`, or :switch:`-gnat12/2012`
switch earlier in the command line.
@@ -5280,13 +5344,13 @@ indicate Ada 83 compatibility mode.
.. index:: -gnat2005 (gcc)
.. index:: Ada 2005 mode
-:samp:`-gnat05` or :samp:`-gnat2005` (Ada 2005 mode)
+:switch:`-gnat05` or :switch:`-gnat2005` (Ada 2005 mode)
This switch directs the compiler to implement the Ada 2005 version of the
language, as documented in the official Ada standards document.
Since Ada 2005 is almost completely upwards
compatible with Ada 95 (and thus also with Ada 83), Ada 83 and Ada 95 programs
may generally be compiled using this switch (see the description of the
- *-gnat83* and *-gnat95* switches for further
+ :switch:`-gnat83` and :switch:`-gnat95` switches for further
information).
@@ -5294,14 +5358,14 @@ indicate Ada 83 compatibility mode.
.. index:: -gnat2012 (gcc)
.. index:: Ada 2012 mode
-:samp:`-gnat12` or :samp:`-gnat2012` (Ada 2012 mode)
+:switch:`-gnat12` or :switch:`-gnat2012` (Ada 2012 mode)
This switch directs the compiler to implement the Ada 2012 version of the
language (also the default).
Since Ada 2012 is almost completely upwards
compatible with Ada 2005 (and thus also with Ada 83, and Ada 95),
Ada 83 and Ada 95 programs
may generally be compiled using this switch (see the description of the
- *-gnat83*, *-gnat95*, and *-gnat05/2005* switches
+ :switch:`-gnat83`, :switch:`-gnat95`, and :switch:`-gnat05/2005` switches
for further information).
@@ -5309,7 +5373,7 @@ indicate Ada 83 compatibility mode.
.. index:: Ada language extensions
.. index:: GNAT extensions
-:samp:`-gnatX` (Enable GNAT Extensions)
+:switch:`-gnatX` (Enable GNAT Extensions)
This switch directs the compiler to implement the latest version of the
language (currently Ada 2012) and also to enable certain GNAT implementation
extensions that are not part of any Ada standard. For a full list of these
@@ -5323,11 +5387,11 @@ Character Set Control
.. index:: -gnati (gcc)
-:samp:`-gnati{c}`
+:switch:`-gnati{c}`
Normally GNAT recognizes the Latin-1 character set in source program
identifiers, as described in the Ada Reference Manual.
This switch causes
- GNAT to recognize alternate character sets in identifiers. `c` is a
+ GNAT to recognize alternate character sets in identifiers. ``c`` is a
single character indicating the character set, as follows:
========== ======================================================
@@ -5351,9 +5415,9 @@ Character Set Control
.. index:: -gnatW (gcc)
-:samp:`-gnatW{e}`
+:switch:`-gnatW{e}`
Specify the method of encoding for wide characters.
- `e` is one of the following:
+ ``e`` is one of the following:
========== ======================================================
*h* Hex encoding (brackets coding also recognized)
@@ -5367,7 +5431,7 @@ Character Set Control
For full details on these encoding
methods see :ref:`Wide_Character_Encodings`.
Note that brackets coding is always accepted, even if one of the other
- options is specified, so for example *-gnatW8* specifies that both
+ options is specified, so for example :switch:`-gnatW8` specifies that both
brackets and UTF-8 encodings will be recognized. The units that are
with'ed directly or indirectly will be scanned using the specified
representation scheme, and so if one of the non-brackets scheme is
@@ -5380,7 +5444,7 @@ Character Set Control
brackets are considered to be normal graphic characters, and bracket sequences
are never recognized as wide characters.
- If no *-gnatW?* parameter is present, then the default
+ If no :switch:`-gnatW?` parameter is present, then the default
representation is normally Brackets encoding only. However, if the
first three characters of the file are 16#EF# 16#BB# 16#BF# (the standard
byte order mark or BOM for UTF-8), then these three characters are
@@ -5392,7 +5456,7 @@ Character Set Control
parameter.
-When no *-gnatW?* is specified, then characters (other than wide
+When no :switch:`-gnatW?` is specified, then characters (other than wide
characters represented using brackets notation) are treated as 8-bit
Latin-1 codes. The codes recognized are the Latin-1 graphic characters,
and ASCII format effectors (CR, LF, HT, VT). Other lower half control
@@ -5419,8 +5483,8 @@ File Naming Control
.. index:: -gnatk (gcc)
-:samp:`-gnatk{n}`
- Activates file name 'krunching'. `n`, a decimal integer in the range
+:switch:`-gnatk{n}`
+ Activates file name 'krunching'. ``n``, a decimal integer in the range
1-999, indicates the maximum allowable length of a file name (not
including the :file:`.ads` or :file:`.adb` extension). The default is not
to enable file name krunching.
@@ -5434,24 +5498,24 @@ Subprogram Inlining Control
.. index:: -gnatn (gcc)
-:samp:`-gnatn[12]`
- The `n` here is intended to suggest the first syllable of the word 'inline'.
- GNAT recognizes and processes `Inline` pragmas. However, for inlining to
+:switch:`-gnatn[12]`
+ The ``n`` here is intended to suggest the first syllable of the word 'inline'.
+ GNAT recognizes and processes ``Inline`` pragmas. However, for inlining to
actually occur, optimization must be enabled and, by default, inlining of
subprograms across modules is not performed. If you want to additionally
- enable inlining of subprograms specified by pragma `Inline` across modules,
+ enable inlining of subprograms specified by pragma ``Inline`` across modules,
you must also specify this switch.
In the absence of this switch, GNAT does not attempt inlining across modules
- and does not access the bodies of subprograms for which `pragma Inline` is
+ and does not access the bodies of subprograms for which ``pragma Inline`` is
specified if they are not in the current unit.
You can optionally specify the inlining level: 1 for moderate inlining across
modules, which is a good compromise between compilation times and performances
at run time, or 2 for full inlining across modules, which may bring about
longer compilation times. If no inlining level is specified, the compiler will
- pick it based on the optimization level: 1 for *-O1*, *-O2* or
- *-Os* and 2 for *-O3*.
+ pick it based on the optimization level: 1 for :switch:`-O1`, :switch:`-O2` or
+ :switch:`-Os` and 2 for :switch:`-O3`.
If you specify this switch the compiler will access these bodies,
creating an extra source dependency for the resulting object file, and
@@ -5462,13 +5526,13 @@ Subprogram Inlining Control
.. index:: -gnatN (gcc)
-:samp:`-gnatN`
+:switch:`-gnatN`
This switch activates front-end inlining which also
generates additional dependencies.
When using a gcc-based back end (in practice this means using any version
of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of
- *-gnatN* is deprecated, and the use of *-gnatn* is preferred.
+ :switch:`-gnatN` is deprecated, and the use of :switch:`-gnatn` is preferred.
Historically front end inlining was more extensive than the gcc back end
inlining, but that is no longer the case.
@@ -5481,20 +5545,20 @@ Auxiliary Output Control
.. index:: Writing internal trees
.. index:: Internal trees, writing to file
-:samp:`-gnatt`
+:switch:`-gnatt`
Causes GNAT to write the internal tree for a unit to a file (with the
extension :file:`.adt`.
This not normally required, but is used by separate analysis tools.
Typically
these tools do the necessary compilations automatically, so you should
not have to specify this switch in normal operation.
- Note that the combination of switches *-gnatct*
+ Note that the combination of switches :switch:`-gnatct`
generates a tree in the form required by ASIS applications.
.. index:: -gnatu (gcc)
-:samp:`-gnatu`
+:switch:`-gnatu`
Print a list of units required by this compilation on :file:`stdout`.
The listing includes all units on which the unit being compiled depends
either directly or indirectly.
@@ -5502,12 +5566,12 @@ Auxiliary Output Control
.. index:: -pass-exit-codes (gcc)
-:samp:`-pass-exit-codes`
- If this switch is not used, the exit code returned by *gcc* when
+:switch:`-pass-exit-codes`
+ If this switch is not used, the exit code returned by ``gcc`` when
compiling multiple files indicates whether all source files have
been successfully used to generate object files or not.
- When *-pass-exit-codes* is used, *gcc* exits with an extended
+ When :switch:`-pass-exit-codes` is used, ``gcc`` exits with an extended
exit status and allows an integrated development environment to better
react to a compilation failure. Those exit status are:
@@ -5528,18 +5592,18 @@ Debugging Control
.. index:: -gnatd (gcc)
-:samp:`-gnatd{x}`
- Activate internal debugging switches. `x` is a letter or digit, or
+:switch:`-gnatd{x}`
+ Activate internal debugging switches. ``x`` is a letter or digit, or
string of letters or digits, which specifies the type of debugging
outputs desired. Normally these are used only for internal development
or system debugging purposes. You can find full documentation for these
- switches in the body of the `Debug` unit in the compiler source
+ switches in the body of the ``Debug`` unit in the compiler source
file :file:`debug.adb`.
.. index:: -gnatG (gcc)
-:samp:`-gnatG[={nn}]`
+:switch:`-gnatG[={nn}]`
This switch causes the compiler to generate auxiliary output containing
a pseudo-source listing of the generated expanded code. Like most Ada
compilers, GNAT works by first transforming the high level Ada code into
@@ -5549,11 +5613,11 @@ Debugging Control
This is very useful in understanding the implications of various Ada
usage on the efficiency of the generated code. There are many cases in
Ada (e.g., the use of controlled types), where simple Ada statements can
- generate a lot of run-time code. By using *-gnatG* you can identify
+ generate a lot of run-time code. By using :switch:`-gnatG` you can identify
these cases, and consider whether it may be desirable to modify the coding
approach to improve efficiency.
- The optional parameter `nn` if present after -gnatG specifies an
+ The optional parameter ``nn`` if present after -gnatG specifies an
alternative maximum line length that overrides the normal default of 72.
This value is in the range 40-999999, values less than 40 being silently
reset to 40. The equal sign is optional.
@@ -5563,12 +5627,12 @@ Debugging Control
additions correspond to low level features used in the generated code that
do not have any exact analogies in pure Ada source form. The following
is a partial list of these special constructions. See the spec
- of package `Sprint` in file :file:`sprint.ads` for a full list.
+ of package ``Sprint`` in file :file:`sprint.ads` for a full list.
.. index:: -gnatL (gcc)
- If the switch *-gnatL* is used in conjunction with
- *-gnatG*, then the original source lines are interspersed
+ If the switch :switch:`-gnatL` is used in conjunction with
+ :switch:`-gnatG`, then the original source lines are interspersed
in the expanded source (as comment lines with the original line number).
:samp:`new {xxx} [storage_pool = {yyy}]`
@@ -5580,7 +5644,7 @@ Debugging Control
:samp:`(if {expr} then {expr} else {expr})`
- Conditional expression equivalent to the `x?y:z` construction in C.
+ Conditional expression equivalent to the ``x?y:z`` construction in C.
:samp:`{target}^({source})`
@@ -5608,7 +5672,7 @@ Debugging Control
:samp:`free {expr} [storage_pool = {xxx}]`
- Shows the storage pool associated with a `free` statement.
+ Shows the storage pool associated with a ``free`` statement.
:samp:`[subtype or type declaration]`
@@ -5617,12 +5681,12 @@ Debugging Control
:samp:`freeze {type-name} [{actions}]`
- Shows the point at which `type-name` is frozen, with possible
+ Shows the point at which ``type-name`` is frozen, with possible
associated actions to be performed at the freeze point.
:samp:`reference {itype}`
- Reference (and hence definition) to internal type `itype`.
+ Reference (and hence definition) to internal type ``itype``.
:samp:`{function-name}! ({arg}, {arg}, {arg})`
@@ -5630,7 +5694,7 @@ Debugging Control
:samp:`{label-name} : label`
- Declaration of label `labelname`.
+ Declaration of label ``labelname``.
:samp:`#$ {subprogram-name}`
@@ -5640,12 +5704,12 @@ Debugging Control
:samp:`{expr} && {expr} && {expr} ... && {expr}`
- A multiple concatenation (same effect as `expr` & `expr` &
- `expr`, but handled more efficiently).
+ A multiple concatenation (same effect as ``expr`` & ``expr`` &
+ ``expr``, but handled more efficiently).
:samp:`[constraint_error]`
- Raise the `Constraint_Error` exception.
+ Raise the ``Constraint_Error`` exception.
:samp:`{expression}'reference`
@@ -5653,7 +5717,7 @@ Debugging Control
:samp:`{target-type}!({source-expression})`
- An unchecked conversion of `source-expression` to `target-type`.
+ An unchecked conversion of ``source-expression`` to ``target-type``.
:samp:`[{numerator}/{denominator}]`
@@ -5664,35 +5728,35 @@ Debugging Control
.. index:: -gnatD (gcc)
-:samp:`-gnatD[=nn]`
- When used in conjunction with *-gnatG*, this switch causes
+:switch:`-gnatD[=nn]`
+ When used in conjunction with :switch:`-gnatG`, this switch causes
the expanded source, as described above for
- *-gnatG* to be written to files with names
+ :switch:`-gnatG` to be written to files with names
:file:`xxx.dg`, where :file:`xxx` is the normal file name,
instead of to the standard output file. For
example, if the source file name is :file:`hello.adb`, then a file
:file:`hello.adb.dg` will be written. The debugging
- information generated by the *gcc* *-g* switch
+ information generated by the ``gcc`` :switch:`-g` switch
will refer to the generated :file:`xxx.dg` file. This allows
you to do source level debugging using the generated code which is
sometimes useful for complex code, for example to find out exactly
which part of a complex construction raised an exception. This switch
also suppresses generation of cross-reference information (see
- *-gnatx*) since otherwise the cross-reference information
+ :switch:`-gnatx`) since otherwise the cross-reference information
would refer to the :file:`.dg` file, which would cause
confusion since this is not the original source file.
- Note that *-gnatD* actually implies *-gnatG*
+ Note that :switch:`-gnatD` actually implies :switch:`-gnatG`
automatically, so it is not necessary to give both options.
- In other words *-gnatD* is equivalent to *-gnatDG*).
+ In other words :switch:`-gnatD` is equivalent to :switch:`-gnatDG`).
.. index:: -gnatL (gcc)
- If the switch *-gnatL* is used in conjunction with
- *-gnatDG*, then the original source lines are interspersed
+ If the switch :switch:`-gnatL` is used in conjunction with
+ :switch:`-gnatDG`, then the original source lines are interspersed
in the expanded source (as comment lines with the original line number).
- The optional parameter `nn` if present after -gnatD specifies an
+ The optional parameter ``nn`` if present after -gnatD specifies an
alternative maximum line length that overrides the normal default of 72.
This value is in the range 40-999999, values less than 40 being silently
reset to 40. The equal sign is optional.
@@ -5701,7 +5765,7 @@ Debugging Control
.. index:: -gnatr (gcc)
.. index:: pragma Restrictions
-:samp:`-gnatr`
+:switch:`-gnatr`
This switch causes pragma Restrictions to be treated as Restriction_Warnings
so that violation of restrictions causes warnings rather than illegalities.
This is useful during the development process when new restrictions are added
@@ -5712,44 +5776,46 @@ Debugging Control
.. index:: -gnatR (gcc)
-:samp:`-gnatR[0|1|2|3[s]]`
+:switch:`-gnatR[0|1|2|3][e][m][s]`
This switch controls output from the compiler of a listing showing
- representation information for declared types and objects. For
- *-gnatR0*, no information is output (equivalent to omitting
- the *-gnatR* switch). For *-gnatR1* (which is the default,
- so *-gnatR* with no parameter has the same effect), size and alignment
- information is listed for declared array and record types. For
- *-gnatR2*, size and alignment information is listed for all
- declared types and objects. The `Linker_Section` is also listed for any
- entity for which the `Linker_Section` is set explicitly or implicitly (the
- latter case occurs for objects of a type for which a `Linker_Section`
+ representation information for declared types, objects and subprograms.
+ For :switch:`-gnatR0`, no information is output (equivalent to omitting
+ the :switch:`-gnatR` switch). For :switch:`-gnatR1` (which is the default,
+ so :switch:`-gnatR` with no parameter has the same effect), size and
+ alignment information is listed for declared array and record types.
+ For :switch:`-gnatR2`, size and alignment information is listed for all
+ declared types and objects. The ``Linker_Section`` is also listed for any
+ entity for which the ``Linker_Section`` is set explicitly or implicitly (the
+ latter case occurs for objects of a type for which a ``Linker_Section``
is set).
- Finally *-gnatR3* includes symbolic
- expressions for values that are computed at run time for
- variant records. These symbolic expressions have a mostly obvious
- format with #n being used to represent the value of the n'th
- discriminant. See source files :file:`repinfo.ads/adb` in the
- `GNAT` sources for full details on the format of *-gnatR3*
- output. If the switch is followed by an s (e.g., *-gnatR2s*), then
- the output is to a file with the name :file:`file.rep` where
- file is the name of the corresponding source file.
+ For :switch:`-gnatR3`, symbolic expressions for values that are computed
+ at run time for records are included. These symbolic expressions have
+ a mostly obvious format with #n being used to represent the value of the
+ n'th discriminant. See source files :file:`repinfo.ads/adb` in the
+ GNAT sources for full details on the format of :switch:`-gnatR3` output.
+
+ If the switch is followed by an ``e`` (e.g. :switch:`-gnatR2e`), then
+ extended representation information for record sub-components of records
+ are included.
+ If the switch is followed by an ``m`` (e.g. :switch:`-gnatRm`), then
+ subprogram conventions and parameter passing mechanisms for all the
+ subprograms are included.
-:samp:`-gnatRm[s]`
- This form of the switch controls output of subprogram conventions
- and parameter passing mechanisms for all subprograms. A following
- `s` means output to a file as described above.
+ If the switch is followed by an ``s`` (e.g., :switch:`-gnatR3s`), then
+ the output is to a file with the name :file:`file.rep` where file is
+ the name of the corresponding source file.
Note that it is possible for record components to have zero size. In
this case, the component clause uses an obvious extension of permitted
- Ada syntax, for example `at 0 range 0 .. -1`.
+ Ada syntax, for example ``at 0 range 0 .. -1``.
.. index:: -gnatS (gcc)
-:samp:`-gnatS`
- The use of the switch *-gnatS* for an
+:switch:`-gnatS`
+ The use of the switch :switch:`-gnatS` for an
Ada compilation will cause the compiler to output a
representation of package Standard in a form very
close to standard Ada. It is not quite possible to
@@ -5763,10 +5829,10 @@ Debugging Control
.. index:: -gnatx (gcc)
-:samp:`-gnatx`
+:switch:`-gnatx`
Normally the compiler generates full cross-referencing information in
the :file:`ALI` file. This information is used by a number of tools,
- including `gnatfind` and `gnatxref`. The *-gnatx* switch
+ including ``gnatfind`` and ``gnatxref``. The :switch:`-gnatx` switch
suppresses this information. This saves some space and may slightly
speed up compilation, but means that these tools cannot be used.
@@ -5776,7 +5842,7 @@ Exception Handling Control
--------------------------
GNAT uses two methods for handling exceptions at run-time. The
-`setjmp/longjmp` method saves the context when entering
+``setjmp/longjmp`` method saves the context when entering
a frame with an exception handler. Then when an exception is
raised, the context can be restored immediately, without the
need for tracing stack frames. This method provides very fast
@@ -5794,7 +5860,7 @@ the propagation of exceptions, but there is no overhead for
exception handlers if no exception is raised. Note that in this
mode and in the context of mixed Ada and C/C++ programming,
to propagate an exception through a C/C++ code, the C/C++ code
-must be compiled with the *-funwind-tables* GCC's
+must be compiled with the :switch:`-funwind-tables` GCC's
option.
The following switches may be used to control which of the
@@ -5804,7 +5870,7 @@ two exception handling methods is used.
.. index:: --RTS=sjlj (gnatmake)
-:samp:`--RTS=sjlj`
+:switch:`--RTS=sjlj`
This switch causes the setjmp/longjmp run-time (when available) to be used
for exception handling. If the default
mechanism for the target is zero cost exceptions, then
@@ -5819,7 +5885,7 @@ two exception handling methods is used.
.. index:: --RTS=zcx (gnatmake)
.. index:: Zero Cost Exceptions
-:samp:`--RTS=zcx`
+:switch:`--RTS=zcx`
This switch causes the zero cost approach to be used
for exception handling. If this is the default mechanism for the
target (see below), then this switch is unneeded. If the default
@@ -5829,8 +5895,8 @@ two exception handling methods is used.
This option can only be used if the zero cost approach
is available for the target in use, otherwise it will generate an error.
-The same option *--RTS* must be used both for *gcc*
-and *gnatbind*. Passing this option to *gnatmake*
+The same option :switch:`--RTS` must be used both for ``gcc``
+and ``gnatbind``. Passing this option to ``gnatmake``
(:ref:`Switches_for_gnatmake`) will ensure the required consistency
through the compilation and binding steps.
@@ -5843,7 +5909,7 @@ Units to Sources Mapping Files
.. index:: -gnatem (gcc)
-:samp:`-gnatem={path}`
+:switch:`-gnatem={path}`
A mapping file is a way to communicate to the compiler two mappings:
from unit names to file names (without any directory information) and from
file names to path names (with full directory information). These mappings
@@ -5853,15 +5919,15 @@ Units to Sources Mapping Files
compiler, but mapping files can improve efficiency, particularly when
sources are read over a slow network connection. In normal operation,
you need not be concerned with the format or use of mapping files,
- and the *-gnatem* switch is not a switch that you would use
+ and the :switch:`-gnatem` switch is not a switch that you would use
explicitly. It is intended primarily for use by automatic tools such as
- *gnatmake* running under the project file facility. The
+ ``gnatmake`` running under the project file facility. The
description here of the format of mapping files is provided
for completeness and for possible use by other tools.
A mapping file is a sequence of sets of three lines. In each set, the
- first line is the unit name, in lower case, with `%s` appended
- for specs and `%b` appended for bodies; the second line is the
+ first line is the unit name, in lower case, with ``%s`` appended
+ for specs and ``%b`` appended for bodies; the second line is the
file name; and the third line is the path name.
Example::
@@ -5871,15 +5937,15 @@ Units to Sources Mapping Files
/gnat/project1/sources/main.2.ada
- When the switch *-gnatem* is specified, the compiler will
+ When the switch :switch:`-gnatem` is specified, the compiler will
create in memory the two mappings from the specified file. If there is
any problem (nonexistent file, truncated file or duplicate entries),
no mapping will be created.
- Several *-gnatem* switches may be specified; however, only the
+ Several :switch:`-gnatem` switches may be specified; however, only the
last one on the command line will be taken into account.
- When using a project file, *gnatmake* creates a temporary
+ When using a project file, ``gnatmake`` creates a temporary
mapping file and communicates it to the compiler using this switch.
@@ -5889,27 +5955,27 @@ Code Generation Control
-----------------------
The GCC technology provides a wide range of target dependent
-:samp:`-m` switches for controlling
+:switch:`-m` switches for controlling
details of code generation with respect to different versions of
architectures. This includes variations in instruction sets (e.g.,
different members of the power pc family), and different requirements
for optimal arrangement of instructions (e.g., different members of
-the x86 family). The list of available *-m* switches may be
+the x86 family). The list of available :switch:`-m` switches may be
found in the GCC documentation.
-Use of these *-m* switches may in some cases result in improved
+Use of these :switch:`-m` switches may in some cases result in improved
code performance.
The GNAT technology is tested and qualified without any
-:samp:`-m` switches,
+:switch:`-m` switches,
so generally the most reliable approach is to avoid the use of these
switches. However, we generally expect most of these switches to work
successfully with GNAT, and many customers have reported successful
use of these options.
-Our general advice is to avoid the use of *-m* switches unless
+Our general advice is to avoid the use of :switch:`-m` switches unless
special needs lead to requirements in this area. In particular,
-there is no point in using *-m* switches to improve performance
+there is no point in using :switch:`-m` switches to improve performance
unless you actually see a performance improvement.
@@ -5918,11 +5984,11 @@ unless you actually see a performance improvement.
Linker Switches
===============
-Linker switches can be specified after :samp:`-largs` builder switch.
+Linker switches can be specified after :switch:`-largs` builder switch.
.. index:: -fuse-ld=name
-:samp:`-fuse-ld={name}`
+:switch:`-fuse-ld={name}`
Linker to be used. The default is ``bfd`` for :file:`ld.bfd`,
the alternative being ``gold`` for :file:`ld.gold`. The later is
a more recent and faster linker, but only available on GNU/Linux
@@ -5930,18 +5996,15 @@ Linker switches can be specified after :samp:`-largs` builder switch.
.. _Binding_with_gnatbind:
-Binding with `gnatbind`
-=======================
+Binding with ``gnatbind``
+=========================
.. index:: ! gnatbind
-This chapter describes the GNAT binder, `gnatbind`, which is used
+This chapter describes the GNAT binder, ``gnatbind``, which is used
to bind compiled GNAT objects.
-Note: to invoke `gnatbind` with a project file, use the `gnat`
-driver (see :ref:`The_GNAT_Driver_and_Project_Files`).
-
-The `gnatbind` program performs four separate functions:
+The ``gnatbind`` program performs four separate functions:
* Checks that a program is consistent, in accordance with the rules in
Chapter 10 of the Ada Reference Manual. In particular, error
@@ -5956,29 +6019,29 @@ The `gnatbind` program performs four separate functions:
This program is a small Ada package (body and spec) that
must be subsequently compiled
using the GNAT compiler. The necessary compilation step is usually
- performed automatically by *gnatlink*. The two most important
+ performed automatically by ``gnatlink``. The two most important
functions of this program
are to call the elaboration routines of units in an appropriate order
and to call the main program.
* Determines the set of object files required by the given main program.
This information is output in the forms of comments in the generated program,
- to be read by the *gnatlink* utility used to link the Ada application.
+ to be read by the ``gnatlink`` utility used to link the Ada application.
.. _Running_gnatbind:
-Running `gnatbind`
-------------------
+Running ``gnatbind``
+--------------------
-The form of the `gnatbind` command is
+The form of the ``gnatbind`` command is
.. code-block:: sh
- $ gnatbind [`switches`] `mainprog`[.ali] [`switches`]
+ $ gnatbind [ switches ] mainprog[.ali] [ switches ]
where :file:`mainprog.adb` is the Ada file containing the main program
-unit body. `gnatbind` constructs an Ada
+unit body. ``gnatbind`` constructs an Ada
package in two files whose names are
:file:`b~mainprog.ads`, and :file:`b~mainprog.adb`.
For example, if given the
@@ -5988,12 +6051,12 @@ and :file:`b~hello.adb`.
When doing consistency checking, the binder takes into consideration
any source files it can locate. For example, if the binder determines
-that the given main program requires the package `Pack`, whose
+that the given main program requires the package ``Pack``, whose
:file:`.ALI`
file is :file:`pack.ali` and whose corresponding source spec file is
:file:`pack.ads`, it attempts to locate the source file :file:`pack.ads`
(using the same search path conventions as previously described for the
-*gcc* command). If it can locate this source file, it checks that
+``gcc`` command). If it can locate this source file, it checks that
the time stamps
or source checksums of the source and its references to in :file:`ALI` files
match. In other words, any :file:`ALI` files that mentions this spec must have
@@ -6010,16 +6073,16 @@ source file without compiling files that depend on the source file cause
error messages to be generated by the binder.
For example, suppose you have a main program :file:`hello.adb` and a
-package `P`, from file :file:`p.ads` and you perform the following
+package ``P``, from file :file:`p.ads` and you perform the following
steps:
-* Enter `gcc -c hello.adb` to compile the main program.
+* Enter ``gcc -c hello.adb`` to compile the main program.
-* Enter `gcc -c p.ads` to compile package `P`.
+* Enter ``gcc -c p.ads`` to compile package ``P``.
* Edit file :file:`p.ads`.
-* Enter `gnatbind hello`.
+* Enter ``gnatbind hello``.
At this point, the file :file:`p.ali` contains an out-of-date time stamp
because the file :file:`p.ads` has been edited. The attempt at binding
@@ -6037,38 +6100,38 @@ succeed, generating a main program. You need not normally be concerned
with the contents of this file, but for reference purposes a sample
binder output file is given in :ref:`Example_of_Binder_Output_File`.
-In most normal usage, the default mode of *gnatbind* which is to
+In most normal usage, the default mode of ``gnatbind`` which is to
generate the main package in Ada, as described in the previous section.
In particular, this means that any Ada programmer can read and understand
the generated main program. It can also be debugged just like any other
-Ada code provided the *-g* switch is used for
-*gnatbind* and *gnatlink*.
+Ada code provided the :switch:`-g` switch is used for
+``gnatbind`` and ``gnatlink``.
.. _Switches_for_gnatbind:
-Switches for *gnatbind*
------------------------
+Switches for ``gnatbind``
+-------------------------
-The following switches are available with `gnatbind`; details will
+The following switches are available with ``gnatbind``; details will
be presented in subsequent sections.
.. index:: --version (gnatbind)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatbind)
-:samp:`--help`
- If *--version* was not used, display usage, then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage, then exit disregarding
all other options.
.. index:: -a (gnatbind)
-:samp:`-a`
+:switch:`-a`
Indicates that, if supported by the platform, the adainit procedure should
be treated as an initialisation routine by the linker (a constructor). This
is intended to be used by the Project Manager to automatically initialize
@@ -6077,41 +6140,41 @@ be presented in subsequent sections.
.. index:: -aO (gnatbind)
-:samp:`-aO`
+:switch:`-aO`
Specify directory to be searched for ALI files.
.. index:: -aI (gnatbind)
-:samp:`-aI`
+:switch:`-aI`
Specify directory to be searched for source file.
.. index:: -A (gnatbind)
-:samp:`-A[={filename}]`
+:switch:`-A[={filename}]`
Output ALI list (to standard output or to the named file).
.. index:: -b (gnatbind)
-:samp:`-b`
+:switch:`-b`
Generate brief messages to :file:`stderr` even if verbose mode set.
.. index:: -c (gnatbind)
-:samp:`-c`
+:switch:`-c`
Check only, no generation of binder output file.
.. index:: -dnn[k|m] (gnatbind)
-:samp:`-d{nn}[k|m]`
+:switch:`-d{nn}[k|m]`
This switch can be used to change the default task stack size value
- to a specified size `nn`, which is expressed in bytes by default, or
- in kilobytes when suffixed with `k` or in megabytes when suffixed
- with `m`.
+ to a specified size ``nn``, which is expressed in bytes by default, or
+ in kilobytes when suffixed with ``k`` or in megabytes when suffixed
+ with ``m``.
In the absence of a :samp:`[k|m]` suffix, this switch is equivalent,
in effect, to completing all task specs with
@@ -6124,11 +6187,11 @@ be presented in subsequent sections.
.. index:: -D (gnatbind)
-:samp:`-D{nn}[k|m]`
+:switch:`-D{nn}[k|m]`
This switch can be used to change the default secondary stack size value
- to a specified size `nn`, which is expressed in bytes by default, or
- in kilobytes when suffixed with `k` or in megabytes when suffixed
- with `m`.
+ to a specified size ``nn``, which is expressed in bytes by default, or
+ in kilobytes when suffixed with ``k`` or in megabytes when suffixed
+ with ``m``.
The secondary stack is used to deal with functions that return a variable
sized result, for example a function returning an unconstrained
@@ -6141,54 +6204,54 @@ be presented in subsequent sections.
and the actual size needed for the current allocation request).
For certain targets, notably VxWorks 653 and bare board targets,
- the secondary stack is allocated by carving off a chunk of the primary task
+ the secondary stack is allocated by carving off a chunk of the primary task
stack. By default this is a fixed percentage of the primary task stack as
- defined by System.Parameter.Sec_Stack_Percentage. This can be overridden per
+ defined by System.Parameter.Sec_Stack_Percentage. This can be overridden per
task using the Secondary_Stack_Size pragma/aspect. The -D option is used to
define the size of the environment task's secondary stack.
.. index:: -e (gnatbind)
-:samp:`-e`
+:switch:`-e`
Output complete list of elaboration-order dependencies.
.. index:: -Ea (gnatbind)
-:samp:`-Ea`
+:switch:`-Ea`
Store tracebacks in exception occurrences when the target supports it.
The "a" is for "address"; tracebacks will contain hexadecimal addresses,
unless symbolic tracebacks are enabled.
- See also the packages `GNAT.Traceback` and
- `GNAT.Traceback.Symbolic` for more information.
- Note that on x86 ports, you must not use *-fomit-frame-pointer*
- *gcc* option.
+ See also the packages ``GNAT.Traceback`` and
+ ``GNAT.Traceback.Symbolic`` for more information.
+ Note that on x86 ports, you must not use :switch:`-fomit-frame-pointer`
+ ``gcc`` option.
.. index:: -Es (gnatbind)
-:samp:`-Es`
+:switch:`-Es`
Store tracebacks in exception occurrences when the target supports it.
The "s" is for "symbolic"; symbolic tracebacks are enabled.
.. index:: -E (gnatbind)
-:samp:`-E`
- Currently the same as `-Ea`.
+:switch:`-E`
+ Currently the same as ``-Ea``.
.. index:: -f (gnatbind)
-:samp:`-f{elab-order}`
+:switch:`-f{elab-order}`
Force elaboration order.
.. index:: -F (gnatbind)
-:samp:`-F`
- Force the checks of elaboration flags. *gnatbind* does not normally
+:switch:`-F`
+ Force the checks of elaboration flags. ``gnatbind`` does not normally
generate checks of elaboration flags for the main executable, except when
a Stand-Alone Library is used. However, there are cases when this cannot be
detected by gnatbind. An example is importing an interface of a Stand-Alone
@@ -6199,67 +6262,67 @@ be presented in subsequent sections.
.. index:: -h (gnatbind)
-:samp:`-h`
+:switch:`-h`
Output usage (help) information.
.. index:: -H32 (gnatbind)
-:samp:`-H32`
- Use 32-bit allocations for `__gnat_malloc` (and thus for access types).
+:switch:`-H32`
+ Use 32-bit allocations for ``__gnat_malloc`` (and thus for access types).
For further details see :ref:`Dynamic_Allocation_Control`.
.. index:: -H64 (gnatbind)
.. index:: __gnat_malloc
-:samp:`-H64`
- Use 64-bit allocations for `__gnat_malloc` (and thus for access types).
+:switch:`-H64`
+ Use 64-bit allocations for ``__gnat_malloc`` (and thus for access types).
For further details see :ref:`Dynamic_Allocation_Control`.
.. index:: -I (gnatbind)
-:samp:`-I`
+:switch:`-I`
Specify directory to be searched for source and ALI files.
.. index:: -I- (gnatbind)
-:samp:`-I-`
- Do not look for sources in the current directory where `gnatbind` was
+:switch:`-I-`
+ Do not look for sources in the current directory where ``gnatbind`` was
invoked, and do not look for ALI files in the directory containing the
- ALI file named in the `gnatbind` command line.
+ ALI file named in the ``gnatbind`` command line.
.. index:: -l (gnatbind)
-:samp:`-l`
+:switch:`-l`
Output chosen elaboration order.
.. index:: -L (gnatbind)
-:samp:`-L{xxx}`
- Bind the units for library building. In this case the adainit and
- adafinal procedures (:ref:`Binding_with_Non-Ada_Main_Programs`)
- are renamed to `xxx`init and
- `xxx`final.
+:switch:`-L{xxx}`
+ Bind the units for library building. In this case the ``adainit`` and
+ ``adafinal`` procedures (:ref:`Binding_with_Non-Ada_Main_Programs`)
+ are renamed to :samp:`{xxx}init` and
+ :samp:`{xxx}final`.
Implies -n.
(:ref:`GNAT_and_Libraries`, for more details.)
.. index:: -M (gnatbind)
-:samp:`-M{xyz}`
+:switch:`-M{xyz}`
Rename generated main program from main to xyz. This option is
supported on cross environments only.
.. index:: -m (gnatbind)
-:samp:`-m{n}`
- Limit number of detected errors or warnings to `n`, where `n` is
+:switch:`-m{n}`
+ Limit number of detected errors or warnings to ``n``, where ``n`` is
in the range 1..999999. The default value if no switch is
given is 9999. If the number of warnings reaches this limit, then a
message is output and further warnings are suppressed, the bind
@@ -6271,79 +6334,79 @@ be presented in subsequent sections.
.. index:: -n (gnatbind)
-:samp:`-n`
+:switch:`-n`
No main program.
.. index:: -nostdinc (gnatbind)
-:samp:`-nostdinc`
+:switch:`-nostdinc`
Do not look for sources in the system default directory.
.. index:: -nostdlib (gnatbind)
-:samp:`-nostdlib`
+:switch:`-nostdlib`
Do not look for library files in the system default directory.
.. index:: --RTS (gnatbind)
-:samp:`--RTS={rts-path}`
+:switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`).
.. index:: -o (gnatbind)
-:samp:`-o {file}`
- Name the output file `file` (default is :file:`b~`xxx`.adb`).
+:switch:`-o {file}`
+ Name the output file ``file`` (default is :file:`b~`xxx`.adb`).
Note that if this option is used, then linking must be done manually,
gnatlink cannot be used.
.. index:: -O (gnatbind)
-:samp:`-O[={filename}]`
+:switch:`-O[={filename}]`
Output object list (to standard output or to the named file).
.. index:: -p (gnatbind)
-:samp:`-p`
+:switch:`-p`
Pessimistic (worst-case) elaboration order.
.. index:: -P (gnatbind)
-:samp:`-P`
+:switch:`-P`
Generate binder file suitable for CodePeer.
.. index:: -R (gnatbind)
-:samp:`-R`
+:switch:`-R`
Output closure source list, which includes all non-run-time units that are
included in the bind.
.. index:: -Ra (gnatbind)
-:samp:`-Ra`
- Like *-R* but the list includes run-time units.
+:switch:`-Ra`
+ Like :switch:`-R` but the list includes run-time units.
.. index:: -s (gnatbind)
-:samp:`-s`
+:switch:`-s`
Require all source files to be present.
.. index:: -S (gnatbind)
-:samp:`-S{xxx}`
+:switch:`-S{xxx}`
Specifies the value to be used when detecting uninitialized scalar
objects with pragma Initialize_Scalars.
- The `xxx` string specified with the switch is one of:
+ The ``xxx`` string specified with the switch is one of:
* ``in`` for an invalid value.
@@ -6375,7 +6438,7 @@ be presented in subsequent sections.
one bits. For floating-point, a large value is set
(see body of package System.Scalar_Values for exact values).
- * `xx` for hex value (two hex digits).
+ * ``xx`` for hex value (two hex digits).
The underlying scalar is set to a value consisting of repeated bytes, whose
value corresponds to the given value. For example if ``BF`` is given,
@@ -6383,35 +6446,35 @@ be presented in subsequent sections.
.. index:: GNAT_INIT_SCALARS
- In addition, you can specify *-Sev* to indicate that the value is
+ In addition, you can specify :switch:`-Sev` to indicate that the value is
to be set at run time. In this case, the program will look for an environment
- variable of the form :samp:`GNAT_INIT_SCALARS={yy}`, where `yy` is one
- of *in/lo/hi/`xx*` with the same meanings as above.
+ variable of the form :samp:`GNAT_INIT_SCALARS={yy}`, where ``yy`` is one
+ of :samp:`in/lo/hi/{xx}` with the same meanings as above.
If no environment variable is found, or if it does not have a valid value,
- then the default is *in* (invalid values).
+ then the default is ``in`` (invalid values).
.. index:: -static (gnatbind)
-:samp:`-static`
+:switch:`-static`
Link against a static GNAT run time.
.. index:: -shared (gnatbind)
-:samp:`-shared`
+:switch:`-shared`
Link against a shared GNAT run time when available.
.. index:: -t (gnatbind)
-:samp:`-t`
+:switch:`-t`
Tolerate time stamp and other consistency errors.
.. index:: -T (gnatbind)
-:samp:`-T{n}`
- Set the time slice value to `n` milliseconds. If the system supports
+:switch:`-T{n}`
+ Set the time slice value to ``n`` milliseconds. If the system supports
the specification of a specific time slice value, then the indicated value
is used. If the system does not support specific time slice values, but
does support some general notion of round-robin scheduling, then any
@@ -6421,13 +6484,13 @@ be presented in subsequent sections.
slicing, and in addition, indicates to the tasking run time that the
semantics should match as closely as possible the Annex D
requirements of the Ada RM, and in particular sets the default
- scheduling policy to `FIFO_Within_Priorities`.
+ scheduling policy to ``FIFO_Within_Priorities``.
.. index:: -u (gnatbind)
-:samp:`-u{n}`
- Enable dynamic stack usage, with `n` results stored and displayed
+:switch:`-u{n}`
+ Enable dynamic stack usage, with ``n`` results stored and displayed
at program termination. A result is generated when a task
terminates. Results that can't be stored are displayed on the fly, at
task termination. This option is currently not supported on Itanium
@@ -6436,55 +6499,55 @@ be presented in subsequent sections.
.. index:: -v (gnatbind)
-:samp:`-v`
+:switch:`-v`
Verbose mode. Write error messages, header, summary output to
:file:`stdout`.
.. index:: -V (gnatbind)
-:samp:`-V{key}={value}`
- Store the given association of `key` to `value` in the bind environment.
+:switch:`-V{key}={value}`
+ Store the given association of ``key`` to ``value`` in the bind environment.
Values stored this way can be retrieved at run time using
- `GNAT.Bind_Environment`.
+ ``GNAT.Bind_Environment``.
.. index:: -w (gnatbind)
-:samp:`-w{x}`
- Warning mode; `x` = s/e for suppress/treat as error.
+:switch:`-w{x}`
+ Warning mode; ``x`` = s/e for suppress/treat as error.
.. index:: -Wx (gnatbind)
-:samp:`-Wx{e}`
+:switch:`-Wx{e}`
Override default wide character encoding for standard Text_IO files.
.. index:: -x (gnatbind)
-:samp:`-x`
+:switch:`-x`
Exclude source files (check object consistency only).
.. index:: -Xnnn (gnatbind)
-:samp:`-X{nnn}`
+:switch:`-X{nnn}`
Set default exit status value, normally 0 for POSIX compliance.
.. index:: -y (gnatbind)
-:samp:`-y`
- Enable leap seconds support in `Ada.Calendar` and its children.
+:switch:`-y`
+ Enable leap seconds support in ``Ada.Calendar`` and its children.
.. index:: -z (gnatbind)
-:samp:`-z`
+:switch:`-z`
No main subprogram.
-You may obtain this listing of switches by running `gnatbind` with
+You may obtain this listing of switches by running ``gnatbind`` with
no arguments.
@@ -6493,7 +6556,7 @@ no arguments.
Consistency-Checking Modes
^^^^^^^^^^^^^^^^^^^^^^^^^^
-As described earlier, by default `gnatbind` checks
+As described earlier, by default ``gnatbind`` checks
that object files are consistent with one another and are consistent
with any source files it can locate. The following switches control binder
access to sources.
@@ -6501,7 +6564,7 @@ access to sources.
.. index:: -s (gnatbind)
-:samp:`-s`
+:switch:`-s`
Require source files to be present. In this mode, the binder must be
able to locate all source files that are referenced, in order to check
their consistency. In normal mode, if a source file cannot be located it
@@ -6511,19 +6574,19 @@ access to sources.
.. index:: -Wx (gnatbind)
-:samp:`-Wx{e}`
+:switch:`-Wx{e}`
Override default wide character encoding for standard Text_IO files.
Normally the default wide character encoding method used for standard
[Wide\_[Wide\_]]Text_IO files is taken from the encoding specified for
the main source input (see description of switch
- *-gnatWx* for the compiler). The
+ :switch:`-gnatWx` for the compiler). The
use of this switch for the binder (which has the same set of
possible arguments) overrides this default as specified.
.. index:: -x (gnatbind)
-:samp:`-x`
+:switch:`-x`
Exclude source files. In this mode, the binder only checks that ALI
files are consistent with one another. Source files are not accessed.
The binder runs faster in this mode, and there is still a guarantee that
@@ -6531,9 +6594,9 @@ access to sources.
If a source file has been edited since it was last compiled, and you
specify this switch, the binder will not detect that the object
file is out of date with respect to the source file. Note that this is the
- mode that is automatically used by *gnatmake* because in this
+ mode that is automatically used by ``gnatmake`` because in this
case the checking against sources has already been performed by
- *gnatmake* in the course of compilation (i.e., before binding).
+ ``gnatmake`` in the course of compilation (i.e., before binding).
.. _Binder_Error_Message_Control:
@@ -6548,7 +6611,7 @@ messages from the binder:
.. index:: -v (gnatbind)
-:samp:`-v`
+:switch:`-v`
Verbose mode. In the normal mode, brief error messages are generated to
:file:`stderr`. If this switch is present, a header is written
to :file:`stdout` and any error messages are directed to :file:`stdout`.
@@ -6557,38 +6620,38 @@ messages from the binder:
.. index:: -b (gnatbind)
-:samp:`-b`
+:switch:`-b`
Generate brief error messages to :file:`stderr` even if verbose mode is
specified. This is relevant only when used with the
- *-v* switch.
+ :switch:`-v` switch.
.. index:: -m (gnatbind)
-:samp:`-m{n}`
- Limits the number of error messages to `n`, a decimal integer in the
+:switch:`-m{n}`
+ Limits the number of error messages to ``n``, a decimal integer in the
range 1-999. The binder terminates immediately if this limit is reached.
.. index:: -M (gnatbind)
-:samp:`-M{xxx}`
- Renames the generated main program from `main` to `xxx`.
+:switch:`-M{xxx}`
+ Renames the generated main program from ``main`` to ``xxx``.
This is useful in the case of some cross-building environments, where
the actual main program is separate from the one generated
- by `gnatbind`.
+ by ``gnatbind``.
.. index:: -ws (gnatbind)
.. index:: Warnings
-:samp:`-ws`
+:switch:`-ws`
Suppress all warning messages.
.. index:: -we (gnatbind)
-:samp:`-we`
+:switch:`-we`
Treat any warning messages as fatal errors.
@@ -6597,7 +6660,7 @@ messages from the binder:
.. index:: Binder consistency checks
.. index:: Consistency checks, in binder
-:samp:`-t`
+:switch:`-t`
The binder performs a number of consistency checks including:
@@ -6605,7 +6668,7 @@ messages from the binder:
* Check that checksums of a given source unit are consistent
- * Check that consistent versions of `GNAT` were used for compilation
+ * Check that consistent versions of ``GNAT`` were used for compilation
* Check consistency of configuration pragmas as required
@@ -6614,7 +6677,7 @@ messages from the binder:
generated which abort the binder and prevent the output of a binder
file and subsequent link to obtain an executable.
- The *-t* switch converts these error messages
+ The :switch:`-t` switch converts these error messages
into warnings, so that
binding and linking can continue to completion even in the presence of such
errors. The result may be a failed link (due to missing symbols), or a
@@ -6622,7 +6685,7 @@ messages from the binder:
.. note::
- This means that *-t* should be used only in unusual situations,
+ This means that :switch:`-t` should be used only in unusual situations,
with extreme care.
.. _Elaboration_Control:
@@ -6636,10 +6699,10 @@ order. For full details see :ref:`Elaboration_Order_Handling_in_GNAT`.
.. index:: -f (gnatbind)
-:samp:`-f{elab-order}`
+:switch:`-f{elab-order}`
Force elaboration order.
- `elab-order` should be the name of a "forced elaboration order file", that
+ ``elab-order`` should be the name of a "forced elaboration order file", that
is, a text file containing library item names, one per line. A name of the
form "some.unit%s" or "some.unit (spec)" denotes the spec of Some.Unit. A
name of the form "some.unit%b" or "some.unit (body)" denotes the body of
@@ -6660,7 +6723,7 @@ order. For full details see :ref:`Elaboration_Order_Handling_in_GNAT`.
dependences are already required by Ada rules, so this file is really just
forcing the body of This to be elaborated before the spec of That.
- The given order must be consistent with Ada rules, or else `gnatbind` will
+ The given order must be consistent with Ada rules, or else ``gnatbind`` will
give elaboration cycle errors. For example, if you say x (body) should be
elaborated before x (spec), there will be a cycle, because Ada rules require
x (spec) to be elaborated before x (body); you can't have the spec and body
@@ -6677,25 +6740,25 @@ order. For full details see :ref:`Elaboration_Order_Handling_in_GNAT`.
.. index:: -p (gnatbind)
-:samp:`-p`
+:switch:`-p`
Normally the binder attempts to choose an elaboration order that is
likely to minimize the likelihood of an elaboration order error resulting
- in raising a `Program_Error` exception. This switch reverses the
+ in raising a ``Program_Error`` exception. This switch reverses the
action of the binder, and requests that it deliberately choose an order
that is likely to maximize the likelihood of an elaboration error.
This is useful in ensuring portability and avoiding dependence on
accidental fortuitous elaboration ordering.
- Normally it only makes sense to use the *-p*
+ Normally it only makes sense to use the :switch:`-p`
switch if dynamic
- elaboration checking is used (*-gnatE* switch used for compilation).
+ elaboration checking is used (:switch:`-gnatE` switch used for compilation).
This is because in the default static elaboration mode, all necessary
- `Elaborate` and `Elaborate_All` pragmas are implicitly inserted.
+ ``Elaborate`` and ``Elaborate_All`` pragmas are implicitly inserted.
These implicit pragmas are still respected by the binder in
- *-p* mode, so a
+ :switch:`-p` mode, so a
safe elaboration order is assured.
- Note that *-p* is not intended for
+ Note that :switch:`-p` is not intended for
production use; it is more for debugging/experimental use.
.. _Output_Control:
@@ -6709,14 +6772,14 @@ generated by the binder.
.. index:: -c (gnatbind)
-:samp:`-c`
+:switch:`-c`
Check only. Do not generate the binder output file. In this mode the
binder performs all error checks but does not generate an output file.
.. index:: -e (gnatbind)
-:samp:`-e`
+:switch:`-e`
Output complete list of elaboration-order dependencies, showing the
reason for each dependency. This output can be rather extensive but may
be useful in diagnosing problems with elaboration order. The output is
@@ -6725,27 +6788,27 @@ generated by the binder.
.. index:: -h (gnatbind)
-:samp:`-h`
+:switch:`-h`
Output usage information. The output is written to :file:`stdout`.
.. index:: -K (gnatbind)
-:samp:`-K`
+:switch:`-K`
Output linker options to :file:`stdout`. Includes library search paths,
contents of pragmas Ident and Linker_Options, and libraries added
- by `gnatbind`.
+ by ``gnatbind``.
.. index:: -l (gnatbind)
-:samp:`-l`
+:switch:`-l`
Output chosen elaboration order. The output is written to :file:`stdout`.
.. index:: -O (gnatbind)
-:samp:`-O`
+:switch:`-O`
Output full names of all the object files that must be linked to provide
the Ada component of the program. The output is written to :file:`stdout`.
This list includes the files explicitly supplied and referenced by the user
@@ -6756,9 +6819,9 @@ generated by the binder.
.. index:: -o (gnatbind)
-:samp:`-o {file}`
- Set name of output file to `file` instead of the normal
- :file:`b~`mainprog`.adb` default. Note that `file` denote the Ada
+:switch:`-o {file}`
+ Set name of output file to ``file`` instead of the normal
+ :file:`b~`mainprog`.adb` default. Note that ``file`` denote the Ada
binder generated body filename.
Note that if this option is used, then linking must be done manually.
It is not possible to use gnatlink in this case, since it cannot locate
@@ -6767,8 +6830,8 @@ generated by the binder.
.. index:: -r (gnatbind)
-:samp:`-r`
- Generate list of `pragma Restrictions` that could be applied to
+:switch:`-r`
+ Generate list of ``pragma Restrictions`` that could be applied to
the current unit. This is useful for code audit purposes, and also may
be used to improve code generation in some cases.
@@ -6778,19 +6841,19 @@ generated by the binder.
Dynamic Allocation Control
^^^^^^^^^^^^^^^^^^^^^^^^^^
-The heap control switches -- *-H32* and *-H64* --
+The heap control switches -- :switch:`-H32` and :switch:`-H64` --
determine whether dynamic allocation uses 32-bit or 64-bit memory.
-They only affect compiler-generated allocations via `__gnat_malloc`;
-explicit calls to `malloc` and related functions from the C
+They only affect compiler-generated allocations via ``__gnat_malloc``;
+explicit calls to ``malloc`` and related functions from the C
run-time library are unaffected.
-:samp:`-H32`
+:switch:`-H32`
Allocate memory on 32-bit heap
-:samp:`-H64`
+:switch:`-H64`
Allocate memory on 64-bit heap. This is the default
- unless explicitly overridden by a `'Size` clause on the access type.
+ unless explicitly overridden by a ``'Size`` clause on the access type.
These switches are only effective on VMS platforms.
@@ -6802,7 +6865,7 @@ Binding with Non-Ada Main Programs
The description so far has assumed that the main
program is in Ada, and that the task of the binder is to generate a
-corresponding function `main` that invokes this Ada main
+corresponding function ``main`` that invokes this Ada main
program. GNAT also supports the building of executable programs where
the main program is not in Ada, but some of the called routines are
written in Ada and compiled using GNAT (:ref:`Mixed_Language_Programming`).
@@ -6811,7 +6874,7 @@ The following switch is used in this situation:
.. index:: -n (gnatbind)
-:samp:`-n`
+:switch:`-n`
No main program. The main program is not in Ada.
In this case, most of the functions of the binder are still required,
@@ -6820,9 +6883,9 @@ containing the following callable routines:
.. index:: adainit
- *adainit*
+ ``adainit``
You must call this routine to initialize the Ada part of the program by
- calling the necessary elaboration routines. A call to `adainit` is
+ calling the necessary elaboration routines. A call to ``adainit`` is
required before the first call to an Ada subprogram.
Note that it is assumed that the basic execution environment must be setup
@@ -6835,18 +6898,18 @@ containing the following callable routines:
.. index:: adafinal
- *adafinal*
+ ``adafinal``
You must call this routine to perform any library-level finalization
- required by the Ada subprograms. A call to `adafinal` is required
+ required by the Ada subprograms. A call to ``adafinal`` is required
after the last call to an Ada subprogram, and before the program
terminates.
.. index:: -n (gnatbind)
.. index:: Binder, multiple input files
-If the *-n* switch
+If the :switch:`-n` switch
is given, more than one ALI file may appear on
-the command line for `gnatbind`. The normal *closure*
+the command line for ``gnatbind``. The normal ``closure``
calculation is performed for each of the specified units. Calculating
the closure means finding out the set of units involved by tracing
|with| references. The reason it is necessary to be able to
@@ -6854,12 +6917,12 @@ specify more than one ALI file is that a given program may invoke two or
more quite separate groups of Ada units.
The binder takes the name of its output file from the last specified ALI
-file, unless overridden by the use of the *-o file*.
+file, unless overridden by the use of the :switch:`-o file`.
.. index:: -o (gnatbind)
The output is an Ada unit in source form that can be compiled with GNAT.
-This compilation occurs automatically as part of the *gnatlink*
+This compilation occurs automatically as part of the ``gnatlink``
processing.
Currently the GNAT run time requires a FPU using 80 bits mode
@@ -6883,7 +6946,7 @@ The following switch is used to bind programs organized in this manner:
.. index:: -z (gnatbind)
-:samp:`-z`
+:switch:`-z`
Normally the binder checks that the unit name given on the command line
corresponds to a suitable main subprogram. When this switch is used,
a list of ALI files can be given, and the execution of the program
@@ -6891,7 +6954,7 @@ The following switch is used to bind programs organized in this manner:
that the default wide character encoding method for standard Text_IO
files is always set to Brackets if this switch is set (you can use
the binder switch
- *-Wx* to override this default).
+ :switch:`-Wx` to override this default).
.. _Command-Line_Access:
@@ -6899,7 +6962,7 @@ The following switch is used to bind programs organized in this manner:
Command-Line Access
-------------------
-The package `Ada.Command_Line` provides access to the command-line
+The package ``Ada.Command_Line`` provides access to the command-line
arguments and program name. In order for this interface to operate
correctly, the two variables
@@ -6912,35 +6975,35 @@ correctly, the two variables
.. index:: gnat_argc
are declared in one of the GNAT library routines. These variables must
-be set from the actual `argc` and `argv` values passed to the
-main program. With no *n* present, `gnatbind`
+be set from the actual ``argc`` and ``argv`` values passed to the
+main program. With no *n* present, ``gnatbind``
generates the C main program to automatically set these variables.
If the *n* switch is used, there is no automatic way to
set these variables. If they are not set, the procedures in
-`Ada.Command_Line` will not be available, and any attempt to use
-them will raise `Constraint_Error`. If command line access is
-required, your main program must set `gnat_argc` and
-`gnat_argv` from the `argc` and `argv` values passed to
+``Ada.Command_Line`` will not be available, and any attempt to use
+them will raise ``Constraint_Error``. If command line access is
+required, your main program must set ``gnat_argc`` and
+``gnat_argv`` from the ``argc`` and ``argv`` values passed to
it.
.. _Search_Paths_for_gnatbind:
-Search Paths for `gnatbind`
----------------------------
+Search Paths for ``gnatbind``
+-----------------------------
The binder takes the name of an ALI file as its argument and needs to
locate source files as well as other ALI files to verify object consistency.
-For source files, it follows exactly the same search rules as *gcc*
+For source files, it follows exactly the same search rules as ``gcc``
(see :ref:`Search_Paths_and_the_Run-Time_Library_RTL`). For ALI files the
directories searched are:
* The directory containing the ALI file named in the command line, unless
- the switch *-I-* is specified.
+ the switch :switch:`-I-` is specified.
-* All directories specified by *-I*
- switches on the `gnatbind`
+* All directories specified by :switch:`-I`
+ switches on the ``gnatbind``
command line, in the order given.
.. index:: ADA_PRJ_OBJECTS_FILE
@@ -6963,23 +7026,23 @@ directories searched are:
* The content of the :file:`ada_object_path` file which is part of the GNAT
installation tree and is used to store standard libraries such as the
- GNAT Run Time Library (RTL) unless the switch *-nostdlib* is
+ GNAT Run Time Library (RTL) unless the switch :switch:`-nostdlib` is
specified. See :ref:`Installing_a_library`
.. index:: -I (gnatbind)
.. index:: -aI (gnatbind)
.. index:: -aO (gnatbind)
-In the binder the switch *-I*
+In the binder the switch :switch:`-I`
is used to specify both source and
-library file paths. Use *-aI*
+library file paths. Use :switch:`-aI`
instead if you want to specify
-source paths only, and *-aO*
+source paths only, and :switch:`-aO`
if you want to specify library paths
only. This means that for the binder
-:samp:`-I{dir}` is equivalent to
-:samp:`-aI{dir}`
-:samp:`-aO`{dir}`.
+:switch:`-I{dir}` is equivalent to
+:switch:`-aI{dir}`
+:switch:`-aO`{dir}`.
The binder generates the bind file (a C language source file) in the
current working directory.
@@ -6988,7 +7051,7 @@ current working directory.
.. index:: Interfaces
.. index:: GNAT
-The packages `Ada`, `System`, and `Interfaces` and their
+The packages ``Ada``, ``System``, and ``Interfaces`` and their
children make up the GNAT Run-Time Library, together with the package
GNAT and its children, which contain a set of useful additional
library functions provided by GNAT. The sources for these units are
@@ -7007,16 +7070,16 @@ development environments much more flexible.
.. _Examples_of_gnatbind_Usage:
-Examples of `gnatbind` Usage
-----------------------------
+Examples of ``gnatbind`` Usage
+------------------------------
-Here are some examples of `gnatbind` invovations:
+Here are some examples of ``gnatbind`` invovations:
::
gnatbind hello
- The main program `Hello` (source program in :file:`hello.adb`) is
+ The main program ``Hello`` (source program in :file:`hello.adb`) is
bound using the standard switch settings. The generated main program is
:file:`b~hello.adb`. This is the normal, default use of the binder.
@@ -7024,7 +7087,7 @@ Here are some examples of `gnatbind` invovations:
gnatbind hello -o mainprog.adb
- The main program `Hello` (source program in :file:`hello.adb`) is
+ The main program ``Hello`` (source program in :file:`hello.adb`) is
bound using the standard switch settings. The generated main program is
:file:`mainprog.adb` with the associated spec in
:file:`mainprog.ads`. Note that you must specify the body here not the
@@ -7034,38 +7097,38 @@ Here are some examples of `gnatbind` invovations:
.. _Linking_with_gnatlink:
-Linking with *gnatlink*
-=======================
+Linking with ``gnatlink``
+=========================
.. index:: ! gnatlink
-This chapter discusses *gnatlink*, a tool that links
+This chapter discusses ``gnatlink``, a tool that links
an Ada program and builds an executable file. This utility
-invokes the system linker (via the *gcc* command)
+invokes the system linker (via the ``gcc`` command)
with a correct list of object files and library references.
-*gnatlink* automatically determines the list of files and
+``gnatlink`` automatically determines the list of files and
references for the Ada part of a program. It uses the binder file
-generated by the *gnatbind* to determine this list.
+generated by the ``gnatbind`` to determine this list.
Note: to invoke `gnatlink` with a project file, use the `gnat`
driver (see :ref:`The_GNAT_Driver_and_Project_Files`).
.. _Running_gnatlink:
-Running *gnatlink*
-------------------
+Running ``gnatlink``
+--------------------
-The form of the *gnatlink* command is
+The form of the ``gnatlink`` command is
.. code-block:: sh
- $ gnatlink [`switches`] `mainprog`[.ali]
- [`non-Ada objects`] [`linker options`]
+ $ gnatlink [ switches ] mainprog [.ali]
+ [ non-Ada objects ] [ linker options ]
-The arguments of *gnatlink* (switches, main :file:`ALI` file,
+The arguments of ``gnatlink`` (switches, main ``ALI`` file,
non-Ada objects
or linker options) may be in any order, provided that no non-Ada object may
be mistaken for a main :file:`ALI` file.
@@ -7075,32 +7138,32 @@ whose name is the concatenation of :file:`F` and :file:`.ali`.
:file:`mainprog.ali` references the ALI file of the main program.
The :file:`.ali` extension of this file can be omitted. From this
-reference, *gnatlink* locates the corresponding binder file
+reference, ``gnatlink`` locates the corresponding binder file
:file:`b~mainprog.adb` and, using the information in this file along
with the list of non-Ada objects and linker options, constructs a
linker command file to create the executable.
-The arguments other than the *gnatlink* switches and the main
+The arguments other than the ``gnatlink`` switches and the main
:file:`ALI` file are passed to the linker uninterpreted.
They typically include the names of
object files for units written in other languages than Ada and any library
references required to resolve references in any of these foreign language
-units, or in `Import` pragmas in any Ada units.
+units, or in ``Import`` pragmas in any Ada units.
-`linker options` is an optional list of linker specific
+``linker options`` is an optional list of linker specific
switches.
-The default linker called by gnatlink is *gcc* which in
+The default linker called by gnatlink is ``gcc`` which in
turn calls the appropriate system linker.
-One useful option for the linker is *-s*: it reduces the size of the
+One useful option for the linker is :switch:`-s`: it reduces the size of the
executable by removing all symbol table and relocation information from the
executable.
-Standard options for the linker such as *-lmy_lib* or
-*-Ldir* can be added as is.
+Standard options for the linker such as :switch:`-lmy_lib` or
+:switch:`-Ldir` can be added as is.
For options that are not recognized by
-*gcc* as linker options, use the *gcc* switches
-*-Xlinker* or *-Wl,*.
+``gcc`` as linker options, use the ``gcc`` switches
+:switch:`-Xlinker` or :switch:`-Wl,`.
Refer to the GCC documentation for
details.
@@ -7112,46 +7175,46 @@ Here is an example showing how to generate a linker map:
$ gnatlink my_prog -Wl,-Map,MAPFILE
-Using `linker options` it is possible to set the program stack and
+Using ``linker options`` it is possible to set the program stack and
heap size.
See :ref:`Setting_Stack_Size_from_gnatlink` and
:ref:`Setting_Heap_Size_from_gnatlink`.
-*gnatlink* determines the list of objects required by the Ada
+``gnatlink`` determines the list of objects required by the Ada
program and prepends them to the list of objects passed to the linker.
-*gnatlink* also gathers any arguments set by the use of
-`pragma Linker_Options` and adds them to the list of arguments
+``gnatlink`` also gathers any arguments set by the use of
+``pragma Linker_Options`` and adds them to the list of arguments
presented to the linker.
.. _Switches_for_gnatlink:
-Switches for *gnatlink*
------------------------
+Switches for ``gnatlink``
+-------------------------
-The following switches are available with the *gnatlink* utility:
+The following switches are available with the ``gnatlink`` utility:
.. index:: --version (gnatlink)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatlink)
-:samp:`--help`
- If *--version* was not used, display usage, then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage, then exit disregarding
all other options.
.. index:: Command line length
.. index:: -f (gnatlink)
-:samp:`-f`
- On some targets, the command line length is limited, and *gnatlink*
+:switch:`-f`
+ On some targets, the command line length is limited, and ``gnatlink``
will generate a separate file for the linker if the list of object files
is too long.
- The *-f* switch forces this file
+ The :switch:`-f` switch forces this file
to be generated even if
the limit is not exceeded. This is useful in some cases to deal with
special situations where the command line length is exceeded.
@@ -7160,16 +7223,16 @@ The following switches are available with the *gnatlink* utility:
.. index:: Debugging information, including
.. index:: -g (gnatlink)
-:samp:`-g`
+:switch:`-g`
The option to include debugging information causes the Ada bind file (in
- other words, :file:`b~mainprog.adb`) to be compiled with *-g*.
+ other words, :file:`b~mainprog.adb`) to be compiled with :switch:`-g`.
In addition, the binder does not delete the :file:`b~mainprog.adb`,
:file:`b~mainprog.o` and :file:`b~mainprog.ali` files.
- Without *-g*, the binder removes these files by default.
+ Without :switch:`-g`, the binder removes these files by default.
.. index:: -n (gnatlink)
-:samp:`-n`
+:switch:`-n`
Do not compile the file generated by the binder. This may be used when
a link is rerun with different options, but there is no need to recompile
the binder file.
@@ -7177,7 +7240,7 @@ The following switches are available with the *gnatlink* utility:
.. index:: -v (gnatlink)
-:samp:`-v`
+:switch:`-v`
Verbose mode. Causes additional information to be output, including a full
list of the included object files.
This switch option is most useful when you want
@@ -7186,70 +7249,70 @@ The following switches are available with the *gnatlink* utility:
.. index:: -v -v (gnatlink)
-:samp:`-v -v`
+:switch:`-v -v`
Very verbose mode. Requests that the compiler operate in verbose mode when
it compiles the binder file, and that the system linker run in verbose mode.
.. index:: -o (gnatlink)
-:samp:`-o {exec-name}`
- `exec-name` specifies an alternate name for the generated
+:switch:`-o {exec-name}`
+ ``exec-name`` specifies an alternate name for the generated
executable program. If this switch is omitted, the executable has the same
- name as the main unit. For example, `gnatlink try.ali` creates
+ name as the main unit. For example, ``gnatlink try.ali`` creates
an executable called :file:`try`.
.. index:: -b (gnatlink)
-:samp:`-b {target}`
- Compile your program to run on `target`, which is the name of a
+:switch:`-b {target}`
+ Compile your program to run on ``target``, which is the name of a
system configuration. You must have a GNAT cross-compiler built if
- `target` is not the same as your host system.
+ ``target`` is not the same as your host system.
.. index:: -B (gnatlink)
-:samp:`-B{dir}`
- Load compiler executables (for example, `gnat1`, the Ada compiler)
- from `dir` instead of the default location. Only use this switch
+:switch:`-B{dir}`
+ Load compiler executables (for example, ``gnat1``, the Ada compiler)
+ from ``dir`` instead of the default location. Only use this switch
when multiple versions of the GNAT compiler are available.
- See the `Directory Options` section in :title:`The_GNU_Compiler_Collection`
- for further details. You would normally use the *-b* or
- *-V* switch instead.
+ See the ``Directory Options`` section in :title:`The_GNU_Compiler_Collection`
+ for further details. You would normally use the :switch:`-b` or
+ :switch:`-V` switch instead.
.. index:: -M (gnatlink)
-:samp:`-M`
+:switch:`-M`
When linking an executable, create a map file. The name of the map file
has the same name as the executable with extension ".map".
.. index:: -M= (gnatlink)
-:samp:`-M={mapfile}`
+:switch:`-M={mapfile}`
When linking an executable, create a map file. The name of the map file is
- `mapfile`.
+ ``mapfile``.
.. index:: --GCC=compiler_name (gnatlink)
-:samp:`--GCC={compiler_name}`
+:switch:`--GCC={compiler_name}`
Program used for compiling the binder file. The default is
- ``gcc``. You need to use quotes around `compiler_name` if
- `compiler_name` contains spaces or other separator characters.
- As an example ``--GCC="foo -x -y"`` will instruct *gnatlink* to
+ ``gcc``. You need to use quotes around ``compiler_name`` if
+ ``compiler_name`` contains spaces or other separator characters.
+ As an example ``--GCC="foo -x -y"`` will instruct ``gnatlink`` to
use ``foo -x -y`` as your compiler. Note that switch ``-c`` is always
inserted after your command name. Thus in the above example the compiler
- command that will be used by *gnatlink* will be ``foo -c -x -y``.
+ command that will be used by ``gnatlink`` will be ``foo -c -x -y``.
A limitation of this syntax is that the name and path name of the executable
itself must not include any embedded spaces. If the compiler executable is
different from the default one (gcc or <prefix>-gcc), then the back-end
switches in the ALI file are not used to compile the binder generated source.
For example, this is the case with ``--GCC="foo -x -y"``. But the back end
switches will be used for ``--GCC="gcc -gnatv"``. If several
- ``--GCC=compiler_name`` are used, only the last `compiler_name`
+ ``--GCC=compiler_name`` are used, only the last ``compiler_name``
is taken into account. However, all the additional switches are also taken
into account. Thus,
``--GCC="foo -x -y" --GCC="bar -z -t"`` is equivalent to
@@ -7258,13 +7321,13 @@ The following switches are available with the *gnatlink* utility:
.. index:: --LINK= (gnatlink)
-:samp:`--LINK={name}`
- `name` is the name of the linker to be invoked. This is especially
+:switch:`--LINK={name}`
+ ``name`` is the name of the linker to be invoked. This is especially
useful in mixed language programs since languages such as C++ require
their own linker to be used. When this switch is omitted, the default
- name for the linker is *gcc*. When this switch is used, the
- specified linker is called instead of *gcc* with exactly the same
- parameters that would have been passed to *gcc* so if the desired
+ name for the linker is ``gcc``. When this switch is used, the
+ specified linker is called instead of ``gcc`` with exactly the same
+ parameters that would have been passed to ``gcc`` so if the desired
linker requires different parameters it is necessary to use a wrapper
script that massages the parameters before invoking the real linker. It
may be useful to control the exact invocation by using the verbose
@@ -7273,19 +7336,19 @@ The following switches are available with the *gnatlink* utility:
.. _Using_the_GNU_make_Utility:
-Using the GNU `make` Utility
-============================
+Using the GNU ``make`` Utility
+==============================
.. index:: make (GNU), GNU make
This chapter offers some examples of makefiles that solve specific
problems. It does not explain how to write a makefile, nor does it try to replace the
-*gnatmake* utility (:ref:`The_GNAT_Make_Program_gnatmake`).
+``gnatmake`` utility (:ref:`The_GNAT_Make_Program_gnatmake`).
All the examples in this section are specific to the GNU version of
-make. Although *make* is a standard utility, and the basic language
+make. Although ``make`` is a standard utility, and the basic language
is the same, these examples use some advanced features found only in
-`GNU make`.
+``GNU make``.
.. _Using_gnatmake_in_a_Makefile:
@@ -7302,7 +7365,7 @@ time of very big applications while maintaining full coherence at
each step of the build process.
The list of dependencies are handled automatically by
-*gnatmake*. The Makefile is simply used to call gnatmake in each of
+``gnatmake``. The Makefile is simply used to call gnatmake in each of
the appropriate directories.
Note that you should also read the example on how to automatically
@@ -7405,13 +7468,13 @@ automatically.
The example below presents two methods. The first one, although less
general, gives you more control over the list. It involves wildcard
-characters, that are automatically expanded by *make*. Its
+characters, that are automatically expanded by ``make``. Its
shortcoming is that you need to explicitly specify some of the
organization of your project, such as for instance the directory tree
depth, whether some directories are found in a separate tree, etc.
The second method is the most general one. It requires an external
-program, called *find*, which is standard on all Unix systems. All
+program, called ``find``, which is standard on all Unix systems. All
the directories found under a given root directory will be added to the
list.
@@ -7443,7 +7506,7 @@ list.
# Note that the argument(s) to wildcard below should end with a '/'.
# Since wildcards also return file names, we have to filter them out
# to avoid duplicate directory names.
- # We thus use make's `dir` and `sort` functions.
+ # We thus use make's ``dir`` and ``sort`` functions.
# It sets DIRs to the following value (note that the directories aaa and baa
# are not given, unless you change the arguments to wildcard).
# DIRS= ./a/a/ ./b/ ./a/aa/ ./a/ab/ ./a/ac/ ./b/ba/ ./b/bb/ ./b/bc/
@@ -7500,7 +7563,7 @@ operating systems limit the length of the command line. It is thus hard to give
gnatmake the list of source and object directories.
This example shows how you can set up environment variables, which will
-make *gnatmake* behave exactly as if the directories had been
+make ``gnatmake`` behave exactly as if the directories had been
specified on the command line, but have a much higher length limit (or
even none on most systems).
@@ -7512,7 +7575,7 @@ path (where the ALI files are found) is different from the sources patch.
Note a small trick in the Makefile below: for efficiency reasons, we
create two temporary variables (SOURCE_LIST and OBJECT_LIST), that are
-expanded immediately by `make`. This way we overcome the standard
+expanded immediately by ``make``. This way we overcome the standard
make behavior which is to expand the variables only when they are
actually used.
diff --git a/gcc/ada/doc/gnat_ugn/elaboration_order_handling_in_gnat.rst b/gcc/ada/doc/gnat_ugn/elaboration_order_handling_in_gnat.rst
index 1e96e31..688dd99 100644
--- a/gcc/ada/doc/gnat_ugn/elaboration_order_handling_in_gnat.rst
+++ b/gcc/ada/doc/gnat_ugn/elaboration_order_handling_in_gnat.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. |with| replace:: *with*
.. |withs| replace:: *with*\ s
.. |withed| replace:: *with*\ ed
@@ -40,7 +42,7 @@ in three contexts:
* *Package initialization code*
- Code in a `BEGIN-END` section at the outer level of a package body is
+ Code in a ``begin`` ... `` end`` section at the outer level of a package body is
executed as part of the package body elaboration code.
* *Library level task allocators*
@@ -60,12 +62,12 @@ we have to be sure that it is executed in an appropriate order. What we
have is a series of elaboration code sections, potentially one section
for each unit in the program. It is important that these execute
in the correct order. Correctness here means that, taking the above
-example of the declaration of `Sqrt_Half`,
+example of the declaration of ``Sqrt_Half``,
if some other piece of
-elaboration code references `Sqrt_Half`,
+elaboration code references ``Sqrt_Half``,
then it must run after the
section of elaboration code that contains the declaration of
-`Sqrt_Half`.
+``Sqrt_Half``.
There would never be any order of elaboration problem if we made a rule
that whenever you |with| a unit, you must elaborate both the spec and body
@@ -76,8 +78,8 @@ of that unit before elaborating the unit doing the |withing|:
with Unit_1;
package Unit_2 is ...
-would require that both the body and spec of `Unit_1` be elaborated
-before the spec of `Unit_2`. However, a rule like that would be far too
+would require that both the body and spec of ``Unit_1`` be elaborated
+before the spec of ``Unit_2``. However, a rule like that would be far too
restrictive. In particular, it would make it impossible to have routines
in separate packages that were mutually recursive.
@@ -86,16 +88,16 @@ elaboration code and determine an appropriate correct order of elaboration,
but in the general case, this is not possible. Consider the following
example.
-In the body of `Unit_1`, we have a procedure `Func_1`
+In the body of ``Unit_1``, we have a procedure ``Func_1``
that references
-the variable `Sqrt_1`, which is declared in the elaboration code
-of the body of `Unit_1`:
+the variable ``Sqrt_1``, which is declared in the elaboration code
+of the body of ``Unit_1``:
.. code-block:: ada
Sqrt_1 : Float := Sqrt (0.1);
-The elaboration code of the body of `Unit_1` also contains:
+The elaboration code of the body of ``Unit_1`` also contains:
.. code-block:: ada
@@ -103,16 +105,16 @@ The elaboration code of the body of `Unit_1` also contains:
Q := Unit_2.Func_2;
end if;
-`Unit_2` is exactly parallel,
-it has a procedure `Func_2` that references
-the variable `Sqrt_2`, which is declared in the elaboration code of
-the body `Unit_2`:
+``Unit_2`` is exactly parallel,
+it has a procedure ``Func_2`` that references
+the variable ``Sqrt_2``, which is declared in the elaboration code of
+the body ``Unit_2``:
.. code-block:: ada
Sqrt_2 : Float := Sqrt (0.1);
-The elaboration code of the body of `Unit_2` also contains:
+The elaboration code of the body of ``Unit_2`` also contains:
.. code-block:: ada
@@ -141,23 +143,23 @@ or
If you carefully analyze the flow here, you will see that you cannot tell
at compile time the answer to this question.
-If `expression_1` is not equal to 1,
-and `expression_2` is not equal to 2,
+If ``expression_1`` is not equal to 1,
+and ``expression_2`` is not equal to 2,
then either order is acceptable, because neither of the function calls is
executed. If both tests evaluate to true, then neither order is acceptable
and in fact there is no correct order.
If one of the two expressions is true, and the other is false, then one
of the above orders is correct, and the other is incorrect. For example,
-if `expression_1` /= 1 and `expression_2` = 2,
-then the call to `Func_1`
-will occur, but not the call to `Func_2.`
+if ``expression_1`` /= 1 and ``expression_2`` = 2,
+then the call to ``Func_1``
+will occur, but not the call to ``Func_2.``
This means that it is essential
-to elaborate the body of `Unit_1` before
-the body of `Unit_2`, so the first
+to elaborate the body of ``Unit_1`` before
+the body of ``Unit_2``, so the first
order of elaboration is correct and the second is wrong.
-By making `expression_1` and `expression_2`
+By making ``expression_1`` and ``expression_2``
depend on input data, or perhaps
the time of day, we can make it impossible for the compiler or binder
to figure out which of these expressions will be true, and hence it
@@ -193,7 +195,7 @@ of defense:
Dynamic checks are made at run time, so that if some entity is accessed
before it is elaborated (typically by means of a subprogram call)
- then the exception (`Program_Error`) is raised.
+ then the exception (``Program_Error``) is raised.
* *Elaboration control*
@@ -214,7 +216,7 @@ easier to state:
has been elaborated. The rules for elaboration given above guarantee
that the spec of the subprogram has been elaborated before the
call, but not the body. If this rule is violated, then the
- exception `Program_Error` is raised.
+ exception ``Program_Error`` is raised.
* *Restrictions on instantiations*
@@ -222,7 +224,7 @@ easier to state:
unit has been elaborated. Again, the rules for elaboration given above
guarantee that the spec of the generic unit has been elaborated
before the instantiation, but not the body. If this rule is
- violated, then the exception `Program_Error` is raised.
+ violated, then the exception ``Program_Error`` is raised.
The idea is that if the body has been elaborated, then any variables
it references must have been elaborated; by checking for the body being
@@ -237,14 +239,14 @@ A plausible implementation can be described as follows.
A Boolean variable is associated with each subprogram
and each generic unit. This variable is initialized to False, and is set to
True at the point body is elaborated. Every call or instantiation checks the
-variable, and raises `Program_Error` if the variable is False.
+variable, and raises ``Program_Error`` if the variable is False.
Note that one might think that it would be good enough to have one Boolean
variable for each package, but that would not deal with cases of trying
to call a body in the same package as the call
that has not been elaborated yet.
Of course a compiler may be able to do enough analysis to optimize away
-some of the Boolean variables as unnecessary, and `GNAT` indeed
+some of the Boolean variables as unnecessary, and GNAT indeed
does such optimizations, but still the easiest conceptual model is to
think of there being one variable per subprogram.
@@ -254,7 +256,7 @@ Controlling the Elaboration Order
=================================
In the previous section we discussed the rules in Ada which ensure
-that `Program_Error` is raised if an incorrect elaboration order is
+that ``Program_Error`` is raised if an incorrect elaboration order is
chosen. This prevents erroneous executions, but we need mechanisms to
specify a correct execution and avoid the exception altogether.
To achieve this, Ada provides a number of features for controlling
@@ -280,8 +282,8 @@ unit has no elaboration problems:
end Subp;
end Definitions;
- A package that |withs| `Definitions` may safely instantiate
- `Definitions.Subp` because the compiler can determine that there
+ A package that |withs| ``Definitions`` may safely instantiate
+ ``Definitions.Subp`` because the compiler can determine that there
definitely is no package body to worry about in this case
.. index:: pragma Pure
@@ -309,22 +311,22 @@ unit has no elaboration problems:
* *pragma Elaborate_Body*
This pragma requires that the body of a unit be elaborated immediately
- after its spec. Suppose a unit `A` has such a pragma,
- and unit `B` does
- a |with| of unit `A`. Recall that the standard rules require
- the spec of unit `A`
+ after its spec. Suppose a unit ``A`` has such a pragma,
+ and unit ``B`` does
+ a |with| of unit ``A``. Recall that the standard rules require
+ the spec of unit ``A``
to be elaborated before the |withing| unit; given the pragma in
- `A`, we also know that the body of `A`
- will be elaborated before `B`, so
- that calls to `A` are safe and do not need a check.
+ ``A``, we also know that the body of ``A``
+ will be elaborated before ``B``, so
+ that calls to ``A`` are safe and do not need a check.
- Note that, unlike pragma `Pure` and pragma `Preelaborate`,
- the use of `Elaborate_Body` does not guarantee that the program is
+ Note that, unlike pragma ``Pure`` and pragma ``Preelaborate``,
+ the use of ``Elaborate_Body`` does not guarantee that the program is
free of elaboration problems, because it may not be possible
to satisfy the requested elaboration order.
- Let's go back to the example with `Unit_1` and `Unit_2`.
- If a programmer marks `Unit_1` as `Elaborate_Body`,
- and not `Unit_2,` then the order of
+ Let's go back to the example with ``Unit_1`` and ``Unit_2``.
+ If a programmer marks ``Unit_1`` as ``Elaborate_Body``,
+ and not ``Unit_2,`` then the order of
elaboration will be::
Spec of Unit_2
@@ -332,27 +334,27 @@ unit has no elaboration problems:
Body of Unit_1
Body of Unit_2
- Now that means that the call to `Func_1` in `Unit_2`
+ Now that means that the call to ``Func_1`` in ``Unit_2``
need not be checked,
- it must be safe. But the call to `Func_2` in
- `Unit_1` may still fail if
- `Expression_1` is equal to 1,
+ it must be safe. But the call to ``Func_2`` in
+ ``Unit_1`` may still fail if
+ ``Expression_1`` is equal to 1,
and the programmer must still take
responsibility for this not being the case.
- If all units carry a pragma `Elaborate_Body`, then all problems are
+ If all units carry a pragma ``Elaborate_Body``, then all problems are
eliminated, except for calls entirely within a body, which are
in any case fully under programmer control. However, using the pragma
everywhere is not always possible.
- In particular, for our `Unit_1`/`Unit_2` example, if
- we marked both of them as having pragma `Elaborate_Body`, then
+ In particular, for our ``Unit_1``/`Unit_2` example, if
+ we marked both of them as having pragma ``Elaborate_Body``, then
clearly there would be no possible elaboration order.
The above pragmas allow a server to guarantee safe use by clients, and
clearly this is the preferable approach. Consequently a good rule
-is to mark units as `Pure` or `Preelaborate` if possible,
+is to mark units as ``Pure`` or ``Preelaborate`` if possible,
and if this is not possible,
-mark them as `Elaborate_Body` if possible.
+mark them as ``Elaborate_Body`` if possible.
As we have seen, there are situations where neither of these
three pragmas can be used.
So we also provide methods for clients to control the
@@ -380,20 +382,20 @@ order of elaboration of the servers on which they depend:
Unit B |withs| unit C, and B.Func calls C.Func
- Now if we put a pragma `Elaborate (B)`
- in unit `A`, this ensures that the
- body of `B` is elaborated before the call, but not the
- body of `C`, so
- the call to `C.Func` could still cause `Program_Error` to
+ Now if we put a pragma ``Elaborate (B)``
+ in unit ``A``, this ensures that the
+ body of ``B`` is elaborated before the call, but not the
+ body of ``C``, so
+ the call to ``C.Func`` could still cause ``Program_Error`` to
be raised.
- The effect of a pragma `Elaborate_All` is stronger, it requires
+ The effect of a pragma ``Elaborate_All`` is stronger, it requires
not only that the body of the named unit be elaborated before the
unit doing the |with|, but also the bodies of all units that the
named unit uses, following |with| links transitively. For example,
- if we put a pragma `Elaborate_All (B)` in unit `A`,
- then it requires not only that the body of `B` be elaborated before `A`,
- but also the body of `C`, because `B` |withs| `C`.
+ if we put a pragma ``Elaborate_All (B)`` in unit ``A``,
+ then it requires not only that the body of ``B`` be elaborated before ``A``,
+ but also the body of ``C``, because ``B`` |withs| ``C``.
We are now in a position to give a usage rule in Ada for avoiding
elaboration problems, at least if dynamic dispatching and access to
@@ -406,14 +408,14 @@ The rule is simple:
indirectly make a call to a subprogram in a |withed| unit, or instantiate
a generic package in a |withed| unit,
then if the |withed| unit does not have
-pragma `Pure` or `Preelaborate`, then the client should have
-a pragma `Elaborate_All`for the |withed| unit.**
+pragma ``Pure`` or ``Preelaborate``, then the client should have
+a pragma ``Elaborate_All``for the |withed| unit.**
By following this rule a client is
assured that calls can be made without risk of an exception.
For generic subprogram instantiations, the rule can be relaxed to
-require only a pragma `Elaborate` since elaborating the body
+require only a pragma ``Elaborate`` since elaborating the body
of a subprogram cannot cause any transitive elaboration (we are
not calling the subprogram in this case, just elaborating its
declaration).
@@ -424,8 +426,8 @@ states:
* *No order exists*
No order of elaboration exists which follows the rules, taking into
- account any `Elaborate`, `Elaborate_All`,
- or `Elaborate_Body` pragmas. In
+ account any ``Elaborate``, ``Elaborate_All``,
+ or ``Elaborate_Body`` pragmas. In
this case, an Ada compiler must diagnose the situation at bind
time, and refuse to build an executable program.
@@ -433,7 +435,7 @@ states:
One or more acceptable elaboration orders exist, and all of them
generate an elaboration order problem. In this case, the binder
- can build an executable program, but `Program_Error` will be raised
+ can build an executable program, but ``Program_Error`` will be raised
when the program is run.
* *Several orders exist, some right, some incorrect*
@@ -454,7 +456,7 @@ states:
may be true even if the rule is not followed.
Note that one additional advantage of following our rules on the use
-of `Elaborate` and `Elaborate_All`
+of ``Elaborate`` and ``Elaborate_All``
is that the program continues to stay in the ideal (all orders OK) state
even if maintenance
changes some bodies of some units. Conversely, if a program that does
@@ -462,10 +464,10 @@ not follow this rule happens to be safe at some point, this state of affairs
may deteriorate silently as a result of maintenance changes.
You may have noticed that the above discussion did not mention
-the use of `Elaborate_Body`. This was a deliberate omission. If you
-|with| an `Elaborate_Body` unit, it still may be the case that
+the use of ``Elaborate_Body``. This was a deliberate omission. If you
+|with| an ``Elaborate_Body`` unit, it still may be the case that
code in the body makes calls to some other unit, so it is still necessary
-to use `Elaborate_All` on such units.
+to use ``Elaborate_All`` on such units.
.. _Controlling_Elaboration_in_GNAT_-_Internal_Calls:
@@ -489,9 +491,9 @@ example writing:
return 1.0;
end One;
-will obviously raise `Program_Error` at run time, because function
+will obviously raise ``Program_Error`` at run time, because function
One will be called before its body is elaborated. In this case GNAT will
-generate a warning that the call will raise `Program_Error`::
+generate a warning that the call will raise ``Program_Error``::
1. procedure y is
2. function One return Float;
@@ -513,13 +515,13 @@ generate a warning that the call will raise `Program_Error`::
Note that in this particular case, it is likely that the call is safe, because
-the function `One` does not access any global variables.
+the function ``One`` does not access any global variables.
Nevertheless in Ada, we do not want the validity of the check to depend on
the contents of the body (think about the separate compilation case), so this
is still wrong, as we discussed in the previous sections.
The error is easily corrected by rearranging the declarations so that the
-body of `One` appears before the declaration containing the call
+body of ``One`` appears before the declaration containing the call
(note that in Ada 95 as well as later versions of the Ada standard,
declarations can appear in any order, so there is no restriction that
would prevent this reordering, and if we write:
@@ -536,7 +538,7 @@ would prevent this reordering, and if we write:
Q : Float := One;
then all is well, no warning is generated, and no
-`Program_Error` exception
+``Program_Error`` exception
will be raised.
Things are more complicated when a chain of subprograms is executed:
@@ -553,16 +555,16 @@ Things are more complicated when a chain of subprograms is executed:
function A return Integer is begin return 1; end;
-Now the call to `C`
-at elaboration time in the declaration of `X` is correct, because
-the body of `C` is already elaborated,
-and the call to `B` within the body of
-`C` is correct, but the call
-to `A` within the body of `B` is incorrect, because the body
-of `A` has not been elaborated, so `Program_Error`
-will be raised on the call to `A`.
+Now the call to ``C``
+at elaboration time in the declaration of ``X`` is correct, because
+the body of ``C`` is already elaborated,
+and the call to ``B`` within the body of
+``C`` is correct, but the call
+to ``A`` within the body of ``B`` is incorrect, because the body
+of ``A`` has not been elaborated, so ``Program_Error``
+will be raised on the call to ``A``.
In this case GNAT will generate a
-warning that `Program_Error` may be
+warning that ``Program_Error`` may be
raised at the point of the call. Let's look at the warning::
1. procedure x is
@@ -590,9 +592,9 @@ raised at the point of the call. Let's look at the warning::
Note that the message here says 'may raise', instead of the direct case,
where the message says 'will be raised'. That's because whether
-`A` is
+``A`` is
actually called depends in general on run-time flow of control.
-For example, if the body of `B` said
+For example, if the body of ``B`` said
.. code-block:: ada
@@ -606,10 +608,10 @@ For example, if the body of `B` said
end B;
then we could not know until run time whether the incorrect call to A would
-actually occur, so `Program_Error` might
+actually occur, so ``Program_Error`` might
or might not be raised. It is possible for a compiler to
do a better job of analyzing bodies, to
-determine whether or not `Program_Error`
+determine whether or not ``Program_Error``
might be raised, but it certainly
couldn't do a perfect job (that would require solving the halting problem
and is provably impossible), and because this is a warning anyway, it does
@@ -622,22 +624,22 @@ real errors, and should be examined carefully and eliminated.
In the rare case where a warning is bogus, it can be suppressed by any of
the following methods:
-* Compile with the *-gnatws* switch set
+* Compile with the :switch:`-gnatws` switch set
-* Suppress `Elaboration_Check` for the called subprogram
+* Suppress ``Elaboration_Check`` for the called subprogram
-* Use pragma `Warnings_Off` to turn warnings off for the call
+* Use pragma ``Warnings_Off`` to turn warnings off for the call
For the internal elaboration check case,
GNAT by default generates the
necessary run-time checks to ensure
-that `Program_Error` is raised if any
+that ``Program_Error`` is raised if any
call fails an elaboration check. Of course this can only happen if a
warning has been issued as described above. The use of pragma
-`Suppress (Elaboration_Check)` may (but is not guaranteed to) suppress
+``Suppress (Elaboration_Check)`` may (but is not guaranteed to) suppress
some of these checks, meaning that it may be possible (but is not
guaranteed) for a program to be able to call a subprogram whose body
-is not yet elaborated, without raising a `Program_Error` exception.
+is not yet elaborated, without raising a ``Program_Error`` exception.
.. _Controlling_Elaboration_in_GNAT_-_External_Calls:
@@ -678,21 +680,21 @@ Consider the following:
...
end Main;
-where `Main` is the main program. When this program is executed, the
+where ``Main`` is the main program. When this program is executed, the
elaboration code must first be executed, and one of the jobs of the
binder is to determine the order in which the units of a program are
to be elaborated. In this case we have four units: the spec and body
-of `Math`,
-the spec of `Stuff` and the body of `Main`).
+of ``Math``,
+the spec of ``Stuff`` and the body of ``Main``).
In what order should the four separate sections of elaboration code
be executed?
There are some restrictions in the order of elaboration that the binder
can choose. In particular, if unit U has a |with|
-for a package `X`, then you
-are assured that the spec of `X`
+for a package ``X``, then you
+are assured that the spec of ``X``
is elaborated before U , but you are
-not assured that the body of `X`
+not assured that the body of ``X``
is elaborated before U.
This means that in the above case, the binder is allowed to choose the
order::
@@ -702,11 +704,11 @@ order::
body of Math
body of Main
-but that's not good, because now the call to `Math.Sqrt`
+but that's not good, because now the call to ``Math.Sqrt``
that happens during
-the elaboration of the `Stuff`
-spec happens before the body of `Math.Sqrt` is
-elaborated, and hence causes `Program_Error` exception to be raised.
+the elaboration of the ``Stuff``
+spec happens before the body of ``Math.Sqrt`` is
+elaborated, and hence causes ``Program_Error`` exception to be raised.
At first glance, one might say that the binder is misbehaving, because
obviously you want to elaborate the body of something you |with| first, but
that is not a general rule that can be followed in all cases. Consider
@@ -727,19 +729,19 @@ This is a common arrangement, and, apart from the order of elaboration
problems that might arise in connection with elaboration code, this works fine.
A rule that says that you must first elaborate the body of anything you
|with| cannot work in this case:
-the body of `X` |withs| `Y`,
+the body of ``X`` |withs| ``Y``,
which means you would have to
-elaborate the body of `Y` first, but that |withs| `X`,
+elaborate the body of ``Y`` first, but that |withs| ``X``,
which means
-you have to elaborate the body of `X` first, but ... and we have a
+you have to elaborate the body of ``X`` first, but ... and we have a
loop that cannot be broken.
It is true that the binder can in many cases guess an order of elaboration
-that is unlikely to cause a `Program_Error`
+that is unlikely to cause a ``Program_Error``
exception to be raised, and it tries to do so (in the
-above example of `Math/Stuff/Spec`, the GNAT binder will
+above example of ``Math/Stuff/Spec``, the GNAT binder will
by default
-elaborate the body of `Math` right after its spec, so all will be well).
+elaborate the body of ``Math`` right after its spec, so all will be well).
However, a program that blindly relies on the binder to be helpful can
get into trouble, as we discussed in the previous sections, so GNAT
@@ -759,36 +761,36 @@ rule we previously described as the right approach. Let's restate it:
*If a unit has elaboration code that can directly or indirectly make a
call to a subprogram in a |withed| unit, or instantiate a generic
package in a |withed| unit, then if the |withed| unit
-does not have pragma `Pure` or `Preelaborate`, then the client should have an
-`Elaborate_All` pragma for the |withed| unit.*
+does not have pragma ``Pure`` or ``Preelaborate``, then the client should have an
+``Elaborate_All`` pragma for the |withed| unit.*
*In the case of instantiating a generic subprogram, it is always
-sufficient to have only an `Elaborate` pragma for the
+sufficient to have only an ``Elaborate`` pragma for the
|withed| unit.*
By following this rule a client is assured that calls and instantiations
can be made without risk of an exception.
In this mode GNAT traces all calls that are potentially made from
-elaboration code, and puts in any missing implicit `Elaborate`
-and `Elaborate_All` pragmas.
+elaboration code, and puts in any missing implicit ``Elaborate``
+and ``Elaborate_All`` pragmas.
The advantage of this approach is that no elaboration problems
are possible if the binder can find an elaboration order that is
-consistent with these implicit `Elaborate` and
-`Elaborate_All` pragmas. The
+consistent with these implicit ``Elaborate`` and
+``Elaborate_All`` pragmas. The
disadvantage of this approach is that no such order may exist.
If the binder does not generate any diagnostics, then it means that it has
found an elaboration order that is guaranteed to be safe. However, the binder
-may still be relying on implicitly generated `Elaborate` and
-`Elaborate_All` pragmas so portability to other compilers than GNAT is not
+may still be relying on implicitly generated ``Elaborate`` and
+``Elaborate_All`` pragmas so portability to other compilers than GNAT is not
guaranteed.
If it is important to guarantee portability, then the compilations should
-use the *-gnatel*
+use the :switch:`-gnatel`
(info messages for elaboration pragmas) switch. This will cause info messages
-to be generated indicating the missing `Elaborate` and
-`Elaborate_All` pragmas.
+to be generated indicating the missing ``Elaborate`` and
+``Elaborate_All`` pragmas.
Consider the following source program:
.. code-block:: ada
@@ -799,12 +801,12 @@ Consider the following source program:
end;
where it is clear that there
-should be a pragma `Elaborate_All`
-for unit `k`. An implicit pragma will be generated, and it is
+should be a pragma ``Elaborate_All``
+for unit ``k``. An implicit pragma will be generated, and it is
likely that the binder will be able to honor it. However, if you want
to port this program to some other Ada compiler than GNAT.
it is safer to include the pragma explicitly in the source. If this
-unit is compiled with the *-gnatel*
+unit is compiled with the :switch:`-gnatel`
switch, then the compiler outputs an information message::
1. with k;
@@ -820,7 +822,7 @@ and these messages can be used as a guide for supplying manually
the missing pragmas. It is usually a bad idea to use this
option during development. That's because it will tell you when
you need to put in a pragma, but cannot tell you when it is time
-to take it out. So the use of pragma `Elaborate_All` may lead to
+to take it out. So the use of pragma ``Elaborate_All`` may lead to
unnecessary dependencies and even false circularities.
This default mode is more restrictive than the Ada Reference
@@ -834,8 +836,8 @@ and in particular must have the capability of implementing the
standard dynamic model of elaboration with run-time checks.
In GNAT, this standard mode can be achieved either by the use of
-the *-gnatE* switch on the compiler (*gcc* or
-*gnatmake*) command, or by the use of the configuration pragma:
+the :switch:`-gnatE` switch on the compiler (``gcc`` or
+``gnatmake``) command, or by the use of the configuration pragma:
.. code-block:: ada
@@ -865,36 +867,36 @@ Treatment of Pragma Elaborate
.. index:: Pragma Elaborate
-The use of `pragma Elaborate`
+The use of ``pragma Elaborate``
should generally be avoided in Ada 95 and Ada 2005 programs,
since there is no guarantee that transitive calls
will be properly handled. Indeed at one point, this pragma was placed
in Annex J (Obsolescent Features), on the grounds that it is never useful.
Now that's a bit restrictive. In practice, the case in which
-`pragma Elaborate` is useful is when the caller knows that there
+``pragma Elaborate`` is useful is when the caller knows that there
are no transitive calls, or that the called unit contains all necessary
-transitive `pragma Elaborate` statements, and legacy code often
+transitive ``pragma Elaborate`` statements, and legacy code often
contains such uses.
Strictly speaking the static mode in GNAT should ignore such pragmas,
since there is no assurance at compile time that the necessary safety
conditions are met. In practice, this would cause GNAT to be incompatible
with correctly written Ada 83 code that had all necessary
-`pragma Elaborate` statements in place. Consequently, we made the
+``pragma Elaborate`` statements in place. Consequently, we made the
decision that GNAT in its default mode will believe that if it encounters
-a `pragma Elaborate` then the programmer knows what they are doing,
+a ``pragma Elaborate`` then the programmer knows what they are doing,
and it will trust that no elaboration errors can occur.
The result of this decision is two-fold. First to be safe using the
-static mode, you should remove all `pragma Elaborate` statements.
+static mode, you should remove all ``pragma Elaborate`` statements.
Second, when fixing circularities in existing code, you can selectively
-use `pragma Elaborate` statements to convince the static mode of
-GNAT that it need not generate an implicit `pragma Elaborate_All`
+use ``pragma Elaborate`` statements to convince the static mode of
+GNAT that it need not generate an implicit ``pragma Elaborate_All``
statement.
-When using the static mode with *-gnatwl*, any use of
-`pragma Elaborate` will generate a warning about possible
+When using the static mode with :switch:`-gnatwl`, any use of
+``pragma Elaborate`` will generate a warning about possible
problems.
@@ -979,54 +981,54 @@ the following example
If the above example is compiled in the default static elaboration
mode, then a circularity occurs. The circularity comes from the call
-`Utils.Put_Val` in the task body of `Decls.Lib_Task`. Since
+``Utils.Put_Val`` in the task body of ``Decls.Lib_Task``. Since
this call occurs in elaboration code, we need an implicit pragma
-`Elaborate_All` for `Utils`. This means that not only must
-the spec and body of `Utils` be elaborated before the body
-of `Decls`, but also the spec and body of any unit that is
-|withed| by the body of `Utils` must also be elaborated before
-the body of `Decls`. This is the transitive implication of
-pragma `Elaborate_All` and it makes sense, because in general
-the body of `Put_Val` might have a call to something in a
+``Elaborate_All`` for ``Utils``. This means that not only must
+the spec and body of ``Utils`` be elaborated before the body
+of ``Decls``, but also the spec and body of any unit that is
+|withed| by the body of ``Utils`` must also be elaborated before
+the body of ``Decls``. This is the transitive implication of
+pragma ``Elaborate_All`` and it makes sense, because in general
+the body of ``Put_Val`` might have a call to something in a
|withed| unit.
In this case, the body of Utils (actually its spec) |withs|
-`Decls`. Unfortunately this means that the body of `Decls`
+``Decls``. Unfortunately this means that the body of ``Decls``
must be elaborated before itself, in case there is a call from the
-body of `Utils`.
+body of ``Utils``.
Here is the exact chain of events we are worrying about:
-* In the body of `Decls` a call is made from within the body of a library
- task to a subprogram in the package `Utils`. Since this call may
+* In the body of ``Decls`` a call is made from within the body of a library
+ task to a subprogram in the package ``Utils``. Since this call may
occur at elaboration time (given that the task is activated at elaboration
time), we have to assume the worst, i.e., that the
call does happen at elaboration time.
-* This means that the body and spec of `Util` must be elaborated before
- the body of `Decls` so that this call does not cause an access before
+* This means that the body and spec of ``Util`` must be elaborated before
+ the body of ``Decls`` so that this call does not cause an access before
elaboration.
-* Within the body of `Util`, specifically within the body of
- `Util.Put_Val` there may be calls to any unit |withed|
+* Within the body of ``Util``, specifically within the body of
+ ``Util.Put_Val`` there may be calls to any unit |withed|
by this package.
-* One such |withed| package is package `Decls`, so there
- might be a call to a subprogram in `Decls` in `Put_Val`.
+* One such |withed| package is package ``Decls``, so there
+ might be a call to a subprogram in ``Decls`` in ``Put_Val``.
In fact there is such a call in this example, but we would have to
assume that there was such a call even if it were not there, since
- we are not supposed to write the body of `Decls` knowing what
- is in the body of `Utils`; certainly in the case of the
+ we are not supposed to write the body of ``Decls`` knowing what
+ is in the body of ``Utils``; certainly in the case of the
static elaboration model, the compiler does not know what is in
other bodies and must assume the worst.
-* This means that the spec and body of `Decls` must also be
+* This means that the spec and body of ``Decls`` must also be
elaborated before we elaborate the unit containing the call, but
- that unit is `Decls`! This means that the body of `Decls`
+ that unit is ``Decls``! This means that the body of ``Decls``
must be elaborated before itself, and that's a circularity.
-Indeed, if you add an explicit pragma `Elaborate_All` for `Utils` in
-the body of `Decls` you will get a true Ada Reference Manual
+Indeed, if you add an explicit pragma ``Elaborate_All`` for ``Utils`` in
+the body of ``Decls`` you will get a true Ada Reference Manual
circularity that makes the program illegal.
In practice, we have found that problems with the static model of
@@ -1034,7 +1036,7 @@ elaboration in existing code often arise from library tasks, so
we must address this particular situation.
Note that if we compile and run the program above, using the dynamic model of
-elaboration (that is to say use the *-gnatE* switch),
+elaboration (that is to say use the :switch:`-gnatE` switch),
then it compiles, binds,
links, and runs, printing the expected result of 2. Therefore in some sense
the circularity here is only apparent, and we need to capture
@@ -1046,10 +1048,10 @@ We have four possible answers to this question:
* Use the dynamic model of elaboration.
- If we use the *-gnatE* switch, then as noted above, the program works.
+ If we use the :switch:`-gnatE` switch, then as noted above, the program works.
Why is this? If we examine the task body, it is apparent that the task cannot
proceed past the
- `accept` statement until after elaboration has been completed, because
+ ``accept`` statement until after elaboration has been completed, because
the corresponding entry call comes from the main program, not earlier.
This is why the dynamic model works here. But that's really giving
up on a precise analysis, and we prefer to take this approach only if we cannot
@@ -1114,7 +1116,7 @@ We have four possible answers to this question:
end;
- All we have done is to split `Decls` into two packages, one
+ All we have done is to split ``Decls`` into two packages, one
containing the library task, and one containing everything else. Now
there is no cycle, and the program compiles, binds, links and executes
using the default static model of elaboration.
@@ -1181,14 +1183,14 @@ We have four possible answers to this question:
end;
- What we have done here is to replace the `task` declaration in
- package `Decls` with a `task type` declaration. Then we
- introduce a separate package `Declst` to contain the actual
+ What we have done here is to replace the ``task`` declaration in
+ package ``Decls`` with a ``task type`` declaration. Then we
+ introduce a separate package ``Declst`` to contain the actual
task object. This separates the elaboration issues for
- the `task type`
+ the ``task type``
declaration, which causes no trouble, from the elaboration issues
of the task object, which is also unproblematic, since it is now independent
- of the elaboration of `Utils`.
+ of the elaboration of ``Utils``.
This separation of concerns also corresponds to
a generally sound engineering principle of separating declarations
from instances. This version of the program also compiles, binds, links,
@@ -1205,7 +1207,7 @@ We have four possible answers to this question:
Let us consider more carefully why our original sample program works
under the dynamic model of elaboration. The reason is that the code
- in the task body blocks immediately on the `accept`
+ in the task body blocks immediately on the ``accept``
statement. Now of course there is nothing to prohibit elaboration
code from making entry calls (for example from another library level task),
so we cannot tell in isolation that
@@ -1213,8 +1215,8 @@ We have four possible answers to this question:
However, in practice it is very unusual to see elaboration code
make any entry calls, and the pattern of tasks starting
- at elaboration time and then immediately blocking on `accept` or
- `select` statements is very common. What this means is that
+ at elaboration time and then immediately blocking on ``accept`` or
+ ``select`` statements is very common. What this means is that
the compiler is being too pessimistic when it analyzes the
whole package body as though it might be executed at elaboration
time.
@@ -1233,8 +1235,8 @@ We have four possible answers to this question:
in the presence of a :file:`gnat.adc` containing the above pragma,
then once again, we can compile, bind, link, and execute, obtaining
the expected result. In the presence of this pragma, the compiler does
- not trace calls in a task body, that appear after the first `accept`
- or `select` statement, and therefore does not report a potential
+ not trace calls in a task body, that appear after the first ``accept``
+ or ``select`` statement, and therefore does not report a potential
circularity in the original program.
The compiler will check to the extent it can that the above
@@ -1260,7 +1262,7 @@ The basic rule is that
be |withed| by a unit compiled with the dynamic model**.
The reason for this is that in the static model, a unit assumes that
its clients guarantee to use (the equivalent of) pragma
-`Elaborate_All` so that no elaboration checks are required
+``Elaborate_All`` so that no elaboration checks are required
in inner subprograms, and this assumption is violated if the
client is compiled with dynamic checks.
@@ -1270,7 +1272,7 @@ following criteria:
* The |withed| unit is itself compiled with dynamic elaboration
- checks (that is with the *-gnatE* switch.
+ checks (that is with the :switch:`-gnatE` switch.
* The |withed| unit is an internal GNAT implementation unit from
the System, Interfaces, Ada, or GNAT hierarchies.
@@ -1278,12 +1280,12 @@ following criteria:
* The |withed| unit has pragma Preelaborate or pragma Pure.
* The |withing| unit (that is the client) has an explicit pragma
- `Elaborate_All` for the |withed| unit.
+ ``Elaborate_All`` for the |withed| unit.
If this rule is violated, that is if a unit with dynamic elaboration
checks |withs| a unit that does not meet one of the above four
-criteria, then the binder (`gnatbind`) will issue a warning
+criteria, then the binder (``gnatbind``) will issue a warning
similar to that in the following example::
warning: "x.ads" has dynamic elaboration checks and with's
@@ -1291,7 +1293,7 @@ similar to that in the following example::
These warnings indicate that the rule has been violated, and that as a result
elaboration checks may be missed in the resulting executable file.
-This warning may be suppressed using the *-ws* binder switch
+This warning may be suppressed using the :switch:`-ws` binder switch
in the usual manner.
One useful application of this mixing rule is in the case of a subsystem
@@ -1324,14 +1326,14 @@ diagnostics. For example::
info: reason: pragma Elaborate in unit "proc (body)"
In this case we have a cycle that the binder cannot break. On the one
-hand, there is an explicit pragma Elaborate in `proc` for
-`pack`. This means that the body of `pack` must be elaborated
-before the body of `proc`. On the other hand, there is elaboration
-code in `pack` that calls a subprogram in `proc`. This means
+hand, there is an explicit pragma Elaborate in ``proc`` for
+``pack``. This means that the body of ``pack`` must be elaborated
+before the body of ``proc``. On the other hand, there is elaboration
+code in ``pack`` that calls a subprogram in ``proc``. This means
that for maximum safety, there should really be a pragma
-Elaborate_All in `pack` for `proc` which would require that
-the body of `proc` be elaborated before the body of
-`pack`. Clearly both requirements cannot be satisfied.
+Elaborate_All in ``pack`` for ``proc`` which would require that
+the body of ``proc`` be elaborated before the body of
+``pack``. Clearly both requirements cannot be satisfied.
Faced with a circularity of this kind, you have three different options.
@@ -1348,14 +1350,14 @@ Faced with a circularity of this kind, you have three different options.
* *Perform dynamic checks*
- If the compilations are done using the *-gnatE*
+ If the compilations are done using the :switch:`-gnatE`
(dynamic elaboration check) switch, then GNAT behaves in a quite different
manner. Dynamic checks are generated for all calls that could possibly result
in raising an exception. With this switch, the compiler does not generate
- implicit `Elaborate` or `Elaborate_All` pragmas. The behavior then is
+ implicit ``Elaborate`` or ``Elaborate_All`` pragmas. The behavior then is
exactly as specified in the :title:`Ada Reference Manual`.
The binder will generate
- an executable program that may or may not raise `Program_Error`, and then
+ an executable program that may or may not raise ``Program_Error``, and then
it is the programmer's job to ensure that it does not raise an exception. Note
that it is important to compile all units with the switch, it cannot be used
selectively.
@@ -1367,18 +1369,18 @@ Faced with a circularity of this kind, you have three different options.
are absolutely sure that your program cannot raise any elaboration
exceptions, and you still want to use the dynamic elaboration model,
then you can use the configuration pragma
- `Suppress (Elaboration_Check)` to suppress all such checks. For
+ ``Suppress (Elaboration_Check)`` to suppress all such checks. For
example this pragma could be placed in the :file:`gnat.adc` file.
* *Suppress checks selectively*
When you know that certain calls or instantiations in elaboration code cannot
possibly lead to an elaboration error, and the binder nevertheless complains
- about implicit `Elaborate` and `Elaborate_All` pragmas that lead to
+ about implicit ``Elaborate`` and ``Elaborate_All`` pragmas that lead to
elaboration circularities, it is possible to remove those warnings locally and
obtain a program that will bind. Clearly this can be unsafe, and it is the
responsibility of the programmer to make sure that the resulting program has no
- elaboration anomalies. The pragma `Suppress (Elaboration_Check)` can be
+ elaboration anomalies. The pragma ``Suppress (Elaboration_Check)`` can be
used with different granularity to suppress warnings and break elaboration
circularities:
@@ -1399,11 +1401,11 @@ Faced with a circularity of this kind, you have three different options.
* Use Pragma Elaborate.
As previously described in section :ref:`Treatment_of_Pragma_Elaborate`,
- GNAT in static mode assumes that a `pragma` Elaborate indicates correctly
+ GNAT in static mode assumes that a ``pragma`` Elaborate indicates correctly
that no elaboration checks are required on calls to the designated unit.
There may be cases in which the caller knows that no transitive calls
- can occur, so that a `pragma Elaborate` will be sufficient in a
- case where `pragma Elaborate_All` would cause a circularity.
+ can occur, so that a ``pragma Elaborate`` will be sufficient in a
+ case where ``pragma Elaborate_All`` would cause a circularity.
These five cases are listed in order of decreasing safety, and therefore
require increasing programmer care in their application. Consider the
@@ -1474,35 +1476,35 @@ Faced with a circularity of this kind, you have three different options.
info: which is withed by:
info: "pack1 (body)"
- The sources of the circularity are the two calls to `Pack2.Pure` and
- `Pack2.F2` in the body of `Pack1`. We can see that the call to
+ The sources of the circularity are the two calls to ``Pack2.Pure`` and
+ ``Pack2.F2`` in the body of ``Pack1``. We can see that the call to
F2 is safe, even though F2 calls F1, because the call appears after the
elaboration of the body of F1. Therefore the pragma (1) is safe, and will
remove the warning on the call. It is also possible to use pragma (2)
because there are no other potentially unsafe calls in the block.
- The call to `Pure` is safe because this function does not depend on the
- state of `Pack2`. Therefore any call to this function is safe, and it
+ The call to ``Pure`` is safe because this function does not depend on the
+ state of ``Pack2``. Therefore any call to this function is safe, and it
is correct to place pragma (3) in the corresponding package spec.
- Finally, we could place pragma (4) in the spec of `Pack2` to disable
+ Finally, we could place pragma (4) in the spec of ``Pack2`` to disable
warnings on all calls to functions declared therein. Note that this is not
necessarily safe, and requires more detailed examination of the subprogram
- bodies involved. In particular, a call to `F2` requires that `F1`
+ bodies involved. In particular, a call to ``F2`` requires that ``F1``
be already elaborated.
It is hard to generalize on which of these four approaches should be
taken. Obviously if it is possible to fix the program so that the default
treatment works, this is preferable, but this may not always be practical.
-It is certainly simple enough to use *-gnatE*
+It is certainly simple enough to use :switch:`-gnatE`
but the danger in this case is that, even if the GNAT binder
finds a correct elaboration order, it may not always do so,
and certainly a binder from another Ada compiler might not. A
combination of testing and analysis (for which the
-information messages generated with the *-gnatel*
+information messages generated with the :switch:`-gnatel`
switch can be useful) must be used to ensure that the program is free
of errors. One switch that is useful in this testing is the
-*-p (pessimistic elaboration order)* switch for `gnatbind`.
+:switch:`-p` (pessimistic elaboration order) switch for ``gnatbind``.
Normally the binder tries to find an order that has the best chance
of avoiding elaboration problems. However, if this switch is used, the binder
plays a devil's advocate role, and tries to choose the order that
@@ -1519,7 +1521,7 @@ that the compiler can handle cases where it is impossible to determine
a correct order statically, and it checks that an exception is indeed
raised at run time.
-This one test must be compiled and run using the *-gnatE*
+This one test must be compiled and run using the :switch:`-gnatE`
switch, and then it passes. Alternatively, the entire suite can
be run using this switch. It is never wrong to run with the dynamic
elaboration switch if your code is correct, and we assume that the
@@ -1539,26 +1541,26 @@ In rare cases, the static elaboration model fails to prevent
dispatching calls to not-yet-elaborated subprograms. In such cases, we
fall back to run-time checks; premature calls to any primitive
operation of a tagged type before the body of the operation has been
-elaborated will raise `Program_Error`.
+elaborated will raise ``Program_Error``.
Access-to-subprogram types, however, are handled conservatively in many
cases. This was not true in earlier versions of the compiler; you can use
-the *-gnatd.U* debug switch to revert to the old behavior if the new
+the :switch:`-gnatd.U` debug switch to revert to the old behavior if the new
conservative behavior causes elaboration cycles. Here, 'conservative' means
-that if you do `P'Access` during elaboration, the compiler will normally
-assume that you might call `P` indirectly during elaboration, so it adds an
-implicit `pragma Elaborate_All` on the library unit containing `P`. The
-*-gnatd.U* switch is safe if you know there are no such calls. If the
-program worked before, it will continue to work with *-gnatd.U*. But beware
+that if you do ``P'Access`` during elaboration, the compiler will normally
+assume that you might call ``P`` indirectly during elaboration, so it adds an
+implicit ``pragma Elaborate_All`` on the library unit containing ``P``. The
+:switch:`-gnatd.U` switch is safe if you know there are no such calls. If the
+program worked before, it will continue to work with :switch:`-gnatd.U`. But beware
that code modifications such as adding an indirect call can cause erroneous
-behavior in the presence of *-gnatd.U*.
+behavior in the presence of :switch:`-gnatd.U`.
These implicit Elaborate_All pragmas are not added in all cases, because
they cause elaboration cycles in certain common code patterns. If you want
-even more conservative handling of P'Access, you can use the *-gnatd.o*
+even more conservative handling of P'Access, you can use the :switch:`-gnatd.o`
switch.
-See `debug.adb` for documentation on the *-gnatd...* debug switches.
+See :file:`debug.adb` for documentation on the :switch:`-gnatd...` debug switches.
.. _Summary_of_Procedures_for_Elaboration_Control:
@@ -1574,16 +1576,16 @@ binds your program, then you can be confident that, apart from issues
raised by the use of access-to-subprogram types and dynamic dispatching,
the program is free of elaboration errors. If it is important that the
program be portable to other compilers than GNAT, then use the
-*-gnatel*
-switch to generate messages about missing `Elaborate` or
-`Elaborate_All` pragmas, and supply the missing pragmas.
+:switch:`-gnatel`
+switch to generate messages about missing ``Elaborate`` or
+``Elaborate_All`` pragmas, and supply the missing pragmas.
If the program fails to bind using the default static elaboration
handling, then you can fix the program to eliminate the binder
message, or recompile the entire program with the
-*-gnatE* switch to generate dynamic elaboration checks,
+:switch:`-gnatE` switch to generate dynamic elaboration checks,
and, if you are sure there really are no elaboration problems,
-use a global pragma `Suppress (Elaboration_Check)`.
+use a global pragma ``Suppress (Elaboration_Check)``.
.. _Other_Elaboration_Order_Considerations:
@@ -1669,10 +1671,10 @@ and
There is no language rule to prefer one or the other, both are correct
from an order of elaboration point of view. But the programmatic effects
of the two orders are very different. In the first, the elaboration routine
-of `Calc` initializes `Z` to zero, and then the main program
+of ``Calc`` initializes ``Z`` to zero, and then the main program
runs with this value of zero. But in the second order, the elaboration
-routine of `Calc` runs after the body of Init_Constants has set
-`X` and `Y` and thus `Z` is set to 7 before `Main` runs.
+routine of ``Calc`` runs after the body of Init_Constants has set
+``X`` and ``Y`` and thus ``Z`` is set to 7 before ``Main`` runs.
One could perhaps by applying pretty clever non-artificial intelligence
to the situation guess that it is more likely that the second order of
@@ -1690,14 +1692,14 @@ case, that could have been achieved by adding to the spec of Calc:
pragma Elaborate_All (Constants);
-which requires that the body (if any) and spec of `Constants`,
+which requires that the body (if any) and spec of ``Constants``,
as well as the body and spec of any unit |withed| by
-`Constants` be elaborated before `Calc` is elaborated.
+``Constants`` be elaborated before ``Calc`` is elaborated.
Clearly no automatic method can always guess which alternative you require,
and if you are working with legacy code that had constraints of this kind
-which were not properly specified by adding `Elaborate` or
-`Elaborate_All` pragmas, then indeed it is possible that two different
+which were not properly specified by adding ``Elaborate`` or
+``Elaborate_All`` pragmas, then indeed it is possible that two different
compilers can choose different orders.
However, GNAT does attempt to diagnose the common situation where there
@@ -1707,13 +1709,13 @@ indirectly initializes one or more of these variables. This is the situation
in which a pragma Elaborate_Body is usually desirable, and GNAT will generate
a warning that suggests this addition if it detects this situation.
-The `gnatbind` *-p* switch may be useful in smoking
+The ``gnatbind` :switch:`-p` switch may be useful in smoking
out problems. This switch causes bodies to be elaborated as late as possible
instead of as early as possible. In the example above, it would have forced
the choice of the first elaboration order. If you get different results
when using this switch, and particularly if one set of results is right,
and one is wrong as far as you are concerned, it shows that you have some
-missing `Elaborate` pragmas. For the example above, we have the
+missing ``Elaborate`` pragmas. For the example above, we have the
following output:
.. code-block:: sh
@@ -1729,7 +1731,7 @@ It is of course quite unlikely that both these results are correct, so
it is up to you in a case like this to investigate the source of the
difference, by looking at the two elaboration orders that are chosen,
and figuring out which is correct, and then adding the necessary
-`Elaborate` or `Elaborate_All` pragmas to ensure the desired order.
+``Elaborate`` or ``Elaborate_All`` pragmas to ensure the desired order.
.. _Determining_the_Chosen_Elaboration_Order:
@@ -1780,7 +1782,7 @@ flag that the corresponding body is now elaborated.
You can also ask the binder to generate a more
readable list of the elaboration order using the
-`-l` switch when invoking the binder. Here is
+:switch:`-l` switch when invoking the binder. Here is
an example of the output generated by this switch::
ada (spec)
diff --git a/gcc/ada/doc/gnat_ugn/example_of_binder_output.rst b/gcc/ada/doc/gnat_ugn/example_of_binder_output.rst
index 4e78164..ad587ce 100644
--- a/gcc/ada/doc/gnat_ugn/example_of_binder_output.rst
+++ b/gcc/ada/doc/gnat_ugn/example_of_binder_output.rst
@@ -731,13 +731,13 @@ Comments have been added for clarification purposes.
The Ada code in the above example is exactly what is generated by the
binder. We have added comments to more clearly indicate the function
-of each part of the generated `Ada_Main` package.
+of each part of the generated ``Ada_Main`` package.
The code is standard Ada in all respects, and can be processed by any
tools that handle Ada. In particular, it is possible to use the debugger
-in Ada mode to debug the generated `Ada_Main` package. For example,
+in Ada mode to debug the generated ``Ada_Main`` package. For example,
suppose that for reasons that you do not understand, your program is crashing
-during elaboration of the body of `Ada.Text_IO`. To locate this bug,
+during elaboration of the body of ``Ada.Text_IO``. To locate this bug,
you can place a breakpoint on the call:
.. code-block:: ada
diff --git a/gcc/ada/doc/gnat_ugn/getting_started_with_gnat.rst b/gcc/ada/doc/gnat_ugn/getting_started_with_gnat.rst
index f34b701..756e301 100644
--- a/gcc/ada/doc/gnat_ugn/getting_started_with_gnat.rst
+++ b/gcc/ada/doc/gnat_ugn/getting_started_with_gnat.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. _Getting_Started_with_GNAT:
*************************
@@ -27,7 +29,7 @@ file:
* The file(s) must be bound using the GNAT binder.
* All appropriate object files must be linked to produce an executable.
-All three steps are most commonly handled by using the *gnatmake*
+All three steps are most commonly handled by using the ``gnatmake``
utility program that, given the name of the main program, automatically
performs the necessary compilation, binding and linking steps.
@@ -61,15 +63,15 @@ with periods replaced by hyphens; the
extension is :file:`ads` for a
spec and :file:`adb` for a body.
You can override this default file naming convention by use of the
-special pragma `Source_File_Name` (for further information please
+special pragma ``Source_File_Name`` (for further information please
see :ref:`Using_Other_File_Names`).
Alternatively, if you want to rename your files according to this default
convention, which is probably more convenient if you will be using GNAT
-for all your compilations, then the `gnatchop` utility
+for all your compilations, then the ``gnatchop`` utility
can be used to generate correctly-named source files
(see :ref:`Renaming_Files_with_gnatchop`).
-You can compile the program using the following command (`$` is used
+You can compile the program using the following command (``$`` is used
as the command prompt in the examples in this document):
.. code-block:: sh
@@ -77,15 +79,15 @@ as the command prompt in the examples in this document):
$ gcc -c hello.adb
-*gcc* is the command used to run the compiler. This compiler is
+``gcc`` is the command used to run the compiler. This compiler is
capable of compiling programs in several languages, including Ada and
C. It assumes that you have given it an Ada program if the file extension is
either :file:`.ads` or :file:`.adb`, and it will then call
the GNAT compiler to compile the specified file.
-The :option:`-c` switch is required. It tells *gcc* to only do a
-compilation. (For C programs, *gcc* can also do linking, but this
-capability is not used directly for Ada programs, so the :option:`-c`
+The :switch:`-c` switch is required. It tells ``gcc`` to only do a
+compilation. (For C programs, ``gcc`` can also do linking, but this
+capability is not used directly for Ada programs, so the :switch:`-c`
switch must always be present.)
This compile command generates a file
@@ -95,9 +97,9 @@ an 'Ada Library Information' file :file:`hello.ali`,
which contains additional information used to check
that an Ada program is consistent.
To build an executable file,
-use `gnatbind` to bind the program
-and *gnatlink* to link it. The
-argument to both `gnatbind` and *gnatlink* is the name of the
+use ``gnatbind`` to bind the program
+and ``gnatlink`` to link it. The
+argument to both ``gnatbind`` and ``gnatlink`` is the name of the
:file:`ALI` file, but the default extension of :file:`.ali` can
be omitted. This means that in the most common case, the argument
is simply the name of the main program:
@@ -107,14 +109,14 @@ is simply the name of the main program:
$ gnatbind hello
$ gnatlink hello
-A simpler method of carrying out these steps is to use *gnatmake*,
+A simpler method of carrying out these steps is to use ``gnatmake``,
a master program that invokes all the required
compilation, binding and linking tools in the correct order. In particular,
-*gnatmake* automatically recompiles any sources that have been
+``gnatmake`` automatically recompiles any sources that have been
modified since they were last compiled, or sources that depend
on such modified sources, so that 'version skew' is avoided.
-.. index:: Version skew (avoided by *gnatmake*)
+.. index:: Version skew (avoided by ``gnatmake``)
.. code-block:: sh
@@ -178,11 +180,11 @@ following three separate files:
*greetings.ads*
- spec of package `Greetings`
+ spec of package ``Greetings``
*greetings.adb*
- body of package `Greetings`
+ body of package ``Greetings``
*gmain.adb*
@@ -204,7 +206,7 @@ In particular it is perfectly fine to compile the main program first.
Also, it is not necessary to compile package specs in the case where
there is an accompanying body; you only need to compile the body. If you want
to submit these files to the compiler for semantic checking and not code
-generation, then use the :option:`-gnatc` switch:
+generation, then use the :switch:`-gnatc` switch:
.. code-block:: sh
@@ -212,7 +214,7 @@ generation, then use the :option:`-gnatc` switch:
Although the compilation can be done in separate steps as in the
above example, in practice it is almost always more convenient
-to use the *gnatmake* tool. All you need to know in this case
+to use the ``gnatmake`` tool. All you need to know in this case
is the name of the main program's source file. The effect of the above four
commands can be achieved with a single one:
@@ -220,16 +222,16 @@ commands can be achieved with a single one:
$ gnatmake gmain.adb
-In the next section we discuss the advantages of using *gnatmake* in
+In the next section we discuss the advantages of using ``gnatmake`` in
more detail.
.. _Using_the_gnatmake_Utility:
-Using the *gnatmake* Utility
-============================
+Using the ``gnatmake`` Utility
+==============================
If you work on a program by compiling single components at a time using
-*gcc*, you typically keep track of the units you modify. In order to
+``gcc``, you typically keep track of the units you modify. In order to
build a consistent system, you compile not only these units, but also any
units that depend on the units you have modified.
For example, in the preceding case,
@@ -238,7 +240,7 @@ you edit :file:`greetings.ads`, you must recompile both
:file:`greetings.adb` and :file:`gmain.adb`, because both files contain
units that depend on :file:`greetings.ads`.
-*gnatbind* will warn you if you forget one of these compilation
+``gnatbind`` will warn you if you forget one of these compilation
steps, so that it is impossible to generate an inconsistent program as a
result of forgetting to do a compilation. Nevertheless it is tedious and
error-prone to keep track of dependencies among units.
@@ -248,7 +250,7 @@ if the dependencies change as you change the program, you must make
sure that the makefile is kept up-to-date manually, which is also an
error-prone process.
-The *gnatmake* utility takes care of these details automatically.
+The ``gnatmake`` utility takes care of these details automatically.
Invoke it using either one of the following forms:
.. code-block:: sh
@@ -257,19 +259,19 @@ Invoke it using either one of the following forms:
$ gnatmake gmain
The argument is the name of the file containing the main program;
-you may omit the extension. *gnatmake*
+you may omit the extension. ``gnatmake``
examines the environment, automatically recompiles any files that need
recompiling, and binds and links the resulting set of object files,
generating the executable file, :file:`gmain`.
In a large program, it
-can be extremely helpful to use *gnatmake*, because working out by hand
+can be extremely helpful to use ``gnatmake``, because working out by hand
what needs to be recompiled can be difficult.
-Note that *gnatmake* takes into account all the Ada rules that
+Note that ``gnatmake`` takes into account all the Ada rules that
establish dependencies among units. These include dependencies that result
from inlining subprogram bodies, and from
generic instantiation. Unlike some other
-Ada make tools, *gnatmake* does not rely on the dependencies that were
+Ada make tools, ``gnatmake`` does not rely on the dependencies that were
found by the compiler on a previous compilation, which may possibly
-be wrong when sources change. *gnatmake* determines the exact set of
+be wrong when sources change. ``gnatmake`` determines the exact set of
dependencies from scratch each time it is run.
diff --git a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst
index 39becd6..64c3d9c 100644
--- a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst
+++ b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. |with| replace:: *with*
.. |withs| replace:: *with*\ s
.. |withed| replace:: *with*\ ed
@@ -55,17 +57,17 @@ An incorrect Ada program may be handled in three ways by the GNAT compiler:
The GNAT Debugger GDB
---------------------
-`GDB` is a general purpose, platform-independent debugger that
-can be used to debug mixed-language programs compiled with *gcc*,
+``GDB`` is a general purpose, platform-independent debugger that
+can be used to debug mixed-language programs compiled with ``gcc``,
and in particular is capable of debugging Ada programs compiled with
-GNAT. The latest versions of `GDB` are Ada-aware and can handle
+GNAT. The latest versions of ``GDB`` are Ada-aware and can handle
complex Ada data structures.
See :title:`Debugging with GDB`,
-for full details on the usage of `GDB`, including a section on
+for full details on the usage of ``GDB``, including a section on
its usage on programs. This manual should be consulted for full
details. The section that follows is a brief introduction to the
-philosophy and use of `GDB`.
+philosophy and use of ``GDB``.
When GNAT programs are compiled, the compiler optionally writes debugging
information into the generated object file, including information on
@@ -74,7 +76,7 @@ separate from the generated code. It makes the object files considerably
larger, but it does not add to the size of the actual executable that
will be loaded into memory, and has no impact on run-time performance. The
generation of debug information is triggered by the use of the
--g switch in the *gcc* or *gnatmake* command
+:switch:`-g` switch in the ``gcc`` or ``gnatmake`` command
used to carry out the compilations. It is important to emphasize that
the use of these options does not change the generated code.
@@ -86,7 +88,7 @@ details about Ada types and variables to be encoded into these
standard C formats. Details of this encoding scheme may be found in
the file exp_dbug.ads in the GNAT source distribution. However, the
details of this encoding are, in general, of no interest to a user,
-since `GDB` automatically performs the necessary decoding.
+since ``GDB`` automatically performs the necessary decoding.
When a program is bound and linked, the debugging information is
collected from the object files, and stored in the executable image of
@@ -96,14 +98,14 @@ the executable program itself. Furthermore, if this program is run in
the normal manner, it runs exactly as if the debug information were
not present, and takes no more actual memory.
-However, if the program is run under control of `GDB`, the
+However, if the program is run under control of ``GDB``, the
debugger is activated. The image of the program is loaded, at which
point it is ready to run. If a run command is given, then the program
-will run exactly as it would have if `GDB` were not present. This
-is a crucial part of the `GDB` design philosophy. `GDB` is
+will run exactly as it would have if ``GDB`` were not present. This
+is a crucial part of the ``GDB`` design philosophy. ``GDB`` is
entirely non-intrusive until a breakpoint is encountered. If no
breakpoint is ever hit, the program will run exactly as it would if no
-debugger were present. When a breakpoint is hit, `GDB` accesses
+debugger were present. When a breakpoint is hit, ``GDB`` accesses
the debugging information and can respond to user commands to inspect
variables, and more generally to report on the state of execution.
@@ -114,22 +116,22 @@ Running GDB
This section describes how to initiate the debugger.
-The debugger can be launched from a `GPS` menu or
+The debugger can be launched from a ``GPS`` menu or
directly from the command line. The description below covers the latter use.
-All the commands shown can be used in the `GPS` debug console window,
+All the commands shown can be used in the ``GPS`` debug console window,
but there are usually more GUI-based ways to achieve the same effect.
-The command to run `GDB` is
+The command to run ``GDB`` is
::
$ gdb program
-where `program` is the name of the executable file. This
+where ``program`` is the name of the executable file. This
activates the debugger and results in a prompt for debugger commands.
-The simplest command is simply `run`, which causes the program to run
+The simplest command is simply ``run``, which causes the program to run
exactly as if the debugger were not present. The following section
-describes some of the additional commands that can be given to `GDB`.
+describes some of the additional commands that can be given to ``GDB``.
.. _Introduction_to_GDB_Commands:
@@ -137,75 +139,75 @@ describes some of the additional commands that can be given to `GDB`.
Introduction to GDB Commands
----------------------------
-`GDB` contains a large repertoire of commands.
+``GDB`` contains a large repertoire of commands.
See :title:`Debugging with GDB` for extensive documentation on the use
of these commands, together with examples of their use. Furthermore,
the command *help* invoked from within GDB activates a simple help
facility which summarizes the available commands and their options.
In this section we summarize a few of the most commonly
-used commands to give an idea of what `GDB` is about. You should create
+used commands to give an idea of what ``GDB`` is about. You should create
a simple program with debugging information and experiment with the use of
-these `GDB` commands on the program as you read through the
+these ``GDB`` commands on the program as you read through the
following section.
-* *set args `arguments`*
- The `arguments` list above is a list of arguments to be passed to
+* :samp:`set args {arguments}`
+ The *arguments* list above is a list of arguments to be passed to
the program on a subsequent run command, just as though the arguments
- had been entered on a normal invocation of the program. The `set args`
+ had been entered on a normal invocation of the program. The ``set args``
command is not needed if the program does not require arguments.
-* *run*
- The `run` command causes execution of the program to start from
+* :samp:`run`
+ The ``run`` command causes execution of the program to start from
the beginning. If the program is already running, that is to say if
you are currently positioned at a breakpoint, then a prompt will ask
for confirmation that you want to abandon the current execution and
restart.
-* *breakpoint `location`*
+* :samp:`breakpoint {location}`
The breakpoint command sets a breakpoint, that is to say a point at which
- execution will halt and `GDB` will await further
- commands. `location` is
- either a line number within a file, given in the format `file:linenumber`,
+ execution will halt and ``GDB`` will await further
+ commands. *location* is
+ either a line number within a file, given in the format ``file:linenumber``,
or it is the name of a subprogram. If you request that a breakpoint be set on
a subprogram that is overloaded, a prompt will ask you to specify on which of
those subprograms you want to breakpoint. You can also
specify that all of them should be breakpointed. If the program is run
and execution encounters the breakpoint, then the program
- stops and `GDB` signals that the breakpoint was encountered by
+ stops and ``GDB`` signals that the breakpoint was encountered by
printing the line of code before which the program is halted.
-* *catch exception `name`*
+* :samp:`catch exception {name}`
This command causes the program execution to stop whenever exception
- `name` is raised. If `name` is omitted, then the execution is
+ ``name`` is raised. If ``name`` is omitted, then the execution is
suspended when any exception is raised.
-* *print `expression`*
+* :samp:`print {expression}`
This will print the value of the given expression. Most simple
- Ada expression formats are properly handled by `GDB`, so the expression
+ Ada expression formats are properly handled by ``GDB``, so the expression
can contain function calls, variables, operators, and attribute references.
-* *continue*
+* :samp:`continue`
Continues execution following a breakpoint, until the next breakpoint or the
termination of the program.
-* *step*
+* :samp:`step`
Executes a single line after a breakpoint. If the next statement
is a subprogram call, execution continues into (the first statement of)
the called subprogram.
-* *next*
+* :samp:`next`
Executes a single line. If this line is a subprogram call, executes and
returns from the call.
-* *list*
+* :samp:`list`
Lists a few lines around the current source location. In practice, it
is usually more convenient to have a separate edit window open with the
relevant source file displayed. Successive applications of this command
@@ -213,31 +215,31 @@ following section.
line number, in which case it displays a few lines around the specified one.
-* *backtrace*
+* :samp:`backtrace`
Displays a backtrace of the call chain. This command is typically
used after a breakpoint has occurred, to examine the sequence of calls that
leads to the current breakpoint. The display includes one line for each
activation record (frame) corresponding to an active subprogram.
-* *up*
- At a breakpoint, `GDB` can display the values of variables local
- to the current frame. The command `up` can be used to
+* :samp:`up`
+ At a breakpoint, ``GDB`` can display the values of variables local
+ to the current frame. The command ``up`` can be used to
examine the contents of other active frames, by moving the focus up
the stack, that is to say from callee to caller, one frame at a time.
-* *down*
- Moves the focus of `GDB` down from the frame currently being
+* :samp:`down`
+ Moves the focus of ``GDB`` down from the frame currently being
examined to the frame of its callee (the reverse of the previous command),
-* *frame `n`*
+* :samp:`frame {n}`
Inspect the frame with the given number. The value 0 denotes the frame
of the current breakpoint, that is to say the top of the call stack.
-* *kill*
+* :samp:`kill`
Kills the child process in which the program is running under GDB.
This may be useful for several purposes:
@@ -251,7 +253,7 @@ following section.
* It allows you to debug a core dump rather than a running process.
The above list is a very short introduction to the commands that
-`GDB` provides. Important additional capabilities, including conditional
+``GDB`` provides. Important additional capabilities, including conditional
breakpoints, the ability to execute command sequences on a breakpoint,
the ability to debug at the machine instruction level and many other
features are described in detail in :title:`Debugging with GDB`.
@@ -266,24 +268,24 @@ Using Ada Expressions
.. index:: Ada expressions (in gdb)
-`GDB` supports a fairly large subset of Ada expression syntax, with some
+``GDB`` supports a fairly large subset of Ada expression syntax, with some
extensions. The philosophy behind the design of this subset is
- * That `GDB` should provide basic literals and access to operations for
+ * That ``GDB`` should provide basic literals and access to operations for
arithmetic, dereferencing, field selection, indexing, and subprogram calls,
leaving more sophisticated computations to subprograms written into the
- program (which therefore may be called from `GDB`).
+ program (which therefore may be called from ``GDB``).
* That type safety and strict adherence to Ada language restrictions
are not particularly relevant in a debugging context.
- * That brevity is important to the `GDB` user.
+ * That brevity is important to the ``GDB`` user.
Thus, for brevity, the debugger acts as if there were
-implicit `with` and `use` clauses in effect for all user-written
+implicit ``with`` and ``use`` clauses in effect for all user-written
packages, thus making it unnecessary to fully qualify most names with
their packages, regardless of context. Where this causes ambiguity,
-`GDB` asks the user's intent.
+``GDB`` asks the user's intent.
For details on the supported Ada syntax, see :title:`Debugging with GDB`.
@@ -293,7 +295,7 @@ For details on the supported Ada syntax, see :title:`Debugging with GDB`.
Calling User-Defined Subprograms
--------------------------------
-An important capability of `GDB` is the ability to call user-defined
+An important capability of ``GDB`` is the ability to call user-defined
subprograms while debugging. This is achieved simply by entering
a subprogram call statement in the form:
@@ -301,15 +303,15 @@ a subprogram call statement in the form:
call subprogram-name (parameters)
-The keyword `call` can be omitted in the normal case where the
-`subprogram-name` does not coincide with any of the predefined
-`GDB` commands.
+The keyword ``call`` can be omitted in the normal case where the
+``subprogram-name`` does not coincide with any of the predefined
+``GDB`` commands.
The effect is to invoke the given subprogram, passing it the
list of parameters that is supplied. The parameters can be expressions and
can include variables from the program being debugged. The
subprogram must be defined
-at the library level within your program, and `GDB` will call the
+at the library level within your program, and ``GDB`` will call the
subprogram within the environment of your program execution (which
means that the subprogram is free to access or even modify variables
within your program).
@@ -319,7 +321,7 @@ debugging routines that are tailored to particular data structures
in your program. Such debugging routines can be written to provide a suitably
high-level description of an abstract type, rather than a low-level dump
of its physical layout. After all, the standard
-`GDB print` command only knows the physical layout of your
+``GDB print`` command only knows the physical layout of your
types, not their abstract meaning. Debugging routines can provide information
at the desired semantic level and are thus enormously useful.
@@ -327,7 +329,7 @@ For example, when debugging GNAT itself, it is crucial to have access to
the contents of the tree nodes used to represent the program internally.
But tree nodes are represented simply by an integer value (which in turn
is an index into a table of nodes).
-Using the `print` command on a tree node would simply print this integer
+Using the ``print`` command on a tree node would simply print this integer
value, which is not very useful. But the PN routine (defined in file
treepr.adb in the GNAT sources) takes a tree node as input, and displays
a useful high level representation of the tree node, which includes the
@@ -350,9 +352,9 @@ the elements in the desired format.
Using the *next* Command in a Function
--------------------------------------
-When you use the `next` command in a function, the current source
+When you use the ``next`` command in a function, the current source
location will advance to the next statement as usual. A special case
-arises in the case of a `return` statement.
+arises in the case of a ``return`` statement.
Part of the code for a return statement is the 'epilogue' of the function.
This is the code that returns to the caller. There is only one copy of
@@ -361,7 +363,7 @@ statement in the function if there is more than one return. In some
implementations, this epilogue is associated with the first statement
of the function.
-The result is that if you use the `next` command from a return
+The result is that if you use the ``next`` command from a return
statement that is not the last return statement of the function you
may see a strange apparent jump to the last return statement or to
the start of the function. You should simply ignore this odd jump.
@@ -380,25 +382,25 @@ You can set catchpoints that stop the program execution when your program
raises selected exceptions.
-* *catch exception*
+* :samp:`catch exception`
Set a catchpoint that stops execution whenever (any task in the) program
raises any exception.
-* *catch exception `name`*
+* :samp:`catch exception {name}`
Set a catchpoint that stops execution whenever (any task in the) program
- raises the exception `name`.
+ raises the exception *name*.
-* *catch exception unhandled*
+* :samp:`catch exception unhandled`
Set a catchpoint that stops executing whenever (any task in the) program
raises an exception for which there is no handler.
-* *info exceptions*, *info exceptions `regexp`*
- The `info exceptions` command permits the user to examine all defined
- exceptions within Ada programs. With a regular expression, `regexp`, as
- argument, prints out only those exceptions whose name matches `regexp`.
+* :samp:`info exceptions`, :samp:`info exceptions {regexp}`
+ The ``info exceptions`` command permits the user to examine all defined
+ exceptions within Ada programs. With a regular expression, *regexp*, as
+ argument, prints out only those exceptions whose name matches *regexp*.
.. index:: Tasks (in gdb)
@@ -408,10 +410,10 @@ raises selected exceptions.
Ada Tasks
---------
-`GDB` allows the following task-related commands:
+``GDB`` allows the following task-related commands:
-* *info tasks*
+* :samp:`info tasks`
This command shows a list of current Ada tasks, as in the following example:
::
@@ -431,30 +433,30 @@ Ada Tasks
.. index:: Breakpoints and tasks
-* *break `linespec` task `taskid`*, *break `linespec` task `taskid` if ...*
+* ``break``*linespec* ``task`` *taskid*, ``break`` *linespec* ``task`` *taskid* ``if`` ...
- These commands are like the `break ... thread ...`.
- `linespec` specifies source lines.
+ These commands are like the ``break ... thread ...``.
+ *linespec* specifies source lines.
Use the qualifier :samp:`task {taskid}` with a breakpoint command
- to specify that you only want `GDB` to stop the program when a
- particular Ada task reaches this breakpoint. `taskid` is one of the
- numeric task identifiers assigned by `GDB`, shown in the first
+ to specify that you only want ``GDB`` to stop the program when a
+ particular Ada task reaches this breakpoint. *taskid* is one of the
+ numeric task identifiers assigned by ``GDB``, shown in the first
column of the ``info tasks`` display.
If you do not specify :samp:`task {taskid}` when you set a
breakpoint, the breakpoint applies to *all* tasks of your
program.
- You can use the `task` qualifier on conditional breakpoints as
+ You can use the ``task`` qualifier on conditional breakpoints as
well; in this case, place :samp:`task {taskid}` before the
- breakpoint condition (before the `if`).
+ breakpoint condition (before the ``if``).
.. index:: Task switching (in gdb)
-* *task `taskno`*
+* :samp:`task {taskno}`
- This command allows switching to the task referred by `taskno`. In
+ This command allows switching to the task referred by *taskno*. In
particular, this allows browsing of the backtrace of the specified
task. It is advisable to switch back to the original task before
continuing execution otherwise the scheduling of the program may be
@@ -477,7 +479,7 @@ each time an instantiation occurs, a complete copy of the original code is
made, with appropriate substitutions of formals by actuals.
It is not possible to refer to the original generic entities in
-`GDB`, but it is always possible to debug a particular instance of
+``GDB``, but it is always possible to debug a particular instance of
a generic, by using the appropriate expanded names. For example, if we have
.. code-block:: ada
@@ -594,37 +596,37 @@ The following strategies are presented in increasing order of
difficulty, corresponding to your experience in using GNAT and your
familiarity with compiler internals.
-* Run *gcc* with the *-gnatf*. This first
+* Run ``gcc`` with the :switch:`-gnatf`. This first
switch causes all errors on a given line to be reported. In its absence,
only the first error on a line is displayed.
- The *-gnatdO* switch causes errors to be displayed as soon as they
+ The :switch:`-gnatdO` switch causes errors to be displayed as soon as they
are encountered, rather than after compilation is terminated. If GNAT
terminates prematurely or goes into an infinite loop, the last error
message displayed may help to pinpoint the culprit.
-* Run *gcc* with the *-v (verbose)* switch. In this
- mode, *gcc* produces ongoing information about the progress of the
+* Run ``gcc`` with the :switch:`-v` (verbose) switch. In this
+ mode, ``gcc`` produces ongoing information about the progress of the
compilation and provides the name of each procedure as code is
generated. This switch allows you to find which Ada procedure was being
compiled when it encountered a code generation problem.
.. index:: -gnatdc switch
-* Run *gcc* with the *-gnatdc* switch. This is a GNAT specific
- switch that does for the front-end what *-v* does
+* Run ``gcc`` with the :switch:`-gnatdc` switch. This is a GNAT specific
+ switch that does for the front-end what :switch:`-v` does
for the back end. The system prints the name of each unit,
either a compilation unit or nested unit, as it is being analyzed.
* Finally, you can start
- `gdb` directly on the `gnat1` executable. `gnat1` is the
+ ``gdb`` directly on the ``gnat1`` executable. ``gnat1`` is the
front-end of GNAT, and can be run independently (normally it is just
- called from *gcc*). You can use `gdb` on `gnat1` as you
+ called from ``gcc``). You can use ``gdb`` on ``gnat1`` as you
would on a C program (but :ref:`The_GNAT_Debugger_GDB` for caveats). The
- `where` command is the first line of attack; the variable
- `lineno` (seen by `print lineno`), used by the second phase of
- `gnat1` and by the *gcc* backend, indicates the source line at
- which the execution stopped, and `input_file name` indicates the name of
+ ``where`` command is the first line of attack; the variable
+ ``lineno`` (seen by ``print lineno``), used by the second phase of
+ ``gnat1`` and by the ``gcc`` backend, indicates the source line at
+ which the execution stopped, and ``input_file name`` indicates the name of
the source file.
@@ -673,24 +675,24 @@ brief description of its organization may be helpful:
.. index:: Annex A (in Ada Reference Manual)
-* Ada files with the prefix :file:`a-` are children of `Ada`, as
+* Ada files with the prefix :file:`a-` are children of ``Ada``, as
defined in Annex A.
.. index:: Annex B (in Ada reference Manual)
-* Files with prefix :file:`i-` are children of `Interfaces`, as
+* Files with prefix :file:`i-` are children of ``Interfaces``, as
defined in Annex B.
.. index:: System (package in Ada Reference Manual)
-* Files with prefix :file:`s-` are children of `System`. This includes
+* Files with prefix :file:`s-` are children of ``System``. This includes
both language-defined children and GNAT run-time routines.
.. index:: GNAT (package)
-* Files with prefix :file:`g-` are children of `GNAT`. These are useful
+* Files with prefix :file:`g-` are children of ``GNAT``. These are useful
general-purpose packages, fully documented in their specs. All
- the other :file:`.c` files are modifications of common *gcc* files.
+ the other :file:`.c` files are modifications of common ``gcc`` files.
.. _Getting_Internal_Debugging_Information:
@@ -754,10 +756,10 @@ for a complete list of supported platforms.
.. rubric:: Tracebacks From an Unhandled Exception
A runtime non-symbolic traceback is a list of addresses of call instructions.
-To enable this feature you must use the *-E*
-`gnatbind`'s option. With this option a stack traceback is stored as part
+To enable this feature you must use the :switch:`-E`
+``gnatbind`` option. With this option a stack traceback is stored as part
of exception information. You can retrieve this information using the
-`addr2line` tool.
+``addr2line`` tool.
Here is a simple example:
@@ -791,10 +793,10 @@ Here is a simple example:
0x401373 0x40138b 0x40139c 0x401335 0x4011c4 0x4011f1 0x77e892a4
As we see the traceback lists a sequence of addresses for the unhandled
-exception `CONSTRAINT_ERROR` raised in procedure P1. It is easy to
+exception ``CONSTRAINT_ERROR`` raised in procedure P1. It is easy to
guess that this exception come from procedure P1. To translate these
addresses into the source lines where the calls appear, the
-`addr2line` tool, described below, is invaluable. The use of this tool
+``addr2line`` tool, described below, is invaluable. The use of this tool
requires the program to be compiled with debug information.
::
@@ -819,7 +821,7 @@ requires the program to be compiled with debug information.
004011F1 at /build/.../crt1.c:222
77E892A4 in ?? at ??:0
-The `addr2line` tool has several other useful options:
+The ``addr2line`` tool has several other useful options:
======================== ========================================================
:samp:`--functions` to get the function name corresponding to any location
@@ -847,7 +849,7 @@ which contains the call to the main program.
:ref:`Running_gnatbind`. The remaining entries are assorted runtime routines,
and the output will vary from platform to platform.
-It is also possible to use `GDB` with these traceback addresses to debug
+It is also possible to use ``GDB`` with these traceback addresses to debug
the program. For example, we can break at a given code location, as reported
in the stack traceback:
@@ -873,10 +875,10 @@ of calls with the same program compiled with debug information.
.. rubric:: Tracebacks From Exception Occurrences
-Non-symbolic tracebacks are obtained by using the *-E* binder argument.
+Non-symbolic tracebacks are obtained by using the :switch:`-E` binder argument.
The stack traceback is attached to the exception information string, and can
be retrieved in an exception handler within the Ada program, by means of the
-Ada facilities defined in `Ada.Exceptions`. Here is a simple example:
+Ada facilities defined in ``Ada.Exceptions``. Here is a simple example:
.. code-block:: ada
@@ -922,14 +924,14 @@ This program will output:
It is also possible to retrieve a stack traceback from anywhere in a
program. For this you need to
-use the `GNAT.Traceback` API. This package includes a procedure called
-`Call_Chain` that computes a complete stack traceback, as well as useful
+use the ``GNAT.Traceback`` API. This package includes a procedure called
+``Call_Chain`` that computes a complete stack traceback, as well as useful
display procedures described below. It is not necessary to use the
-*-E gnatbind* option in this case, because the stack traceback mechanism
+:switch:`-E` ``gnatbind`` option in this case, because the stack traceback mechanism
is invoked explicitly.
In the following example we compute a traceback at a specific location in
-the program, and we display it using `GNAT.Debug_Utilities.Image` to
+the program, and we display it using ``GNAT.Debug_Utilities.Image`` to
convert addresses to strings:
@@ -981,7 +983,7 @@ convert addresses to strings:
16#0040_1461# 16#0040_11C4# 16#0040_11F1# 16#77E8_92A4#
-You can then get further information by invoking the `addr2line`
+You can then get further information by invoking the ``addr2line``
tool as described earlier (note that the hexadecimal addresses
need to be specified in C format, with a leading '0x').
@@ -1051,13 +1053,13 @@ Here is an example:
004011F1 in mainCRTStartup at crt1.c:222
77E892A4 in ?? at ??:0
-In the above example the ``.\`` syntax in the *gnatmake* command
-is currently required by *addr2line* for files that are in
+In the above example the ``.\`` syntax in the ``gnatmake`` command
+is currently required by ``addr2line`` for files that are in
the current working directory.
Moreover, the exact sequence of linker options may vary from platform
to platform.
-The above *-largs* section is for Windows platforms. By contrast,
-under Unix there is no need for the *-largs* section.
+The above :switch:`-largs` section is for Windows platforms. By contrast,
+under Unix there is no need for the :switch:`-largs` section.
Differences across platforms are due to details of linker implementation.
@@ -1066,7 +1068,7 @@ Differences across platforms are due to details of linker implementation.
It is possible to get a symbolic stack traceback
from anywhere in a program, just as for non-symbolic tracebacks.
The first step is to obtain a non-symbolic
-traceback, and then call `Symbolic_Traceback` to compute the symbolic
+traceback, and then call ``Symbolic_Traceback`` to compute the symbolic
information. Here is an example:
.. code-block:: ada
@@ -1104,12 +1106,106 @@ information. Here is an example:
.. rubric:: Automatic Symbolic Tracebacks
Symbolic tracebacks may also be enabled by using the -Es switch to gnatbind (as
-in `gprbuild -g ... -bargs -Es`).
+in ``gprbuild -g ... -bargs -Es``).
This will cause the Exception_Information to contain a symbolic traceback,
which will also be printed if an unhandled exception terminates the
program.
+.. _Pretty-Printers_For_The_GNAT_Runtime:
+
+Pretty-Printers for the GNAT runtime
+------------------------------------
+
+As discussed in :title:`Calling User-Defined Subprograms`, GDB's
+``print`` command only knows about the physical layout of program data
+structures and therefore normally displays only low-level dumps, which
+are often hard to understand.
+
+An example of this is when trying to display the contents of an Ada
+standard container, such as ``Ada.Containers.Ordered_Maps.Map``:
+
+ .. code-block:: ada
+
+ with Ada.Containers.Ordered_Maps;
+
+ procedure PP is
+ package Int_To_Nat is
+ new Ada.Containers.Ordered_Maps (Integer, Natural);
+
+ Map : Int_To_Nat.Map;
+ begin
+ Map.Insert (1, 10);
+ Map.Insert (2, 20);
+ Map.Insert (3, 30);
+
+ Map.Clear; -- BREAK HERE
+ end PP;
+
+When this program is built with debugging information and run under
+GDB up to the ``Map.Clear`` statement, trying to print ``Map`` will
+yield information that is only relevant to the developers of our standard
+containers:
+
+ ::
+
+ (gdb) print map
+ $1 = (
+ tree => (
+ first => 0x64e010,
+ last => 0x64e070,
+ root => 0x64e040,
+ length => 3,
+ tc => (
+ busy => 0,
+ lock => 0
+ )
+ )
+ )
+
+Fortunately, GDB has a feature called `pretty-printers
+<http://docs.adacore.com/gdb-docs/html/gdb.html#Pretty_002dPrinter-Introduction>`_,
+which allows customizing how GDB displays data structures. The GDB
+shipped with GNAT embeds such pretty-printers for the most common
+containers in the standard library. To enable them, either run the
+following command manually under GDB or add it to your ``.gdbinit`` file:
+
+ ::
+
+ python import gnatdbg; gnatdbg.setup()
+
+Once this is done, GDB's ``print`` command will automatically use
+these pretty-printers when appropriate. Using the previous example:
+
+ ::
+
+ (gdb) print map
+ $1 = pp.int_to_nat.map of length 3 = {
+ [1] = 10,
+ [2] = 20,
+ [3] = 30
+ }
+
+Pretty-printers are invoked each time GDB tries to display a value,
+including when displaying the arguments of a called subprogram (in
+GDB's ``backtrace`` command) or when printing the value returned by a
+function (in GDB's ``finish`` command).
+
+To display a value without involving pretty-printers, ``print`` can be
+invoked with its ``/r`` option:
+
+ ::
+
+ (gdb) print/r map
+ $1 = (
+ tree => (...
+
+Finer control of pretty-printers is also possible: see `GDB's online
+documentation
+<http://docs.adacore.com/gdb-docs/html/gdb.html#Pretty_002dPrinter-Commands>`_
+for more information.
+
+
.. index:: Code Coverage
.. index:: Profiling
@@ -1119,8 +1215,8 @@ program.
Code Coverage and Profiling
===========================
-This section describes how to use the `gcov` coverage testing tool and
-the `gprof` profiler tool on Ada programs.
+This section describes how to use the ``gcov`` coverage testing tool and
+the ``gprof`` profiler tool on Ada programs.
.. index:: ! gcov
@@ -1129,11 +1225,11 @@ the `gprof` profiler tool on Ada programs.
Code Coverage of Ada Programs with gcov
---------------------------------------
-`gcov` is a test coverage program: it analyzes the execution of a given
+``gcov`` is a test coverage program: it analyzes the execution of a given
program on selected tests, to help you determine the portions of the program
that are still untested.
-`gcov` is part of the GCC suite, and is described in detail in the GCC
+``gcov`` is part of the GCC suite, and is described in detail in the GCC
User's Guide. You can refer to this documentation for a more complete
description.
@@ -1145,12 +1241,12 @@ details some GNAT-specific features.
Quick startup guide
^^^^^^^^^^^^^^^^^^^
-In order to perform coverage analysis of a program using `gcov`, several
+In order to perform coverage analysis of a program using ``gcov``, several
steps are needed:
#. Instrument the code during the compilation process,
#. Execute the instrumented program, and
-#. Invoke the `gcov` tool to generate the coverage results.
+#. Invoke the ``gcov`` tool to generate the coverage results.
.. index:: -fprofile-arcs (gcc)
.. index:: -ftest-coverage (gcc
@@ -1161,8 +1257,8 @@ The source code is not modified in any way, because the instrumentation code is
inserted by gcc during the compilation process. To compile your code with code
coverage activated, you need to recompile your whole project using the
switches
-`-fprofile-arcs` and `-ftest-coverage`, and link it using
-`-fprofile-arcs`.
+:switch:`-fprofile-arcs` and :switch:`-ftest-coverage`, and link it using
+:switch:`-fprofile-arcs`.
::
@@ -1179,8 +1275,8 @@ same location as the :file:`.gcno` files. Subsequent executions
will update those files, so that a cumulative result of the covered
portions of the program is generated.
-Finally, you need to call the `gcov` tool. The different options of
-`gcov` are described in the GCC User's Guide, section 'Invoking gcov'.
+Finally, you need to call the ``gcov`` tool. The different options of
+``gcov`` are described in the GCC User's Guide, section *Invoking gcov*.
This will create annotated source files with a :file:`.gcov` extension:
:file:`my_main.adb` file will be analyzed in :file:`my_main.adb.gcov`.
@@ -1195,16 +1291,16 @@ Because of Ada semantics, portions of the source code may be shared among
several object files. This is the case for example when generics are
involved, when inlining is active or when declarations generate initialisation
calls. In order to take
-into account this shared code, you need to call `gcov` on all
+into account this shared code, you need to call ``gcov`` on all
source files of the tested program at once.
The list of source files might exceed the system's maximum command line
length. In order to bypass this limitation, a new mechanism has been
-implemented in `gcov`: you can now list all your project's files into a
+implemented in ``gcov``: you can now list all your project's files into a
text file, and provide this file to gcov as a parameter, preceded by a ``@``
(e.g. :samp:`gcov @mysrclist.txt`).
-Note that on AIX compiling a static library with `-fprofile-arcs` is
+Note that on AIX compiling a static library with :switch:`-fprofile-arcs` is
not supported as there can be unresolved symbols during the final link.
@@ -1216,14 +1312,14 @@ not supported as there can be unresolved symbols during the final link.
Profiling an Ada Program with gprof
-----------------------------------
-This section is not meant to be an exhaustive documentation of `gprof`.
+This section is not meant to be an exhaustive documentation of ``gprof``.
Full documentation for it can be found in the :title:`GNU Profiler User's Guide`
documentation that is part of this GNAT distribution.
Profiling a program helps determine the parts of a program that are executed
most often, and are therefore the most time-consuming.
-`gprof` is the standard GNU profiling tool; it has been enhanced to
+``gprof`` is the standard GNU profiling tool; it has been enhanced to
better handle Ada programs and multitasking.
It is currently supported on the following platforms
@@ -1231,7 +1327,7 @@ It is currently supported on the following platforms
* solaris sparc/sparc64/x86
* windows x86
-In order to profile a program using `gprof`, several steps are needed:
+In order to profile a program using ``gprof``, several steps are needed:
#. Instrument the code, which requires a full recompilation of the project with the
proper switches.
@@ -1239,7 +1335,7 @@ In order to profile a program using `gprof`, several steps are needed:
#. Execute the program under the analysis conditions, i.e. with the desired
input.
-#. Analyze the results using the `gprof` tool.
+#. Analyze the results using the ``gprof`` tool.
The following sections detail the different steps, and indicate how
to interpret the results.
@@ -1289,7 +1385,7 @@ already exists, it will be overwritten.
Running gprof
^^^^^^^^^^^^^
-The `gprof` tool is called as follow:
+The ``gprof`` tool is called as follow:
::
@@ -1307,7 +1403,7 @@ The complete form of the gprof command line is the following:
$ gprof [switches] [executable [data-file]]
-`gprof` supports numerous switches. The order of these
+``gprof`` supports numerous switches. The order of these
switch does not matter. The full list of options can be found in
the GNU Profiler User's Guide documentation that comes with this documentation.
@@ -1328,12 +1424,12 @@ The following is the subset of those switches that is most relevant:
.. index:: -e (gprof)
:samp:`-e {function_name}`
- The :samp:`-e {function}` option tells `gprof` not to print
- information about the function `function_name` (and its
+ The :samp:`-e {function}` option tells ``gprof`` not to print
+ information about the function ``function_name`` (and its
children...) in the call graph. The function will still be listed
as a child of any functions that call it, but its index number will be
shown as ``[not printed]``. More than one ``-e`` option may be
- given; only one `function_name` may be indicated with each ``-e``
+ given; only one ``function_name`` may be indicated with each ``-e``
option.
@@ -1343,17 +1439,17 @@ The following is the subset of those switches that is most relevant:
The :samp:`-E {function}` option works like the ``-e`` option, but
execution time spent in the function (and children who were not called from
anywhere else), will not be used to compute the percentages-of-time for
- the call graph. More than one ``-E`` option may be given; only one
- `function_name` may be indicated with each ``-E`` option.
+ the call graph. More than one :switch:`-E` option may be given; only one
+ ``function_name`` may be indicated with each :switch:`-E`` option.
.. index:: -f (gprof)
:samp:`-f {function_name}`
- The :samp:`-f {function}` option causes `gprof` to limit the
- call graph to the function `function_name` and its children (and
+ The :samp:`-f {function}` option causes ``gprof`` to limit the
+ call graph to the function ``function_name`` and its children (and
their children...). More than one ``-f`` option may be given;
- only one `function_name` may be indicated with each ``-f``
+ only one ``function_name`` may be indicated with each ``-f``
option.
@@ -1364,7 +1460,7 @@ The following is the subset of those switches that is most relevant:
only time spent in the function and its children (and their
children...) will be used to determine total-time and
percentages-of-time for the call graph. More than one ``-F`` option
- may be given; only one `function_name` may be indicated with each
+ may be given; only one ``function_name`` may be indicated with each
``-F`` option. The ``-F`` option overrides the ``-E`` option.
@@ -1401,7 +1497,7 @@ and some of the techniques for making your program run faster.
.. only:: PRO or GPL
It then documents the unused subprogram/data elimination feature
- and the *gnatelim* tool,
+ and the ``gnatelim`` tool,
which can reduce the size of program executables.
@@ -1455,7 +1551,7 @@ necessary checking is done at compile time.
.. index:: -gnatp (gcc)
.. index:: -gnato (gcc)
-The gnat switch, *-gnatp* allows this default to be modified. See
+The gnat switch, :switch:`-gnatp` allows this default to be modified. See
:ref:`Run-Time_Checks`.
Our experience is that the default is suitable for most development
@@ -1469,11 +1565,11 @@ you should read this chapter.
For validity checks, the minimal checks required by the Ada Reference
Manual (for case statements and assignments to array elements) are on
-by default. These can be suppressed by use of the *-gnatVn* switch.
+by default. These can be suppressed by use of the :switch:`-gnatVn` switch.
Note that in Ada 83, there were no validity checks, so if the Ada 83 mode
is acceptable (or when comparing GNAT performance with an Ada 83 compiler),
-it may be reasonable to routinely use *-gnatVn*. Validity checks
-are also suppressed entirely if *-gnatp* is used.
+it may be reasonable to routinely use :switch:`-gnatVn`. Validity checks
+are also suppressed entirely if :switch:`-gnatp` is used.
.. index:: Overflow checks
.. index:: Checks, overflow
@@ -1484,8 +1580,8 @@ are also suppressed entirely if *-gnatp* is used.
.. index:: pragma Unsuppress
Note that the setting of the switches controls the default setting of
-the checks. They may be modified using either `pragma Suppress` (to
-remove checks) or `pragma Unsuppress` (to add back suppressed
+the checks. They may be modified using either ``pragma Suppress`` (to
+remove checks) or ``pragma Unsuppress`` (to add back suppressed
checks) in the program source.
@@ -1505,8 +1601,8 @@ results in some distributed overhead, particularly if finalization or
exception handlers are used. The reason is that certain sections of code
have to be marked as non-abortable.
-If you use neither the `abort` statement, nor asynchronous transfer
-of control (`select ... then abort`), then this distributed overhead
+If you use neither the ``abort`` statement, nor asynchronous transfer
+of control (``select ... then abort``), then this distributed overhead
is removed, which may have a general positive effect in improving
overall performance. Especially code involving frequent use of tasking
constructs and controlled types will show much improved performance.
@@ -1549,41 +1645,40 @@ The default is optimization off. This results in the fastest compile
times, but GNAT makes absolutely no attempt to optimize, and the
generated programs are considerably larger and slower than when
optimization is enabled. You can use the
-*-O* switch (the permitted forms are *-O0*, *-O1*
-*-O2*, *-O3*, and *-Os*)
-to *gcc* to control the optimization level:
+:switch:`-O` switch (the permitted forms are :switch:`-O0`, :switch:`-O1`
+:switch:`-O2`, :switch:`-O3`, and :switch:`-Os`)
+to ``gcc`` to control the optimization level:
-* *-O0*
+* :switch:`-O0`
No optimization (the default);
generates unoptimized code but has
the fastest compilation time.
- Note that many other compilers do fairly extensive optimization
- even if 'no optimization' is specified. With gcc, it is
- very unusual to use -O0 for production if
- execution time is of any concern, since -O0
- really does mean no optimization at all. This difference between
- gcc and other compilers should be kept in mind when doing
- performance comparisons.
+ Note that many other compilers do substantial optimization even
+ if 'no optimization' is specified. With gcc, it is very unusual
+ to use :switch:`-O0` for production if execution time is of any concern,
+ since :switch:`-O0` means (almost) no optimization. This difference
+ between gcc and other compilers should be kept in mind when
+ doing performance comparisons.
-* *-O1*
+* :switch:`-O1`
Moderate optimization;
optimizes reasonably well but does not
degrade compilation time significantly.
-* *-O2*
+* :switch:`-O2`
Full optimization;
generates highly optimized code and has
the slowest compilation time.
-* *-O3*
- Full optimization as in *-O2*;
+* :switch:`-O3`
+ Full optimization as in :switch:`-O2`;
also uses more aggressive automatic inlining of subprograms within a unit
(:ref:`Inlining_of_Subprograms`) and attempts to vectorize loops.
-* *-Os*
+* :switch:`-Os`
Optimize space usage (code and data) of resulting program.
Higher optimization levels perform more global transformations on the
@@ -1599,10 +1694,10 @@ of the optimization settings in general terms.
See the *Options That Control Optimization* section in
:title:`Using the GNU Compiler Collection (GCC)`
for details about
-the *-O* settings and a number of *-f* options that
+the :switch:`-O` settings and a number of :switch:`-f` options that
individually enable or disable specific optimizations.
-Unlike some other compilation systems, *gcc* has
+Unlike some other compilation systems, ``gcc`` has
been tested extensively at all optimization levels. There are some bugs
which appear only with optimization turned on, but there have also been
bugs which show up only in *unoptimized* code. Selecting a lower
@@ -1610,10 +1705,10 @@ level of optimization does not improve the reliability of the code
generator, which in practice is highly reliable at all optimization
levels.
-Note regarding the use of *-O3*: The use of this optimization level
-is generally discouraged with GNAT, since it often results in larger
-executables which may run more slowly. See further discussion of this point
-in :ref:`Inlining_of_Subprograms`.
+Note regarding the use of :switch:`-O3`: The use of this optimization level
+ought not to be automatically preferred over that of level :switch:`-O2`,
+since it often results in larger executables which may run more slowly.
+See further discussion of this point in :ref:`Inlining_of_Subprograms`.
.. _Debugging_Optimized_Code:
@@ -1631,13 +1726,13 @@ source-level constructs will have been eliminated by optimization.
For example, if a loop is strength-reduced, the loop
control variable may be completely eliminated and thus cannot be
displayed in the debugger.
-This can only happen at *-O2* or *-O3*.
+This can only happen at :switch:`-O2` or :switch:`-O3`.
Explicit temporary variables that you code might be eliminated at
-level *-O1* or higher.
+level :switch:`-O1` or higher.
.. index:: -g (gcc)
-The use of the *-g* switch,
+The use of the :switch:`-g` switch,
which is needed for source-level debugging,
affects the size of the program executable on disk,
and indeed the debugging information can be quite large.
@@ -1650,7 +1745,7 @@ of the debugging data. You therefore need to anticipate certain
anomalous situations that may arise while debugging optimized code.
These are the most common cases:
-* *The 'hopping Program Counter':* Repeated `step` or `next`
+* *The 'hopping Program Counter':* Repeated ``step`` or ``next``
commands show
the PC bouncing back and forth in the code. This may result from any of
the following optimizations:
@@ -1676,8 +1771,8 @@ These are the most common cases:
jumps to a statement that is not supposed to be executed, simply because
it (and the code following) translates to the same thing as the code
that *was* supposed to be executed. This effect is typically seen in
- sequences that end in a jump, such as a `goto`, a `return`, or
- a `break` in a C `switch` statement.
+ sequences that end in a jump, such as a ``goto``, a ``return``, or
+ a ``break`` in a C ``switch`` statement.
* *The 'roving variable':* The symptom is an unexpected value in a variable.
There are various reasons for this effect:
@@ -1711,13 +1806,13 @@ These are the most common cases:
strange value to see if code motion had simply moved the variable's
assignments later.
-In light of such anomalies, a recommended technique is to use *-O0*
+In light of such anomalies, a recommended technique is to use :switch:`-O0`
early in the software development cycle, when extensive debugging capabilities
-are most needed, and then move to *-O1* and later *-O2* as
+are most needed, and then move to :switch:`-O1` and later :switch:`-O2` as
the debugger becomes less critical.
-Whether to use the *-g* switch in the release version is
+Whether to use the :switch:`-g` switch in the release version is
a release management issue.
-Note that if you use *-g* you can then use the *strip* program
+Note that if you use :switch:`-g` you can then use the ``strip`` program
on the resulting executable,
which removes both debugging information and global symbols.
@@ -1730,40 +1825,40 @@ Inlining of Subprograms
A call to a subprogram in the current unit is inlined if all the
following conditions are met:
-* The optimization level is at least *-O1*.
+* The optimization level is at least :switch:`-O1`.
* The called subprogram is suitable for inlining: It must be small enough
- and not contain something that *gcc* cannot support in inlined
+ and not contain something that ``gcc`` cannot support in inlined
subprograms.
.. index:: pragma Inline
.. index:: Inline
-* Any one of the following applies: `pragma Inline` is applied to the
+* Any one of the following applies: ``pragma Inline`` is applied to the
subprogram; the subprogram is local to the unit and called once from
- within it; the subprogram is small and optimization level *-O2* is
- specified; optimization level *-O3* is specified.
+ within it; the subprogram is small and optimization level :switch:`-O2` is
+ specified; optimization level :switch:`-O3` is specified.
Calls to subprograms in |withed| units are normally not inlined.
To achieve actual inlining (that is, replacement of the call by the code
in the body of the subprogram), the following conditions must all be true:
-* The optimization level is at least *-O1*.
+* The optimization level is at least :switch:`-O1`.
* The called subprogram is suitable for inlining: It must be small enough
- and not contain something that *gcc* cannot support in inlined
+ and not contain something that ``gcc`` cannot support in inlined
subprograms.
-* There is a `pragma Inline` for the subprogram.
+* There is a ``pragma Inline`` for the subprogram.
-* The *-gnatn* switch is used on the command line.
+* The :switch:`-gnatn` switch is used on the command line.
Even if all these conditions are met, it may not be possible for
the compiler to inline the call, due to the length of the body,
or features in the body that make it impossible for the compiler
to do the inlining.
-Note that specifying the *-gnatn* switch causes additional
+Note that specifying the :switch:`-gnatn` switch causes additional
compilation dependencies. Consider the following:
.. code-block:: ada
@@ -1783,63 +1878,63 @@ compilation dependencies. Consider the following:
R.Q;
end Main;
-With the default behavior (no *-gnatn* switch specified), the
-compilation of the `Main` procedure depends only on its own source,
+With the default behavior (no :switch:`-gnatn` switch specified), the
+compilation of the ``Main`` procedure depends only on its own source,
:file:`main.adb`, and the spec of the package in file :file:`r.ads`. This
-means that editing the body of `R` does not require recompiling
-`Main`.
+means that editing the body of ``R`` does not require recompiling
+``Main``.
-On the other hand, the call `R.Q` is not inlined under these
-circumstances. If the *-gnatn* switch is present when `Main`
-is compiled, the call will be inlined if the body of `Q` is small
-enough, but now `Main` depends on the body of `R` in
+On the other hand, the call ``R.Q`` is not inlined under these
+circumstances. If the :switch:`-gnatn` switch is present when ``Main``
+is compiled, the call will be inlined if the body of ``Q`` is small
+enough, but now ``Main`` depends on the body of ``R`` in
:file:`r.adb` as well as on the spec. This means that if this body is edited,
the main program must be recompiled. Note that this extra dependency
-occurs whether or not the call is in fact inlined by *gcc*.
+occurs whether or not the call is in fact inlined by ``gcc``.
-The use of front end inlining with *-gnatN* generates similar
+The use of front end inlining with :switch:`-gnatN` generates similar
additional dependencies.
.. index:: -fno-inline (gcc)
-Note: The *-fno-inline* switch overrides all other conditions and ensures that
-no inlining occurs, unless requested with pragma Inline_Always for *gcc*
-back-ends. The extra dependences resulting from *-gnatn* will still be active,
+Note: The :switch:`-fno-inline` switch overrides all other conditions and ensures that
+no inlining occurs, unless requested with pragma Inline_Always for ``gcc``
+back-ends. The extra dependences resulting from :switch:`-gnatn` will still be active,
even if this switch is used to suppress the resulting inlining actions.
.. index:: -fno-inline-functions (gcc)
-Note: The *-fno-inline-functions* switch can be used to prevent
-automatic inlining of subprograms if *-O3* is used.
+Note: The :switch:`-fno-inline-functions` switch can be used to prevent
+automatic inlining of subprograms if :switch:`-O3` is used.
.. index:: -fno-inline-small-functions (gcc)
-Note: The *-fno-inline-small-functions* switch can be used to prevent
-automatic inlining of small subprograms if *-O2* is used.
+Note: The :switch:`-fno-inline-small-functions` switch can be used to prevent
+automatic inlining of small subprograms if :switch:`-O2` is used.
.. index:: -fno-inline-functions-called-once (gcc)
-Note: The *-fno-inline-functions-called-once* switch
+Note: The :switch:`-fno-inline-functions-called-once` switch
can be used to prevent inlining of subprograms local to the unit
-and called once from within it if *-O1* is used.
-
-Note regarding the use of *-O3*: *-gnatn* is made up of two
-sub-switches *-gnatn1* and *-gnatn2* that can be directly
-specified in lieu of it, *-gnatn* being translated into one of them
-based on the optimization level. With *-O2* or below, *-gnatn*
-is equivalent to *-gnatn1* which activates pragma `Inline` with
-moderate inlining across modules. With *-O3*, *-gnatn* is
-equivalent to *-gnatn2* which activates pragma `Inline` with
-full inlining across modules. If you have used pragma `Inline` in
-appropriate cases, then it is usually much better to use *-O2*
-and *-gnatn* and avoid the use of *-O3* which has the additional
+and called once from within it if :switch:`-O1` is used.
+
+Note regarding the use of :switch:`-O3`: :switch:`-gnatn` is made up of two
+sub-switches :switch:`-gnatn1` and :switch:`-gnatn2` that can be directly
+specified in lieu of it, :switch:`-gnatn` being translated into one of them
+based on the optimization level. With :switch:`-O2` or below, :switch:`-gnatn`
+is equivalent to :switch:`-gnatn1` which activates pragma ``Inline`` with
+moderate inlining across modules. With :switch:`-O3`, :switch:`-gnatn` is
+equivalent to :switch:`-gnatn2` which activates pragma ``Inline`` with
+full inlining across modules. If you have used pragma ``Inline`` in
+appropriate cases, then it is usually much better to use :switch:`-O2`
+and :switch:`-gnatn` and avoid the use of :switch:`-O3` which has the additional
effect of inlining subprograms you did not think should be inlined. We have
-found that the use of *-O3* may slow down the compilation and increase
+found that the use of :switch:`-O3` may slow down the compilation and increase
the code size by performing excessive inlining, leading to increased
instruction cache pressure from the increased code size and thus minor
performance improvements. So the bottom line here is that you should not
-automatically assume that *-O3* is better than *-O2*, and
-indeed you should use *-O3* only if tests show that it actually
+automatically assume that :switch:`-O3` is better than :switch:`-O2`, and
+indeed you should use :switch:`-O3` only if tests show that it actually
improves performance for your program.
.. _Floating_Point_Operations:
@@ -1898,23 +1993,23 @@ Vectorization of loops
.. index:: Optimization Switches
-You can take advantage of the auto-vectorizer present in the *gcc*
+You can take advantage of the auto-vectorizer present in the ``gcc``
back end to vectorize loops with GNAT. The corresponding command line switch
-is *-ftree-vectorize* but, as it is enabled by default at *-O3*
+is :switch:`-ftree-vectorize` but, as it is enabled by default at :switch:`-O3`
and other aggressive optimizations helpful for vectorization also are enabled
-by default at this level, using *-O3* directly is recommended.
+by default at this level, using :switch:`-O3` directly is recommended.
You also need to make sure that the target architecture features a supported
SIMD instruction set. For example, for the x86 architecture, you should at
-least specify *-msse2* to get significant vectorization (but you don't
+least specify :switch:`-msse2` to get significant vectorization (but you don't
need to specify it for x86-64 as it is part of the base 64-bit architecture).
-Similarly, for the PowerPC architecture, you should specify *-maltivec*.
+Similarly, for the PowerPC architecture, you should specify :switch:`-maltivec`.
-The preferred loop form for vectorization is the `for` iteration scheme.
-Loops with a `while` iteration scheme can also be vectorized if they are
+The preferred loop form for vectorization is the ``for`` iteration scheme.
+Loops with a ``while`` iteration scheme can also be vectorized if they are
very simple, but the vectorizer will quickly give up otherwise. With either
iteration scheme, the flow of control must be straight, in particular no
-`exit` statement may appear in the loop body. The loop may however
+``exit`` statement may appear in the loop body. The loop may however
contain a single nested loop, if it can be vectorized when considered alone:
.. code-block:: ada
@@ -1934,7 +2029,7 @@ contain a single nested loop, if it can be vectorized when considered alone:
The vectorizable operations depend on the targeted SIMD instruction set, but
the adding and some of the multiplying operators are generally supported, as
well as the logical operators for modular types. Note that compiling
-with *-gnatp* might well reveal cases where some checks do thwart
+with :switch:`-gnatp` might well reveal cases where some checks do thwart
vectorization.
Type conversions may also prevent vectorization if they involve semantics that
@@ -1946,7 +2041,7 @@ The solution in this case is to use the following idiom:
Integer (S'Truncation (F))
-if `S` is the subtype of floating-point object `F`.
+if ``S`` is the subtype of floating-point object ``F``.
In most cases, the vectorizable loops are loops that iterate over arrays.
All kinds of array types are supported, i.e. constrained array types with
@@ -1980,7 +2075,7 @@ bounds of the array, the more fallback code it needs to generate in order to
fix things up at run time.
It is possible to specify that a given loop should be subject to vectorization
-preferably to other optimizations by means of pragma `Loop_Optimize`:
+preferably to other optimizations by means of pragma ``Loop_Optimize``:
.. code-block:: ada
@@ -2027,14 +2122,14 @@ Other Optimization Switches
.. index:: Optimization Switches
-Since `GNAT` uses the *gcc* back end, all the specialized
-*gcc* optimization switches are potentially usable. These switches
+Since GNAT uses the ``gcc`` back end, all the specialized
+``gcc`` optimization switches are potentially usable. These switches
have not been extensively tested with GNAT but can generally be expected
-to work. Examples of switches in this category are *-funroll-loops*
-and the various target-specific *-m* options (in particular, it has
-been observed that *-march=xxx* can significantly improve performance
+to work. Examples of switches in this category are :switch:`-funroll-loops`
+and the various target-specific :switch:`-m` options (in particular, it has
+been observed that :switch:`-march=xxx` can significantly improve performance
on appropriate machines). For full details of these switches, see
-the `Submodel Options` section in the `Hardware Models and Configurations`
+the *Submodel Options* section in the *Hardware Models and Configurations*
chapter of :title:`Using the GNU Compiler Collection (GCC)`.
@@ -2073,22 +2168,22 @@ the following example:
...
end R;
-In this example, since the variable `Int1V` can only access objects
-of type `Int1`, and `Int2V` can only access objects of type
-`Int2`, there is no possibility that the assignment to
-`Int2V.all` affects the value of `Int1V.all`. This means that
-the compiler optimizer can "know" that the value `Int1V.all` is constant
+In this example, since the variable ``Int1V`` can only access objects
+of type ``Int1``, and ``Int2V`` can only access objects of type
+``Int2``, there is no possibility that the assignment to
+``Int2V.all`` affects the value of ``Int1V.all``. This means that
+the compiler optimizer can "know" that the value ``Int1V.all`` is constant
for all iterations of the loop and avoid the extra memory reference
required to dereference it each time through the loop.
This kind of optimization, called strict aliasing analysis, is
-triggered by specifying an optimization level of *-O2* or
-higher or *-Os* and allows `GNAT` to generate more efficient code
+triggered by specifying an optimization level of :switch:`-O2` or
+higher or :switch:`-Os` and allows GNAT to generate more efficient code
when access values are involved.
However, although this optimization is always correct in terms of
the formal semantics of the Ada Reference Manual, difficulties can
-arise if features like `Unchecked_Conversion` are used to break
+arise if features like ``Unchecked_Conversion`` are used to break
the typing system. Consider the following complete program example:
.. code-block:: ada
@@ -2127,11 +2222,11 @@ the typing system. Consider the following complete program example:
put_line (int1'image (v1.all));
end;
-This program prints out 0 in *-O0* or *-O1*
-mode, but it prints out 1 in *-O2* mode. That's
+This program prints out 0 in :switch:`-O0` or :switch:`-O1`
+mode, but it prints out 1 in :switch:`-O2` mode. That's
because in strict aliasing mode, the compiler can and
-does assume that the assignment to `v2.all` could not
-affect the value of `v1.all`, since different types
+does assume that the assignment to ``v2.all`` could not
+affect the value of ``v1.all``, since different types
are involved.
This behavior is not a case of non-conformance with the standard, since
@@ -2139,7 +2234,7 @@ the Ada RM specifies that an unchecked conversion where the resulting
bit pattern is not a correct value of the target type can result in an
abnormal value and attempting to reference an abnormal value makes the
execution of a program erroneous. That's the case here since the result
-does not point to an object of type `int2`. This means that the
+does not point to an object of type ``int2``. This means that the
effect is entirely unpredictable.
However, although that explanation may satisfy a language
@@ -2158,32 +2253,32 @@ unchecked conversion generates a warning:
p2.adb:5:07: warning: or use "pragma No_Strict_Aliasing (a2);"
Unfortunately the problem is recognized when compiling the body of
-package `p2`, but the actual "bad" code is generated while
-compiling the body of `m` and this latter compilation does not see
-the suspicious `Unchecked_Conversion`.
+package ``p2``, but the actual "bad" code is generated while
+compiling the body of ``m`` and this latter compilation does not see
+the suspicious ``Unchecked_Conversion``.
As implied by the warning message, there are approaches you can use to
avoid the unwanted strict aliasing optimization in a case like this.
-One possibility is to simply avoid the use of *-O2*, but
+One possibility is to simply avoid the use of :switch:`-O2`, but
that is a bit drastic, since it throws away a number of useful
optimizations that do not involve strict aliasing assumptions.
A less drastic approach is to compile the program using the
-option *-fno-strict-aliasing*. Actually it is only the
+option :switch:`-fno-strict-aliasing`. Actually it is only the
unit containing the dereferencing of the suspicious pointer
that needs to be compiled. So in this case, if we compile
-unit `m` with this switch, then we get the expected
+unit ``m`` with this switch, then we get the expected
value of zero printed. Analyzing which units might need
the switch can be painful, so a more reasonable approach
-is to compile the entire program with options *-O2*
-and *-fno-strict-aliasing*. If the performance is
+is to compile the entire program with options :switch:`-O2`
+and :switch:`-fno-strict-aliasing`. If the performance is
satisfactory with this combination of options, then the
advantage is that the entire issue of possible "wrong"
optimization due to strict aliasing is avoided.
To avoid the use of compiler switches, the configuration
-pragma `No_Strict_Aliasing` with no parameters may be
+pragma ``No_Strict_Aliasing`` with no parameters may be
used to specify that for all access types, the strict
aliasing optimization should be suppressed.
@@ -2195,7 +2290,7 @@ access type identified as problematic.
First, if a careful analysis of uses of the pointer shows
that there are no possible problematic references, then
the warning can be suppressed by bracketing the
-instantiation of `Unchecked_Conversion` to turn
+instantiation of ``Unchecked_Conversion`` to turn
the warning off:
.. code-block:: ada
@@ -2212,8 +2307,8 @@ case we can take one of two other approaches.
The first possibility is to move the instantiation of unchecked
conversion to the unit in which the type is declared. In
this example, we would move the instantiation of
-`Unchecked_Conversion` from the body of package
-`p2` to the spec of package `p1`. Now the
+``Unchecked_Conversion`` from the body of package
+``p2`` to the spec of package ``p1``. Now the
warning disappears. That's because any use of the
access type knows there is a suspicious unchecked
conversion, and the strict aliasing optimization
@@ -2222,7 +2317,7 @@ is automatically suppressed for the type.
If it is not practical to move the unchecked conversion to the same unit
in which the destination access type is declared (perhaps because the
source type is not visible in that unit), you may use pragma
-`No_Strict_Aliasing` for the type. This pragma must occur in the
+``No_Strict_Aliasing`` for the type. This pragma must occur in the
same declarative sequence as the declaration of the access type:
.. code-block:: ada
@@ -2231,7 +2326,7 @@ same declarative sequence as the declaration of the access type:
pragma No_Strict_Aliasing (a2);
Here again, the compiler now knows that the strict aliasing optimization
-should be suppressed for any reference to type `a2` and the
+should be suppressed for any reference to type ``a2`` and the
expected behavior is obtained.
Finally, note that although the compiler can generate warnings for
@@ -2251,13 +2346,13 @@ have significant benefits. We have seen cases of large scale
application code where the time is increased by up to 5% by turning
this optimization off. If you have code that includes significant
usage of unchecked conversion, you might want to just stick with
-*-O1* and avoid the entire issue. If you get adequate
+:switch:`-O1` and avoid the entire issue. If you get adequate
performance at this level of optimization level, that's probably
the safest approach. If tests show that you really need higher
-levels of optimization, then you can experiment with *-O2*
-and *-O2 -fno-strict-aliasing* to see how much effect this
+levels of optimization, then you can experiment with :switch:`-O2`
+and :switch:`-O2 -fno-strict-aliasing` to see how much effect this
has on size and speed of the code. If you really need to use
-*-O2* with strict aliasing in effect, then you should
+:switch:`-O2` with strict aliasing in effect, then you should
review any uses of unchecked conversion of access types,
particularly if you are getting the warnings described above.
@@ -2302,9 +2397,9 @@ Consider the following example:
end;
where Get_String is a C function that uses the address in Temp to
-modify the variable `Name`. This code is dubious, and arguably
+modify the variable ``Name``. This code is dubious, and arguably
erroneous, and the compiler would be entitled to assume that
-`Name` is never modified, and generate code accordingly.
+``Name`` is never modified, and generate code accordingly.
However, in practice, this would cause some existing code that
seems to work with no optimization to start failing at high
@@ -2354,7 +2449,7 @@ this example:
...
X := RV.B;
-You cannot assume that the reference to `RV.B`
+You cannot assume that the reference to ``RV.B``
will read the entire 32-bit
variable with a single load instruction. It is perfectly legitimate if
the hardware allows it to do a byte read of just the B field. This read
@@ -2364,7 +2459,7 @@ Any assumption to the contrary is non-portable and risky. Even if you
examine the assembly language and see a full 32-bit load, this might
change in a future version of the compiler.
-If your application requires that all accesses to `RV` in this
+If your application requires that all accesses to ``RV`` in this
example be full 32-bit loads, you need to make a copy for the access
as in:
@@ -2442,26 +2537,26 @@ to be modified, only the task definition itself.
.. _Text_IO_Suggestions:
-`Text_IO` Suggestions
----------------------
+``Text_IO`` Suggestions
+-----------------------
.. index:: Text_IO and performance
-The `Ada.Text_IO` package has fairly high overheads due in part to
+The ``Ada.Text_IO`` package has fairly high overheads due in part to
the requirement of maintaining page and line counts. If performance
-is critical, a recommendation is to use `Stream_IO` instead of
-`Text_IO` for volume output, since this package has less overhead.
+is critical, a recommendation is to use ``Stream_IO`` instead of
+``Text_IO`` for volume output, since this package has less overhead.
-If `Text_IO` must be used, note that by default output to the standard
+If ``Text_IO`` must be used, note that by default output to the standard
output and standard error files is unbuffered (this provides better
behavior when output statements are used for debugging, or if the
progress of a program is observed by tracking the output, e.g. by
using the Unix *tail -f* command to watch redirected output.
-If you are generating large volumes of output with `Text_IO` and
+If you are generating large volumes of output with ``Text_IO`` and
performance is an important factor, use a designated file instead
of the standard output file, or change the standard output file to
-be buffered using `Interfaces.C_Streams.setvbuf`.
+be buffered using ``Interfaces.C_Streams.setvbuf``.
.. _Reducing_Size_of_Executables_with_Unused_Subprogram/Data_Elimination:
@@ -2503,7 +2598,7 @@ is directly performed by the linker.
In order to do this, it has to work with objects compiled with the
following options:
-*-ffunction-sections* *-fdata-sections*.
+:switch:`-ffunction-sections` :switch:`-fdata-sections`.
These options are usable with C and Ada files.
They will place respectively each
@@ -2511,16 +2606,16 @@ function or data in a separate section in the resulting object file.
Once the objects and static libraries are created with these options, the
linker can perform the dead code elimination. You can do this by setting
-the *-Wl,--gc-sections* option to gcc command or in the
-*-largs* section of *gnatmake*. This will perform a
+the :switch:`-Wl,--gc-sections` option to gcc command or in the
+:switch:`-largs` section of ``gnatmake``. This will perform a
garbage collection of code and data never referenced.
-If the linker performs a partial link (*-r* linker option), then you
-will need to provide the entry point using the *-e* / *--entry*
+If the linker performs a partial link (:switch:`-r` linker option), then you
+will need to provide the entry point using the :switch:`-e` / :switch:`--entry`
linker option.
-Note that objects compiled without the *-ffunction-sections* and
-*-fdata-sections* options can still be linked with the executable.
+Note that objects compiled without the :switch:`-ffunction-sections` and
+:switch:`-fdata-sections` options can still be linked with the executable.
However, no dead code elimination will be performed on those objects (they will
be linked as is).
@@ -2565,7 +2660,7 @@ Here is a simple example:
end Unused;
end Aux;
-`Unused` and `Unused_Data` are never referenced in this code
+``Unused`` and ``Unused_Data`` are never referenced in this code
excerpt, and hence they may be safely removed from the final executable.
::
@@ -2585,104 +2680,104 @@ excerpt, and hence they may be safely removed from the final executable.
02005350 T aux__used
0201ffe0 B aux__used_data
-It can be observed that the procedure `Unused` and the object
-`Unused_Data` are removed by the linker when using the
+It can be observed that the procedure ``Unused`` and the object
+``Unused_Data`` are removed by the linker when using the
appropriate options.
.. only:: PRO or GPL
.. _Reducing_Size_of_Ada_Executables_with_gnatelim:
- Reducing Size of Ada Executables with `gnatelim`
- ------------------------------------------------
+ Reducing Size of Ada Executables with ``gnatelim``
+ --------------------------------------------------
.. index:: gnatelim
- This section describes *gnatelim*, a tool which detects unused
+ This section describes ``gnatelim``, a tool which detects unused
subprograms and helps the compiler to create a smaller executable for your
program.
- *gnatelim* is a project-aware tool.
+ ``gnatelim`` is a project-aware tool.
(See :ref:`Using_Project_Files_with_GNAT_Tools` for a description of
- the project-related switches but note that *gnatelim* does not support
+ the project-related switches but note that ``gnatelim`` does not support
the :samp:`-U`, :samp:`-U {main_unit}`, :samp:`--subdirs={dir}`, or
:samp:`--no_objects_dir` switches.)
The project file package that can specify
- *gnatelim* switches is named ``Eliminate``.
+ ``gnatelim`` switches is named ``Eliminate``.
.. _About_gnatelim:
- About `gnatelim`
- ^^^^^^^^^^^^^^^^
+ About ``gnatelim``
+ ^^^^^^^^^^^^^^^^^^
When a program shares a set of Ada
packages with other programs, it may happen that this program uses
only a fraction of the subprograms defined in these packages. The code
created for these unused subprograms increases the size of the executable.
- `gnatelim` tracks unused subprograms in an Ada program and
- outputs a list of GNAT-specific pragmas `Eliminate` marking all the
+ ``gnatelim`` tracks unused subprograms in an Ada program and
+ outputs a list of GNAT-specific pragmas ``Eliminate`` marking all the
subprograms that are declared but never called. By placing the list of
- `Eliminate` pragmas in the GNAT configuration file :file:`gnat.adc` and
+ ``Eliminate`` pragmas in the GNAT configuration file :file:`gnat.adc` and
recompiling your program, you may decrease the size of its executable,
because the compiler will not generate the code for 'eliminated' subprograms.
- See `Pragma_Eliminate` in the :title:`GNAT_Reference_Manual` for more
+ See ``Pragma_Eliminate`` in the :title:`GNAT_Reference_Manual` for more
information about this pragma.
- `gnatelim` needs as its input data the name of the main subprogram.
+ ``gnatelim`` needs as its input data the name of the main subprogram.
- If a set of source files is specified as `gnatelim` arguments, it
+ If a set of source files is specified as ``gnatelim`` arguments, it
treats these files as a complete set of sources making up a program to
analyse, and analyses only these sources.
- After a full successful build of the main subprogram `gnatelim` can be
+ After a full successful build of the main subprogram ``gnatelim`` can be
called without specifying sources to analyse, in this case it computes
the source closure of the main unit from the :file:`ALI` files.
- If the set of sources to be processed by `gnatelim` contains sources with
+ If the set of sources to be processed by ``gnatelim`` contains sources with
preprocessing directives
then the needed options should be provided to run preprocessor as a part of
- the *gnatelim* call, and the generated set of pragmas `Eliminate`
+ the ``gnatelim`` call, and the generated set of pragmas ``Eliminate``
will correspond to preprocessed sources.
The following command will create the set of :file:`ALI` files needed for
- `gnatelim`:
+ ``gnatelim``:
::
$ gnatmake -c Main_Prog
- Note that `gnatelim` does not need object files.
+ Note that ``gnatelim`` does not need object files.
.. _Running_gnatelim:
- Running `gnatelim`
- ^^^^^^^^^^^^^^^^^^
+ Running ``gnatelim``
+ ^^^^^^^^^^^^^^^^^^^^
- `gnatelim` has the following command-line interface:
+ ``gnatelim`` has the following command-line interface:
::
- $ gnatelim [`switches`] -main=`main_unit_name` {`filename`} [-cargs `gcc_switches`]
+ $ gnatelim [switches] -main=`main_unit_name {filename} [-cargs gcc_switches]
- `main_unit_name` should be a name of a source file that contains the main
+ ``main_unit_name`` should be a name of a source file that contains the main
subprogram of a program (partition).
- Each `filename` is the name (including the extension) of a source
+ Each ``filename`` is the name (including the extension) of a source
file to process. 'Wildcards' are allowed, and
the file name may contain path information.
- `gcc_switches` is a list of switches for
- *gcc*. They will be passed on to all compiler invocations made by
- *gnatelim* to generate the ASIS trees. Here you can provide
- *-I* switches to form the source search path,
- use the *-gnatec* switch to set the configuration file,
- use the *-gnat05* switch if sources should be compiled in
+ ``gcc_switches`` is a list of switches for
+ ``gcc``. They will be passed on to all compiler invocations made by
+ ``gnatelim`` to generate the ASIS trees. Here you can provide
+ :switch:`-I` switches to form the source search path,
+ use the :switch:`-gnatec` switch to set the configuration file,
+ use the :switch:`-gnat05` switch if sources should be compiled in
Ada 2005 mode etc.
- `gnatelim` has the following switches:
+ ``gnatelim`` has the following switches:
.. index:: --version (gnatelim)
@@ -2707,8 +2802,8 @@ appropriate options.
.. index:: -X (gnatelim)
:samp:`-X{name}={value}`
- Indicates that external variable `name` in the argument project
- has the value `value`. Has no effect if no project is specified as
+ Indicates that external variable ``name`` in the argument project
+ has the value ``value``. Has no effect if no project is specified as
tool argument.
@@ -2716,7 +2811,7 @@ appropriate options.
:samp:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`).
.. index:: -files (gnatelim)
@@ -2725,7 +2820,7 @@ appropriate options.
Take the argument source files from the specified file. This file should be an
ordinary text file containing file names separated by spaces or
line breaks. You can use this switch more than once in the same call to
- *gnatelim*. You also can combine this switch with
+ ``gnatelim``. You also can combine this switch with
an explicit list of files.
@@ -2751,24 +2846,24 @@ appropriate options.
:samp:`-o={report_file}`
- Put *gnatelim* output into a specified file. If this file already exists,
- it is overridden. If this switch is not used, *gnatelim* outputs its results
+ Put ``gnatelim`` output into a specified file. If this file already exists,
+ it is overridden. If this switch is not used, ``gnatelim`` outputs its results
into :file:`stderr`
.. index:: -j (gnatelim)
:samp:`-j{n}`
- Use `n` processes to carry out the tree creations (internal representations
+ Use ``n`` processes to carry out the tree creations (internal representations
of the argument sources). On a multiprocessor machine this speeds up processing
- of big sets of argument sources. If `n` is 0, then the maximum number of
+ of big sets of argument sources. If ``n`` is 0, then the maximum number of
parallel tree creations is the number of core processors on the platform.
.. index:: -q (gnatelim)
:samp:`-q`
- Quiet mode: by default `gnatelim` outputs to the standard error
+ Quiet mode: by default ``gnatelim`` outputs to the standard error
stream the number of program units left to be processed. This option turns
this trace off.
@@ -2782,9 +2877,9 @@ appropriate options.
.. index:: -v (gnatelim)
:samp:`-v`
- Verbose mode: `gnatelim` version information is printed as Ada
+ Verbose mode: ``gnatelim`` version information is printed as Ada
comments to the standard output stream. Also, in addition to the number of
- program units left `gnatelim` will output the name of the current unit
+ program units left ``gnatelim`` will output the name of the current unit
being processed.
@@ -2803,10 +2898,10 @@ appropriate options.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If some program uses a precompiled Ada library, it can be processed by
- `gnatelim` in a usual way. `gnatelim` will newer generate an
+ ``gnatelim`` in a usual way. ``gnatelim`` will newer generate an
Eliminate pragma for a subprogram if the body of this subprogram has not
been analysed, this is a typical case for subprograms from precompiled
- libraries. Switch *-wq* may be used to suppress
+ libraries. Switch :switch:`-wq` may be used to suppress
warnings about missing source files and non-analyzed subprogram bodies
that can be generated when processing precompiled Ada libraries.
@@ -2816,7 +2911,7 @@ appropriate options.
Correcting the List of Eliminate Pragmas
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- In some rare cases `gnatelim` may try to eliminate
+ In some rare cases ``gnatelim`` may try to eliminate
subprograms that are actually called in the program. In this case, the
compiler will generate an error message of the form:
@@ -2824,7 +2919,7 @@ appropriate options.
main.adb:4:08: cannot reference subprogram "P" eliminated at elim.out:5
- You will need to manually remove the wrong `Eliminate` pragmas from
+ You will need to manually remove the wrong ``Eliminate`` pragmas from
the configuration file indicated in the error message. You should recompile
your program from scratch after that, because you need a consistent
configuration file(s) during the entire compilation.
@@ -2844,23 +2939,23 @@ appropriate options.
$ gnatmake -f main_prog
- (Use the *-f* option for *gnatmake* to
+ (Use the :switch:`-f` option for ``gnatmake`` to
recompile everything
- with the set of pragmas `Eliminate` that you have obtained with
- *gnatelim*).
+ with the set of pragmas ``Eliminate`` that you have obtained with
+ ``gnatelim``).
- Be aware that the set of `Eliminate` pragmas is specific to each
- program. It is not recommended to merge sets of `Eliminate`
+ Be aware that the set of ``Eliminate`` pragmas is specific to each
+ program. It is not recommended to merge sets of ``Eliminate``
pragmas created for different programs in one configuration file.
.. _Summary_of_the_gnatelim_Usage_Cycle:
- Summary of the `gnatelim` Usage Cycle
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Summary of the ``gnatelim`` Usage Cycle
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here is a quick summary of the steps to be taken in order to reduce
- the size of your executables with `gnatelim`. You may use
+ the size of your executables with ``gnatelim``. You may use
other GNAT options to control the optimization level,
to produce the debugging information, to set search path, etc.
@@ -2871,7 +2966,7 @@ appropriate options.
$ gnatmake -c main_prog
- * Generate a list of `Eliminate` pragmas in default configuration file
+ * Generate a list of ``Eliminate`` pragmas in default configuration file
:file:`gnat.adc` in the current directory
::
@@ -2910,9 +3005,9 @@ that intermediate results are not out of range. For example:
...
A := A + 1;
-If `A` has the value `Integer'Last`, then the addition may cause
-overflow since the result is out of range of the type `Integer`.
-In this case `Constraint_Error` will be raised if checks are
+If ``A`` has the value ``Integer'Last``, then the addition may cause
+overflow since the result is out of range of the type ``Integer``.
+In this case ``Constraint_Error`` will be raised if checks are
enabled.
A trickier situation arises in examples like the following:
@@ -2923,23 +3018,23 @@ A trickier situation arises in examples like the following:
...
A := (A + 1) + C;
-where `A` is `Integer'Last` and `C` is `-1`.
+where ``A`` is ``Integer'Last`` and ``C`` is ``-1``.
Now the final result of the expression on the right hand side is
-`Integer'Last` which is in range, but the question arises whether the
-intermediate addition of `(A + 1)` raises an overflow error.
+``Integer'Last`` which is in range, but the question arises whether the
+intermediate addition of ``(A + 1)`` raises an overflow error.
The (perhaps surprising) answer is that the Ada language
definition does not answer this question. Instead it leaves
it up to the implementation to do one of two things if overflow
checks are enabled.
-* raise an exception (`Constraint_Error`), or
+* raise an exception (``Constraint_Error``), or
* yield the correct mathematical result which is then used in
subsequent operations.
If the compiler chooses the first approach, then the assignment of this
-example will indeed raise `Constraint_Error` if overflow checking is
+example will indeed raise ``Constraint_Error`` if overflow checking is
enabled, or result in erroneous execution if overflow checks are suppressed.
But if the compiler
@@ -2972,15 +3067,15 @@ assertion forms, another issue arises. Consider:
One often wants to regard arithmetic in a context like this from
a mathematical point of view. So for example, if the two actual parameters
-for a call to `P` are both `Integer'Last`, then
+for a call to ``P`` are both ``Integer'Last``, then
the precondition should be regarded as False. If we are executing
in a mode with run-time checks enabled for preconditions, then we would
like this precondition to fail, rather than raising an exception
because of the intermediate overflow.
However, the language definition leaves the specification of
-whether the above condition fails (raising `Assert_Error`) or
-causes an intermediate overflow (raising `Constraint_Error`)
+whether the above condition fails (raising ``Assert_Error``) or
+causes an intermediate overflow (raising ``Constraint_Error``)
up to the implementation.
The situation is worse in a case such as the following:
@@ -3018,7 +3113,7 @@ and for expressions appearing outside assertions.
The three modes are:
-* *Use base type for intermediate operations* (`STRICT`)
+* *Use base type for intermediate operations* (``STRICT``)
In this mode, all intermediate results for predefined arithmetic
operators are computed using the base type, and the result must
@@ -3027,10 +3122,10 @@ The three modes are:
enabled) or the execution is erroneous (if overflow checks are suppressed).
This is the normal default mode.
-* *Most intermediate overflows avoided* (`MINIMIZED`)
+* *Most intermediate overflows avoided* (``MINIMIZED``)
In this mode, the compiler attempts to avoid intermediate overflows by
- using a larger integer type, typically `Long_Long_Integer`,
+ using a larger integer type, typically ``Long_Long_Integer``,
as the type in which arithmetic is
performed for predefined arithmetic operators. This may be slightly more
expensive at
@@ -3038,12 +3133,12 @@ The three modes are:
the cost is negligible on modern 64-bit machines. For the examples given
earlier, no intermediate overflows would have resulted in exceptions,
since the intermediate results are all in the range of
- `Long_Long_Integer` (typically 64-bits on nearly all implementations
+ ``Long_Long_Integer`` (typically 64-bits on nearly all implementations
of GNAT). In addition, if checks are enabled, this reduces the number of
checks that must be made, so this choice may actually result in an
improvement in space and time behavior.
- However, there are cases where `Long_Long_Integer` is not large
+ However, there are cases where ``Long_Long_Integer`` is not large
enough, consider the following example:
.. code-block:: ada
@@ -3051,9 +3146,9 @@ The three modes are:
procedure R (A, B, C, D : Integer) with
Pre => (A**2 * B**2) / (C**2 * D**2) <= 10;
- where `A` = `B` = `C` = `D` = `Integer'Last`.
+ where ``A`` = ``B`` = ``C`` = ``D`` = ``Integer'Last``.
Now the intermediate results are
- out of the range of `Long_Long_Integer` even though the final result
+ out of the range of ``Long_Long_Integer`` even though the final result
is in range and the precondition is True (from a mathematical point
of view). In such a case, operating in this mode, an overflow occurs
for the intermediate computation (which is why this mode
@@ -3061,11 +3156,11 @@ The three modes are:
an exception is raised if overflow checks are enabled, and the
execution is erroneous if overflow checks are suppressed.
-* *All intermediate overflows avoided* (`ELIMINATED`)
+* *All intermediate overflows avoided* (``ELIMINATED``)
In this mode, the compiler avoids all intermediate overflows
by using arbitrary precision arithmetic as required. In this
- mode, the above example with `A**2 * B**2` would
+ mode, the above example with ``A**2 * B**2`` would
not cause intermediate overflow, because the intermediate result
would be evaluated using sufficient precision, and the result
of evaluating the precondition would be True.
@@ -3084,8 +3179,8 @@ The three modes are:
Note that in this mode, the behavior is unaffected by whether or
not overflow checks are suppressed, since overflow does not occur.
It is possible for gigantic intermediate expressions to raise
- `Storage_Error` as a result of attempting to compute the
- results of such expressions (e.g. `Integer'Last ** Integer'Last`)
+ ``Storage_Error`` as a result of attempting to compute the
+ results of such expressions (e.g. ``Integer'Last ** Integer'Last``)
but overflow is impossible.
@@ -3097,9 +3192,9 @@ For fixed-point arithmetic, checks can be suppressed. But if checks
are enabled
then fixed-point values are always checked for overflow against the
base type for intermediate expressions (that is such checks always
-operate in the equivalent of `STRICT` mode).
+operate in the equivalent of ``STRICT`` mode).
-For floating-point, on nearly all architectures, `Machine_Overflows`
+For floating-point, on nearly all architectures, ``Machine_Overflows``
is False, and IEEE infinities are generated, so overflow exceptions
are never raised. If you want to avoid infinities, and check that
final results of expressions are in range, then you can declare a
@@ -3116,27 +3211,26 @@ Specifying the Desired Mode
.. index:: pragma Overflow_Mode
The desired mode of for handling intermediate overflow can be specified using
-either the `Overflow_Mode` pragma or an equivalent compiler switch.
+either the ``Overflow_Mode`` pragma or an equivalent compiler switch.
The pragma has the form
.. code-block:: ada
pragma Overflow_Mode ([General =>] MODE [, [Assertions =>] MODE]);
-where `MODE` is one of
+where ``MODE`` is one of
-* `STRICT`: intermediate overflows checked (using base type)
-* `MINIMIZED`: minimize intermediate overflows
-* `ELIMINATED`: eliminate intermediate overflows
+* ``STRICT``: intermediate overflows checked (using base type)
+* ``MINIMIZED``: minimize intermediate overflows
+* ``ELIMINATED``: eliminate intermediate overflows
-The case is ignored, so `MINIMIZED`, `Minimized` and
-`minimized` all have the same effect.
+The case is ignored, so ``MINIMIZED``, ``Minimized`` and
+``minimized`` all have the same effect.
-If only the `General` parameter is present, then the given `MODE`
-applies
+If only the ``General`` parameter is present, then the given ``MODE`` applies
to expressions both within and outside assertions. If both arguments
-are present, then `General` applies to expressions outside assertions,
-and `Assertions` applies to expressions within assertions. For example:
+are present, then ``General`` applies to expressions outside assertions,
+and ``Assertions`` applies to expressions within assertions. For example:
.. code-block:: ada
@@ -3153,44 +3247,44 @@ the extra overhead for assertion expressions to ensure that
the behavior at run time matches the expected mathematical
behavior.
-The `Overflow_Mode` pragma has the same scoping and placement
-rules as pragma `Suppress`, so it can occur either as a
+The ``Overflow_Mode`` pragma has the same scoping and placement
+rules as pragma ``Suppress``, so it can occur either as a
configuration pragma, specifying a default for the whole
program, or in a declarative scope, where it applies to the
remaining declarations and statements in that scope.
-Note that pragma `Overflow_Mode` does not affect whether
+Note that pragma ``Overflow_Mode`` does not affect whether
overflow checks are enabled or suppressed. It only controls the
method used to compute intermediate values. To control whether
-overflow checking is enabled or suppressed, use pragma `Suppress`
-or `Unsuppress` in the usual manner
+overflow checking is enabled or suppressed, use pragma ``Suppress``
+or ``Unsuppress`` in the usual manner.
.. index:: -gnato? (gcc)
.. index:: -gnato?? (gcc)
-Additionally, a compiler switch *-gnato?* or *-gnato??*
+Additionally, a compiler switch :switch:`-gnato?` or :switch:`-gnato??`
can be used to control the checking mode default (which can be subsequently
overridden using pragmas).
Here ``?`` is one of the digits ``1`` through ``3``:
- ====== =====================================================
- ``1`` use base type for intermediate operations (`STRICT`)
- ``2`` minimize intermediate overflows (`MINIMIZED`)
- ``3`` eliminate intermediate overflows (`ELIMINATED`)
- ====== =====================================================
+ ====== ======================================================
+ ``1`` use base type for intermediate operations (``STRICT``)
+ ``2`` minimize intermediate overflows (``MINIMIZED``)
+ ``3`` eliminate intermediate overflows (``ELIMINATED``)
+ ====== ======================================================
As with the pragma, if only one digit appears then it applies to all
cases; if two digits are given, then the first applies outside
assertions, and the second within assertions. Thus the equivalent
of the example pragma above would be
-*-gnato23*.
+:switch:`-gnato23`.
-If no digits follow the *-gnato*, then it is equivalent to
-*-gnato11*,
+If no digits follow the :switch:`-gnato`, then it is equivalent to
+:switch:`-gnato11`,
causing all intermediate operations to be computed using the base
-type (`STRICT` mode).
+type (``STRICT`` mode).
.. _Default_Settings:
@@ -3214,7 +3308,7 @@ used the base type for computation of intermediate results.
.. Sphinx allows no emphasis within :index: role. As a workaround we
point the index to "switch" and use emphasis for "-gnato".
-The :index:`switch <-gnato (gcc)>` *-gnato* (with no digits following)
+The :index:`switch <-gnato (gcc)>` :switch:`-gnato` (with no digits following)
is equivalent to
::
@@ -3224,11 +3318,11 @@ is equivalent to
which causes overflow checking of all intermediate overflows
both inside and outside assertions against the base type.
-The pragma `Suppress (Overflow_Check)` disables overflow
+The pragma ``Suppress (Overflow_Check)`` disables overflow
checking, but it has no effect on the method used for computing
intermediate results.
-The pragma `Unsuppress (Overflow_Check)` enables overflow
+The pragma ``Unsuppress (Overflow_Check)`` enables overflow
checking, but it has no effect on the method used for computing
intermediate results.
@@ -3238,12 +3332,12 @@ intermediate results.
Implementation Notes
--------------------
-In practice on typical 64-bit machines, the `MINIMIZED` mode is
+In practice on typical 64-bit machines, the ``MINIMIZED`` mode is
reasonably efficient, and can be generally used. It also helps
to ensure compatibility with code imported from some other
compiler to GNAT.
-Setting all intermediate overflows checking (`CHECKED` mode)
+Setting all intermediate overflows checking (``CHECKED`` mode)
makes sense if you want to
make sure that your code is compatible with any other possible
Ada implementation. This may be useful in ensuring portability
@@ -3251,34 +3345,34 @@ for code that is to be exported to some other compiler than GNAT.
The Ada standard allows the reassociation of expressions at
the same precedence level if no parentheses are present. For
-example, `A+B+C` parses as though it were `(A+B)+C`, but
-the compiler can reintepret this as `A+(B+C)`, possibly
+example, ``A+B+C`` parses as though it were ``(A+B)+C``, but
+the compiler can reintepret this as ``A+(B+C)``, possibly
introducing or eliminating an overflow exception. The GNAT
compiler never takes advantage of this freedom, and the
-expression `A+B+C` will be evaluated as `(A+B)+C`.
+expression ``A+B+C`` will be evaluated as ``(A+B)+C``.
If you need the other order, you can write the parentheses
-explicitly `A+(B+C)` and GNAT will respect this order.
+explicitly ``A+(B+C)`` and GNAT will respect this order.
-The use of `ELIMINATED` mode will cause the compiler to
+The use of ``ELIMINATED`` mode will cause the compiler to
automatically include an appropriate arbitrary precision
integer arithmetic package. The compiler will make calls
to this package, though only in cases where it cannot be
-sure that `Long_Long_Integer` is sufficient to guard against
+sure that ``Long_Long_Integer`` is sufficient to guard against
intermediate overflows. This package does not use dynamic
alllocation, but it does use the secondary stack, so an
appropriate secondary stack package must be present (this
is always true for standard full Ada, but may require
specific steps for restricted run times such as ZFP).
-Although `ELIMINATED` mode causes expressions to use arbitrary
+Although ``ELIMINATED`` mode causes expressions to use arbitrary
precision arithmetic, avoiding overflow, the final result
must be in an appropriate range. This is true even if the
-final result is of type `[Long_[Long_]]Integer'Base`, which
+final result is of type ``[Long_[Long_]]Integer'Base``, which
still has the same bounds as its associated constrained
type at run-time.
-Currently, the `ELIMINATED` mode is only available on target
-platforms for which `Long_Long_Integer` is 64-bits (nearly all GNAT
+Currently, the ``ELIMINATED`` mode is only available on target
+platforms for which ``Long_Long_Integer`` is 64-bits (nearly all GNAT
platforms).
@@ -3301,8 +3395,8 @@ familiar to engineering practice. The dimensions of algebraic expressions
This feature depends on Ada 2012 aspect specifications, and is available from
version 7.0.1 of GNAT onwards.
-The GNAT-specific aspect `Dimension_System`
-allows you to define a system of units; the aspect `Dimension`
+The GNAT-specific aspect ``Dimension_System``
+allows you to define a system of units; the aspect ``Dimension``
then allows the user to declare dimensioned quantities within a given system.
(These aspects are described in the *Implementation Defined Aspects*
chapter of the *GNAT Reference Manual*).
@@ -3315,9 +3409,9 @@ to use the proper subtypes in object declarations.
.. index:: MKS_Type type
The simplest way to impose dimensionality checking on a computation is to make
-use of the package `System.Dim.Mks`,
+use of the package ``System.Dim.Mks``,
which is part of the GNAT library. This
-package defines a floating-point type `MKS_Type`,
+package defines a floating-point type ``MKS_Type``,
for which a sequence of
dimension names are specified, together with their conventional abbreviations.
The following should be read together with the full specification of the
@@ -3347,9 +3441,9 @@ conventional units. For example:
with
Dimension => (Symbol => 'm', Meter => 1, others => 0);
-and similarly for `Mass`, `Time`, `Electric_Current`,
-`Thermodynamic_Temperature`, `Amount_Of_Substance`, and
-`Luminous_Intensity` (the standard set of units of the SI system).
+and similarly for ``Mass``, ``Time``, ``Electric_Current``,
+``Thermodynamic_Temperature``, ``Amount_Of_Substance``, and
+``Luminous_Intensity`` (the standard set of units of the SI system).
The package also defines conventional names for values of each unit, for
example:
@@ -3470,7 +3564,7 @@ Stack Overflow Checking
.. index:: -fstack-check (gcc)
-For most operating systems, *gcc* does not perform stack overflow
+For most operating systems, ``gcc`` does not perform stack overflow
checking by default. This means that if the main environment task or
some other task exceeds the available stack space, then unpredictable
behavior will occur. Most native systems offer some level of protection by
@@ -3482,8 +3576,8 @@ guard page is hit, there may not be any space left on the stack for executing
the exception propagation code. Enabling stack checking avoids
such situations.
-To activate stack checking, compile all units with the gcc option
-`-fstack-check`. For example:
+To activate stack checking, compile all units with the ``gcc`` option
+:switch:`-fstack-check`. For example:
::
@@ -3492,10 +3586,10 @@ To activate stack checking, compile all units with the gcc option
Units compiled with this option will generate extra instructions to check
that any use of the stack (for procedure calls or for declaring local
variables in declare blocks) does not exceed the available stack space.
-If the space is exceeded, then a `Storage_Error` exception is raised.
+If the space is exceeded, then a ``Storage_Error`` exception is raised.
For declared tasks, the stack size is controlled by the size
-given in an applicable `Storage_Size` pragma or by the value specified
+given in an applicable ``Storage_Size`` pragma or by the value specified
at bind time with ``-d`` (:ref:`Switches_for_gnatbind`) or is set to
the default size as defined in the GNAT runtime otherwise.
@@ -3541,21 +3635,21 @@ Each line of this file is made up of three fields:
* The name of the function.
* A number of bytes.
-* One or more qualifiers: `static`, `dynamic`, `bounded`.
+* One or more qualifiers: ``static``, ``dynamic``, ``bounded``.
The second field corresponds to the size of the known part of the function
frame.
-The qualifier `static` means that the function frame size
+The qualifier ``static`` means that the function frame size
is purely static.
It usually means that all local variables have a static size.
In this case, the second field is a reliable measure of the function stack
utilization.
-The qualifier `dynamic` means that the function frame size is not static.
+The qualifier ``dynamic`` means that the function frame size is not static.
It happens mainly when some local variables have a dynamic size. When this
qualifier appears alone, the second field is not a reliable measure
-of the function stack analysis. When it is qualified with `bounded`, it
+of the function stack analysis. When it is qualified with ``bounded``, it
means that the second field is a reliable maximum of the function stack
utilization.
@@ -3570,7 +3664,7 @@ Dynamic Stack Usage Analysis
----------------------------
It is possible to measure the maximum amount of stack used by a task, by
-adding a switch to *gnatbind*, as:
+adding a switch to ``gnatbind``, as:
::
@@ -3611,7 +3705,7 @@ where:
The environment task stack, e.g., the stack that contains the main unit, is
only processed when the environment variable GNAT_STACK_LIMIT is set.
-The package `GNAT.Task_Stack_Usage` provides facilities to get
+The package ``GNAT.Task_Stack_Usage`` provides facilities to get
stack usage reports at run-time. See its body for the details.
@@ -3627,7 +3721,7 @@ incorrect uses of access values (including 'dangling references').
.. only:: PRO or GPL
- It also describes the *gnatmem* tool, which can be used to track down
+ It also describes the ``gnatmem`` tool, which can be used to track down
"memory leaks".
.. _Some_Useful_Memory_Pools:
@@ -3638,9 +3732,9 @@ Some Useful Memory Pools
.. index:: Memory Pool
.. index:: storage, pool
-The `System.Pool_Global` package offers the Unbounded_No_Reclaim_Pool
-storage pool. Allocations use the standard system call `malloc` while
-deallocations use the standard system call `free`. No reclamation is
+The ``System.Pool_Global`` package offers the Unbounded_No_Reclaim_Pool
+storage pool. Allocations use the standard system call ``malloc`` while
+deallocations use the standard system call ``free``. No reclamation is
performed when the pool goes out of scope. For performance reasons, the
standard default Ada allocators/deallocators do not use any explicit storage
pools but if they did, they could use this storage pool without any change in
@@ -3657,8 +3751,8 @@ manages to make the default implicit allocator explicit as in this example:
-- the above is equivalent to
for T2'Storage_Pool use System.Pool_Global.Global_Pool_Object;
-The `System.Pool_Local` package offers the Unbounded_Reclaim_Pool storage
-pool. The allocation strategy is similar to `Pool_Local`'s
+The ``System.Pool_Local`` package offers the ``Unbounded_Reclaim_Pool`` storage
+pool. The allocation strategy is similar to ``Pool_Local``
except that the all
storage allocated with this pool is reclaimed when the pool object goes out of
scope. This pool provides a explicit mechanism similar to the implicit one
@@ -3687,8 +3781,8 @@ leak memory even though it does not perform explicit deallocation:
end loop;
end Pooloc1;
-The `System.Pool_Size` package implements the Stack_Bounded_Pool used when
-`Storage_Size` is specified for an access type.
+The ``System.Pool_Size`` package implements the ``Stack_Bounded_Pool`` used when
+``Storage_Size`` is specified for an access type.
The whole storage for the pool is
allocated at once, usually on the stack at the point where the access type is
elaborated. It is automatically reclaimed when exiting the scope where the
@@ -3714,7 +3808,7 @@ lead to incorrect memory references. The problems generated by such
references are usually difficult to tackle because the symptoms can be
very remote from the origin of the problem. In such cases, it is
very helpful to detect the problem as early as possible. This is the
-purpose of the Storage Pool provided by `GNAT.Debug_Pools`.
+purpose of the Storage Pool provided by ``GNAT.Debug_Pools``.
In order to use the GNAT specific debugging pool, the user must
associate a debug pool object with each of the access types that may be
@@ -3726,21 +3820,21 @@ related to suspected memory problems. See Ada Reference Manual 13.11.
Pool : GNAT.Debug_Pools.Debug_Pool;
for Ptr'Storage_Pool use Pool;
-`GNAT.Debug_Pools` is derived from a GNAT-specific kind of
-pool: the `Checked_Pool`. Such pools, like standard Ada storage pools,
+``GNAT.Debug_Pools`` is derived from a GNAT-specific kind of
+pool: the ``Checked_Pool``. Such pools, like standard Ada storage pools,
allow the user to redefine allocation and deallocation strategies. They
also provide a checkpoint for each dereference, through the use of
-the primitive operation `Dereference` which is implicitly called at
+the primitive operation ``Dereference`` which is implicitly called at
each dereference of an access value.
Once an access type has been associated with a debug pool, operations on
values of the type may raise four distinct exceptions,
which correspond to four potential kinds of memory corruption:
-* `GNAT.Debug_Pools.Accessing_Not_Allocated_Storage`
-* `GNAT.Debug_Pools.Accessing_Deallocated_Storage`
-* `GNAT.Debug_Pools.Freeing_Not_Allocated_Storage`
-* `GNAT.Debug_Pools.Freeing_Deallocated_Storage`
+* ``GNAT.Debug_Pools.Accessing_Not_Allocated_Storage``
+* ``GNAT.Debug_Pools.Accessing_Deallocated_Storage``
+* ``GNAT.Debug_Pools.Freeing_Not_Allocated_Storage``
+* ``GNAT.Debug_Pools.Freeing_Deallocated_Storage``
For types associated with a Debug_Pool, dynamic allocation is performed using
the standard GNAT allocation routine. References to all allocated chunks of
@@ -3748,14 +3842,14 @@ memory are kept in an internal dictionary. Several deallocation strategies are
provided, whereupon the user can choose to release the memory to the system,
keep it allocated for further invalid access checks, or fill it with an easily
recognizable pattern for debug sessions. The memory pattern is the old IBM
-hexadecimal convention: `16#DEADBEEF#`.
+hexadecimal convention: ``16#DEADBEEF#``.
See the documentation in the file g-debpoo.ads for more information on the
various strategies.
Upon each dereference, a check is made that the access value denotes a
properly allocated memory location. Here is a complete example of use of
-`Debug_Pools`, that includes typical instances of memory corruption:
+``Debug_Pools``, that includes typical instances of memory corruption:
.. code-block:: ada
@@ -3841,12 +3935,12 @@ execution of this erroneous program:
.. _The_gnatmem_Tool:
- The *gnatmem* Tool
- ------------------
+ The ``gnatmem`` Tool
+ --------------------
.. index:: ! gnatmem
- The `gnatmem` utility monitors dynamic allocation and
+ The ``gnatmem`` utility monitors dynamic allocation and
deallocation activity in a program, and displays information about
incorrect deallocations and possible sources of memory leaks.
It is designed to work in association with a static runtime library
@@ -3865,21 +3959,21 @@ execution of this erroneous program:
.. _Running_gnatmem:
- Running `gnatmem`
- ^^^^^^^^^^^^^^^^^
+ Running ``gnatmem``
+ ^^^^^^^^^^^^^^^^^^^
- `gnatmem` makes use of the output created by the special version of
+ ``gnatmem`` makes use of the output created by the special version of
allocation and deallocation routines that record call information. This allows
it to obtain accurate dynamic memory usage history at a minimal cost to the
- execution speed. Note however, that `gnatmem` is not supported on all
+ execution speed. Note however, that ``gnatmem`` is not supported on all
platforms (currently, it is supported on AIX, HP-UX, GNU/Linux, Solaris and
Windows).
- The `gnatmem` command has the form
+ The ``gnatmem`` command has the form
::
- $ gnatmem [`switches`] `user_program`
+ $ gnatmem [ switches ] user_program
The program must have been linked with the instrumented version of the
allocation and deallocation routines. This is done by linking with the
@@ -3892,25 +3986,25 @@ execution of this erroneous program:
$ gnatmake -g my_program -largs -lgmem
As library :file:`libgmem.a` contains an alternate body for package
- `System.Memory`, :file:`s-memory.adb` should not be compiled and linked
+ ``System.Memory``, :file:`s-memory.adb` should not be compiled and linked
when an executable is linked with library :file:`libgmem.a`. It is then not
- recommended to use *gnatmake* with switch *-a*.
+ recommended to use ``gnatmake`` with switch :switch:`-a`.
When :file:`my_program` is executed, the file :file:`gmem.out` is produced.
This file contains information about all allocations and deallocations
performed by the program. It is produced by the instrumented allocations and
- deallocations routines and will be used by `gnatmem`.
+ deallocations routines and will be used by ``gnatmem``.
In order to produce symbolic backtrace information for allocations and
deallocations performed by the GNAT run-time library, you need to use a
- version of that library that has been compiled with the *-g* switch
+ version of that library that has been compiled with the :switch:`-g` switch
(see :ref:`Rebuilding_the_GNAT_Run-Time_Library`).
- *gnatmem* must be supplied with the :file:`gmem.out` file and the executable to
+ ``gnatmem`` must be supplied with the :file:`gmem.out` file and the executable to
examine. If the location of :file:`gmem.out` file was not explicitly supplied by
- *-i* switch, gnatmem will assume that this file can be found in the
+ :switch:`-i` switch, gnatmem will assume that this file can be found in the
current directory. For example, after you have executed :file:`my_program`,
- :file:`gmem.out` can be analyzed by `gnatmem` using the command:
+ :file:`gmem.out` can be analyzed by ``gnatmem`` using the command:
::
@@ -3944,12 +4038,12 @@ execution of this erroneous program:
.
The first block of output gives general information. In this case, the
- Ada construct **new** was executed 45 times, and only 6 calls to an
+ Ada construct ``new`` was executed 45 times, and only 6 calls to an
Unchecked_Deallocation routine occurred.
Subsequent paragraphs display information on all allocation roots.
An allocation root is a specific point in the execution of the program
- that generates some dynamic allocation, such as a **new**
+ that generates some dynamic allocation, such as a ``new``
construct. This root is represented by an execution backtrace (or subprogram
call stack). By default the backtrace depth for allocations roots is 1, so
that a root corresponds exactly to a source location. The backtrace can
@@ -3957,10 +4051,10 @@ execution of this erroneous program:
.. _Switches_for_gnatmem:
- Switches for `gnatmem`
- ^^^^^^^^^^^^^^^^^^^^^^
+ Switches for ``gnatmem``
+ ^^^^^^^^^^^^^^^^^^^^^^^^
- `gnatmem` recognizes the following switches:
+ ``gnatmem`` recognizes the following switches:
.. index:: -q (gnatmem)
@@ -3972,7 +4066,7 @@ execution of this erroneous program:
.. index:: N switch (gnatmem)
:samp:`{N}`
- `N` is an integer literal (usually between 1 and 10) which controls the
+ ``N`` is an integer literal (usually between 1 and 10) which controls the
depth of the backtraces defining allocation root. The default value for
N is 1. The deeper the backtrace, the more precise the localization of
the root. Note that the total number of roots can depend on this
@@ -3983,20 +4077,20 @@ execution of this erroneous program:
.. index:: -b (gnatmem)
:samp:`-b {N}`
- This switch has the same effect as just a depth parameter `N`.
+ This switch has the same effect as just a depth parameter ``N``.
.. index:: -i (gnatmem)
:samp:`-i {file}`
- Do the `gnatmem` processing starting from :file:`file`, rather than
+ Do the ``gnatmem`` processing starting from :file:`file`, rather than
:file:`gmem.out` in the current directory.
.. index:: -m (gnatmem)
:samp:`-m {n}`
- This switch causes `gnatmem` to mask the allocation roots that have less
+ This switch causes ``gnatmem`` to mask the allocation roots that have less
than n leaks. The default value is 1. Specifying the value of 0 will allow
examination of even the roots that did not result in leaks.
@@ -4004,28 +4098,28 @@ execution of this erroneous program:
.. index:: -s (gnatmem)
:samp:`-s {order}`
- This switch causes `gnatmem` to sort the allocation roots according to the
+ This switch causes ``gnatmem`` to sort the allocation roots according to the
specified order of sort criteria, each identified by a single letter. The
- currently supported criteria are `n`, `h`, and `w` standing respectively for
+ currently supported criteria are ``n``, ``h``, and ``w`` standing respectively for
number of unfreed allocations, high watermark, and final watermark
- corresponding to a specific root. The default order is `nwh`.
+ corresponding to a specific root. The default order is ``nwh``.
.. index:: -t (gnatmem)
:samp:`-t`
This switch causes memory allocated size to be always output in bytes.
- Default `gnatmem` behavior is to show memory sizes less then 1 kilobyte
+ Default ``gnatmem`` behavior is to show memory sizes less then 1 kilobyte
in bytes, from 1 kilobyte till 1 megabyte in kilobytes and the rest in
megabytes.
.. _Example_of_gnatmem_Usage:
- Example of `gnatmem` Usage
- ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Example of ``gnatmem`` Usage
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- The following example shows the use of `gnatmem`
+ The following example shows the use of ``gnatmem``
on a simple memory-leaking program.
Suppose that we have the following Ada program:
@@ -4061,7 +4155,7 @@ execution of this erroneous program:
end;
The program needs to be compiled with the debugging option and linked with
- the `gmem` library:
+ the ``gmem`` library:
::
@@ -4073,7 +4167,7 @@ execution of this erroneous program:
$ test_gm
- Then `gnatmem` is invoked simply with
+ Then ``gnatmem`` is invoked simply with
::
diff --git a/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst b/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst
index 406455d..3d9d0b9 100644
--- a/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst
+++ b/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst
@@ -1,3 +1,7 @@
+.. role:: switch(samp)
+
+.. |rightarrow| unicode:: 0x2192
+
.. _GNAT_Utility_Programs:
*********************
@@ -39,81 +43,81 @@ Other GNAT utilities are described elsewhere in this manual:
.. _The_File_Cleanup_Utility_gnatclean:
-The File Cleanup Utility *gnatclean*
-====================================
+The File Cleanup Utility ``gnatclean``
+======================================
.. index:: File cleanup tool
.. index:: gnatclean
-`gnatclean` is a tool that allows the deletion of files produced by the
+``gnatclean`` is a tool that allows the deletion of files produced by the
compiler, binder and linker, including ALI files, object files, tree files,
expanded source files, library files, interface copy source files, binder
generated files and executable files.
.. _Running_gnatclean:
-Running `gnatclean`
--------------------
+Running ``gnatclean``
+---------------------
-The `gnatclean` command has the form:
+The ``gnatclean`` command has the form:
::
- $ gnatclean switches `names`
+ $ gnatclean switches names
-where `names` is a list of source file names. Suffixes :file:`.ads` and
+where ``names`` is a list of source file names. Suffixes :file:`.ads` and
:file:`adb` may be omitted. If a project file is specified using switch
-:samp:`-P`, then `names` may be completely omitted.
+:switch:`-P`, then ``names`` may be completely omitted.
-In normal mode, `gnatclean` delete the files produced by the compiler and,
-if switch `-c` is not specified, by the binder and
+In normal mode, ``gnatclean`` delete the files produced by the compiler and,
+if switch :switch:`-c` is not specified, by the binder and
the linker. In informative-only mode, specified by switch
-`-n`, the list of files that would have been deleted in
+:switch:`-n`, the list of files that would have been deleted in
normal mode is listed, but no file is actually deleted.
.. _Switches_for_gnatclean:
-Switches for `gnatclean`
-------------------------
+Switches for ``gnatclean``
+--------------------------
-`gnatclean` recognizes the following switches:
+``gnatclean`` recognizes the following switches:
.. index:: --version (gnatclean)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatclean)
-:samp:`--help`
- If *--version* was not used, display usage, then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage, then exit disregarding
all other options.
-:samp:`--subdirs={subdir}`
+:switch:`--subdirs={subdir}`
Actual object directory of each project file is the subdirectory subdir of the
object directory specified or defaulted in the project file.
-:samp:`--unchecked-shared-lib-imports`
+:switch:`--unchecked-shared-lib-imports`
By default, shared library projects are not allowed to import static library
projects. When this switch is used on the command line, this restriction is
relaxed.
.. index:: -c (gnatclean)
-:samp:`-c`
+:switch:`-c`
Only attempt to delete the files produced by the compiler, not those produced
by the binder or the linker. The files that are not to be deleted are library
files, interface copy files, binder generated files and executable files.
.. index:: -D (gnatclean)
-:samp:`-D {dir}`
- Indicate that ALI and object files should normally be found in directory `dir`.
+:switch:`-D {dir}`
+ Indicate that ALI and object files should normally be found in directory ``dir``.
.. index:: -F (gnatclean)
-:samp:`-F`
+:switch:`-F`
When using project files, if some errors or warnings are detected during
parsing and verbose mode is not in effect (no use of switch
-v), then error lines start with the full path name of the project
@@ -121,19 +125,19 @@ Switches for `gnatclean`
.. index:: -h (gnatclean)
-:samp:`-h`
- Output a message explaining the usage of `gnatclean`.
+:switch:`-h`
+ Output a message explaining the usage of ``gnatclean``.
.. index:: -n (gnatclean)
-:samp:`-n`
+:switch:`-n`
Informative-only mode. Do not delete any files. Output the list of the files
that would have been deleted if this switch was not specified.
.. index:: -P (gnatclean)
-:samp:`-P{project}`
- Use project file `project`. Only one such switch can be used.
+:switch:`-P{project}`
+ Use project file ``project``. Only one such switch can be used.
When cleaning a project file, the files produced by the compilation of the
immediate sources or inherited sources of the project files are to be
deleted. This is not depending on the presence or not of executable names
@@ -141,14 +145,14 @@ Switches for `gnatclean`
.. index:: -q (gnatclean)
-:samp:`-q`
+:switch:`-q`
Quiet output. If there are no errors, do not output anything, except in
verbose mode (switch -v) or in informative-only mode
(switch -n).
.. index:: -r (gnatclean)
-:samp:`-r`
+:switch:`-r`
When a project file is specified (using switch -P),
clean all imported and extended project files, recursively. If this switch
is not specified, only the files related to the main project file are to be
@@ -156,52 +160,52 @@ Switches for `gnatclean`
.. index:: -v (gnatclean)
-:samp:`-v`
+:switch:`-v`
Verbose mode.
.. index:: -vP (gnatclean)
-:samp:`-vP{x}`
+:switch:`-vP{x}`
Indicates the verbosity of the parsing of GNAT project files.
:ref:`Switches_Related_to_Project_Files`.
.. index:: -X (gnatclean)
-:samp:`-X{name}={value}`
- Indicates that external variable `name` has the value `value`.
+:switch:`-X{name}={value}`
+ Indicates that external variable ``name`` has the value ``value``.
The Project Manager will use this value for occurrences of
- `external(name)` when parsing the project file.
- :ref:`Switches_Related_to_Project_Files`.
+ ``external(name)`` when parsing the project file.
+ See :ref:`Switches_Related_to_Project_Files`.
.. index:: -aO (gnatclean)
-:samp:`-aO{dir}`
- When searching for ALI and object files, look in directory `dir`.
+:switch:`-aO{dir}`
+ When searching for ALI and object files, look in directory ``dir``.
.. index:: -I (gnatclean)
-:samp:`-I{dir}`
- Equivalent to :samp:`-aO{dir}`.
+:switch:`-I{dir}`
+ Equivalent to :switch:`-aO{dir}`.
.. index:: -I- (gnatclean)
.. index:: Source files, suppressing search
-:samp:`-I-`
+:switch:`-I-`
Do not look for ALI or object files in the directory
- where `gnatclean` was invoked.
+ where ``gnatclean`` was invoked.
.. _The_GNAT_Library_Browser_gnatls:
-The GNAT Library Browser `gnatls`
-=================================
+The GNAT Library Browser ``gnatls``
+===================================
.. index:: Library browser
.. index:: ! gnatls
-`gnatls` is a tool that outputs information about compiled
+``gnatls`` is a tool that outputs information about compiled
units. It gives the relationship between objects, unit names and source
files. It can also be used to check the source dependencies of a unit
as well as various characteristics.
@@ -211,20 +215,20 @@ driver (see :ref:`The_GNAT_Driver_and_Project_Files`).
.. _Running_gnatls:
-Running `gnatls`
-----------------
+Running ``gnatls``
+------------------
-The `gnatls` command has the form
+The ``gnatls`` command has the form
::
- $ gnatls switches `object_or_ali_file`
+ $ gnatls switches object_or_ali_file
The main argument is the list of object or :file:`ali` files
(see :ref:`The_Ada_Library_Information_Files`)
for which information is requested.
-In normal mode, without additional option, `gnatls` produces a
+In normal mode, without additional option, ``gnatls`` produces a
four-column listing. Each line represents information for a specific
object. The first column gives the full path of the object, the second
column gives the name of the principal unit in this object, the third
@@ -259,8 +263,8 @@ qualifier which can be:
*MOK (slightly modified)*
The version of the source file used for the compilation of the
specified unit differs from the actual source file but not enough to
- require recompilation. If you use gnatmake with the qualifier
- *-m (minimal recompilation)*, a file marked
+ require recompilation. If you use gnatmake with the option
+ :switch:`-m` (minimal recompilation), a file marked
MOK will not be recompiled.
*DIF (modified)*
@@ -278,67 +282,67 @@ qualifier which can be:
.. _Switches_for_gnatls:
-Switches for `gnatls`
----------------------
+Switches for ``gnatls``
+-----------------------
-`gnatls` recognizes the following switches:
+``gnatls`` recognizes the following switches:
.. index:: --version (gnatls)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatls)
-:samp:`*--help`
- If *--version* was not used, display usage, then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage, then exit disregarding
all other options.
.. index:: -a (gnatls)
-:samp:`-a`
+:switch:`-a`
Consider all units, including those of the predefined Ada library.
- Especially useful with *-d*.
+ Especially useful with :switch:`-d`.
.. index:: -d (gnatls)
-:samp:`-d`
+:switch:`-d`
List sources from which specified units depend on.
.. index:: -h (gnatls)
-:samp:`-h`
+:switch:`-h`
Output the list of options.
.. index:: -o (gnatls)
-:samp:`-o`
+:switch:`-o`
Only output information about object files.
.. index:: -s (gnatls)
-:samp:`-s`
+:switch:`-s`
Only output information about source files.
.. index:: -u (gnatls)
-:samp:`-u`
+:switch:`-u`
Only output information about compilation units.
.. index:: -files (gnatls)
-:samp:`-files={file}`
- Take as arguments the files listed in text file `file`.
- Text file `file` may contain empty lines that are ignored.
+:switch:`-files={file}`
+ Take as arguments the files listed in text file ``file``.
+ Text file ``file`` may contain empty lines that are ignored.
Each nonempty line should contain the name of an existing file.
Several such switches may be specified simultaneously.
@@ -351,27 +355,27 @@ Switches for `gnatls`
.. index:: -I- (gnatls)
-:samp:`-aO{dir}`, :samp:`-aI{dir}`, :samp:`-I{dir}`, :samp:`-I-`, :samp:`-nostdinc`
- Source path manipulation. Same meaning as the equivalent *gnatmake*
+:switch:`-aO{dir}`, :switch:`-aI{dir}`, :switch:`-I{dir}`, :switch:`-I-`, :switch:`-nostdinc`
+ Source path manipulation. Same meaning as the equivalent ``gnatmake``
flags (:ref:`Switches_for_gnatmake`).
.. index:: -aP (gnatls)
-:samp:`-aP{dir}`
- Add `dir` at the beginning of the project search dir.
+:switch:`-aP{dir}`
+ Add ``dir`` at the beginning of the project search dir.
.. index:: --RTS (gnatls)
-:samp:`--RTS={rts-path}``
+:switch:`--RTS={rts-path}``
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`).
.. index:: -v (gnatls)
-:samp:`-v`
+:switch:`-v`
Verbose mode. Output the complete source, object and project paths. Do not use
the default column layout but instead use long format giving as much as
information possible on each requested units, including special
@@ -397,8 +401,8 @@ Switches for `gnatls`
.. _Example_of_gnatls_Usage:
-Example of `gnatls` Usage
--------------------------
+Example of ``gnatls`` Usage
+---------------------------
Example of using the verbose switch. Note how the source and
object paths are affected by the -I switch.
@@ -472,14 +476,14 @@ building specialized scripts.
.. _The_Cross-Referencing_Tools_gnatxref_and_gnatfind:
-The Cross-Referencing Tools `gnatxref` and `gnatfind`
-=====================================================
+The Cross-Referencing Tools ``gnatxref`` and ``gnatfind``
+=========================================================
.. index:: ! gnatxref
.. index:: ! gnatfind
The compiler generates cross-referencing information (unless
-you set the :samp:`-gnatx` switch), which are saved in the :file:`.ali` files.
+you set the :switch:`-gnatx` switch), which are saved in the :file:`.ali` files.
This information indicates where in the source each entity is declared and
referenced. Note that entities in package Standard are not included, but
entities in all other predefined units are included in the output.
@@ -488,16 +492,16 @@ Before using any of these two tools, you need to compile successfully your
application, so that GNAT gets a chance to generate the cross-referencing
information.
-The two tools `gnatxref` and `gnatfind` take advantage of this
+The two tools ``gnatxref`` and ``gnatfind`` take advantage of this
information to provide the user with the capability to easily locate the
declaration and references to an entity. These tools are quite similar,
-the difference being that `gnatfind` is intended for locating
+the difference being that ``gnatfind`` is intended for locating
definitions and/or references to a specified entity or entities, whereas
-`gnatxref` is oriented to generating a full report of all
+``gnatxref`` is oriented to generating a full report of all
cross-references.
To use these tools, you must not compile your application using the
-*-gnatx* switch on the *gnatmake* command line
+:switch:`-gnatx` switch on the ``gnatmake`` command line
(see :ref:`The_GNAT_Make_Program_gnatmake`). Otherwise, cross-referencing
information will not be generated.
@@ -506,110 +510,110 @@ use the `gnat` driver (see :ref:`The_GNAT_Driver_and_Project_Files`).
.. _gnatxref_Switches:
-`gnatxref` Switches
--------------------
+``gnatxref`` Switches
+---------------------
-The command invocation for `gnatxref` is:
+The command invocation for ``gnatxref`` is:
::
- $ gnatxref [`switches`] `sourcefile1` [`sourcefile2` ...]
+ $ gnatxref [ switches ] sourcefile1 [ sourcefile2 ... ]
where
-*sourcefile1* [, *sourcefile2* ...]
+``sourcefile1`` [, ``sourcefile2`` ...]
identify the source files for which a report is to be generated. The
- 'with'ed units will be processed too. You must provide at least one file.
+ ``with``\ ed units will be processed too. You must provide at least one file.
These file names are considered to be regular expressions, so for instance
specifying :file:`source\*.adb` is the same as giving every file in the current
directory whose name starts with :file:`source` and whose extension is
:file:`adb`.
- You shouldn't specify any directory name, just base names. *gnatxref*
- and *gnatfind* will be able to locate these files by themselves using
+ You shouldn't specify any directory name, just base names. ``gnatxref``
+ and ``gnatfind`` will be able to locate these files by themselves using
the source path. If you specify directories, no result is produced.
-The following switches are available for *gnatxref*:
+The following switches are available for ``gnatxref``:
.. index:: --version (gnatxref)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatxref)
-:samp:`--help`
- If *--version* was not used, display usage, then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage, then exit disregarding
all other options.
.. index:: -a (gnatxref)
-:samp:`-a`
- If this switch is present, `gnatfind` and `gnatxref` will parse
+:switch:`-a`
+ If this switch is present, ``gnatfind`` and ``gnatxref`` will parse
the read-only files found in the library search path. Otherwise, these files
will be ignored. This option can be used to protect Gnat sources or your own
- libraries from being parsed, thus making `gnatfind` and `gnatxref`
+ libraries from being parsed, thus making ``gnatfind`` and ``gnatxref``
much faster, and their output much smaller. Read-only here refers to access
or permissions status in the file system for the current user.
.. index:: -aIDIR (gnatxref)
-:samp:`-aI{DIR}`
+:switch:`-aI{DIR}`
When looking for source files also look in directory DIR. The order in which
- source file search is undertaken is the same as for *gnatmake*.
+ source file search is undertaken is the same as for ``gnatmake``.
.. index:: -aODIR (gnatxref)
-:samp:`aO{DIR}`
+:switch:`aO{DIR}`
When -searching for library and object files, look in directory
DIR. The order in which library files are searched is the same as for
- *gnatmake*.
+ ``gnatmake``.
.. index:: -nostdinc (gnatxref)
-:samp:`-nostdinc`
+:switch:`-nostdinc`
Do not look for sources in the system default directory.
.. index:: -nostdlib (gnatxref)
-:samp:`-nostdlib`
+:switch:`-nostdlib`
Do not look for library files in the system default directory.
.. index:: --ext (gnatxref)
-:samp:`--ext={extension}`
- Specify an alternate ali file extension. The default is `ali` and other
- extensions (e.g. `gli` for C/C++ sources when using *-fdump-xref*)
+:switch:`--ext={extension}`
+ Specify an alternate ali file extension. The default is ``ali`` and other
+ extensions (e.g. ``gli`` for C/C++ sources when using :switch:`-fdump-xref`)
may be specified via this switch. Note that if this switch overrides the
default, which means that only the new extension will be considered.
.. index:: --RTS (gnatxref)
-:samp:`--RTS={rts-path}`
+:switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`).
.. index:: -d (gnatxref)
-:samp:`-d`
- If this switch is set `gnatxref` will output the parent type
+:switch:`-d`
+ If this switch is set ``gnatxref`` will output the parent type
reference for each matching derived types.
.. index:: -f (gnatxref)
-:samp:`-f`
+:switch:`-f`
If this switch is set, the output file names will be preceded by their
directory (if the file was found in the search path). If this switch is
not set, the directory will not be printed.
@@ -617,62 +621,62 @@ The following switches are available for *gnatxref*:
.. index:: -g (gnatxref)
-:samp:`-g`
+:switch:`-g`
If this switch is set, information is output only for library-level
entities, ignoring local entities. The use of this switch may accelerate
- `gnatfind` and `gnatxref`.
+ ``gnatfind`` and ``gnatxref``.
.. index:: -IDIR (gnatxref)
-:samp:`-I{DIR}`
- Equivalent to :samp:`-aODIR -aIDIR`.
+:switch:`-I{DIR}`
+ Equivalent to :switch:`-aODIR -aIDIR`.
.. index:: -pFILE (gnatxref)
-:samp:`-p{FILE}`
+:switch:`-p{FILE}`
Specify a configuration file to use to list the source and object directories.
If a file is specified, then the content of the source directory and object
directory lines are added as if they had been specified respectively
- by :samp:`-aI` and :samp:`-aO`.
+ by :switch:`-aI` and :switch:`-aO`.
See :ref:`Configuration_Files_for_gnatxref_and_gnatfind` for the syntax
of this configuration file.
-:samp:`-u`
+:switch:`-u`
Output only unused symbols. This may be really useful if you give your
- main compilation unit on the command line, as `gnatxref` will then
+ main compilation unit on the command line, as ``gnatxref`` will then
display every unused entity and 'with'ed package.
-:samp:`-v`
- Instead of producing the default output, `gnatxref` will generate a
+:switch:`-v`
+ Instead of producing the default output, ``gnatxref`` will generate a
:file:`tags` file that can be used by vi. For examples how to use this
feature, see :ref:`Examples_of_gnatxref_Usage`. The tags file is output
to the standard output, thus you will have to redirect it to a file.
All these switches may be in any order on the command line, and may even
appear after the file names. They need not be separated by spaces, thus
-you can say :samp:`gnatxref -ag` instead of :samp:`gnatxref -a -g`.
+you can say ``gnatxref -ag`` instead of ``gnatxref -a -g``.
.. _gnatfind_Switches:
-`gnatfind` Switches
--------------------
+``gnatfind`` Switches
+---------------------
-The command invocation for `gnatfind` is:
+The command invocation for ``gnatfind`` is:
::
- $ gnatfind [`switches`] `pattern`[:`sourcefile`[:`line`[:`column`]]]
- [`file1` `file2` ...]
+ $ gnatfind [ switches ] pattern[:sourcefile[:line[:column]]]
+ [file1 file2 ...]
with the following iterpretation of the command arguments:
*pattern*
An entity will be output only if it matches the regular expression found
- in `pattern`, see :ref:`Regular_Expressions_in_gnatfind_and_gnatxref`.
+ in *pattern*, see :ref:`Regular_Expressions_in_gnatfind_and_gnatxref`.
Omitting the pattern is equivalent to specifying ``*``, which
will match any entity. Note that if you do not provide a pattern, you
@@ -683,9 +687,9 @@ with the following iterpretation of the command arguments:
8-bit codes other than Latin-1, or for wide characters in identifiers.
*sourcefile*
- `gnatfind` will look for references, bodies or declarations
- of symbols referenced in :file:`sourcefile`, at line `line`
- and column `column`. See :ref:`Examples_of_gnatfind_Usage`
+ ``gnatfind`` will look for references, bodies or declarations
+ of symbols referenced in :file:`sourcefile`, at line ``line``
+ and column ``column``. See :ref:`Examples_of_gnatfind_Usage`
for syntax examples.
*line*
@@ -714,7 +718,7 @@ with the following iterpretation of the command arguments:
occurrences of the entity in the separate units of the ones given on the
command line will also be displayed.
- Note that if you specify at least one file in this part, `gnatfind` may
+ Note that if you specify at least one file in this part, ``gnatfind`` may
sometimes not be able to find the body of the subprograms.
At least one of 'sourcefile' or 'pattern' has to be present on
@@ -724,89 +728,89 @@ The following switches are available:
.. index:: --version (gnatfind)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatfind)
-:samp:`--help`
- If *--version* was not used, display usage, then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage, then exit disregarding
all other options.
.. index:: -a (gnatfind)
-:samp:`-a`
- If this switch is present, `gnatfind` and `gnatxref` will parse
+:switch:`-a`
+ If this switch is present, ``gnatfind`` and ``gnatxref`` will parse
the read-only files found in the library search path. Otherwise, these files
will be ignored. This option can be used to protect Gnat sources or your own
- libraries from being parsed, thus making `gnatfind` and `gnatxref`
+ libraries from being parsed, thus making ``gnatfind`` and ``gnatxref``
much faster, and their output much smaller. Read-only here refers to access
or permission status in the file system for the current user.
.. index:: -aIDIR (gnatfind)
-:samp:`-aI{DIR}`
+:switch:`-aI{DIR}`
When looking for source files also look in directory DIR. The order in which
- source file search is undertaken is the same as for *gnatmake*.
+ source file search is undertaken is the same as for ``gnatmake``.
.. index:: -aODIR (gnatfind)
-:samp:`-aO{DIR}`
+:switch:`-aO{DIR}`
When searching for library and object files, look in directory
DIR. The order in which library files are searched is the same as for
- *gnatmake*.
+ ``gnatmake``.
.. index:: -nostdinc (gnatfind)
-:samp:`-nostdinc`
+:switch:`-nostdinc`
Do not look for sources in the system default directory.
.. index:: -nostdlib (gnatfind)
-:samp:`-nostdlib`
+:switch:`-nostdlib`
Do not look for library files in the system default directory.
.. index:: --ext (gnatfind)
-:samp:`--ext={extension}`
- Specify an alternate ali file extension. The default is `ali` and other
- extensions (e.g. `gli` for C/C++ sources when using *-fdump-xref*)
+:switch:`--ext={extension}`
+ Specify an alternate ali file extension. The default is ``ali`` and other
+ extensions (e.g. ``gli`` for C/C++ sources when using :switch:`-fdump-xref`)
may be specified via this switch. Note that if this switch overrides the
default, which means that only the new extension will be considered.
.. index:: --RTS (gnatfind)
-:samp:`--RTS={rts-path}`
+:switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`).
.. index:: -d (gnatfind)
-:samp:`-d`
- If this switch is set, then `gnatfind` will output the parent type
+:switch:`-d`
+ If this switch is set, then ``gnatfind`` will output the parent type
reference for each matching derived types.
.. index:: -e (gnatfind)
-:samp:`-e`
- By default, `gnatfind` accept the simple regular expression set for
- `pattern`. If this switch is set, then the pattern will be
+:switch:`-e`
+ By default, ``gnatfind`` accept the simple regular expression set for
+ ``pattern``. If this switch is set, then the pattern will be
considered as full Unix-style regular expression.
.. index:: -f (gnatfind)
-:samp:`-f`
+:switch:`-f`
If this switch is set, the output file names will be preceded by their
directory (if the file was found in the search path). If this switch is
not set, the directory will not be printed.
@@ -814,51 +818,51 @@ The following switches are available:
.. index:: -g (gnatfind)
-:samp:`-g`
+:switch:`-g`
If this switch is set, information is output only for library-level
entities, ignoring local entities. The use of this switch may accelerate
- `gnatfind` and `gnatxref`.
+ ``gnatfind`` and ``gnatxref``.
.. index:: -IDIR (gnatfind)
-:samp:`-I{DIR}`
- Equivalent to :samp:`-aODIR -aIDIR`.
+:switch:`-I{DIR}`
+ Equivalent to :switch:`-aODIR -aIDIR`.
.. index:: -pFILE (gnatfind)
-:samp:`-p{FILE}`
+:switch:`-p{FILE}`
Specify a configuration file to use to list the source and object directories.
If a file is specified, then the content of the source directory and object
directory lines are added as if they had been specified respectively
- by :samp:`-aI` and :samp:`-aO`.
+ by :switch:`-aI` and :switch:`-aO`.
See :ref:`Configuration_Files_for_gnatxref_and_gnatfind` for the syntax
of this configuration file.
.. index:: -r (gnatfind)
-:samp:`-r`
- By default, `gnatfind` will output only the information about the
+:switch:`-r`
+ By default, ``gnatfind`` will output only the information about the
declaration, body or type completion of the entities. If this switch is
- set, the `gnatfind` will locate every reference to the entities in
+ set, the ``gnatfind`` will locate every reference to the entities in
the files specified on the command line (or in every file in the search
path if no file is given on the command line).
.. index:: -s (gnatfind)
-:samp:`-s`
- If this switch is set, then `gnatfind` will output the content
+:switch:`-s`
+ If this switch is set, then ``gnatfind`` will output the content
of the Ada source file lines were the entity was found.
.. index:: -t (gnatfind)
-:samp:`-t`
- If this switch is set, then `gnatfind` will output the type hierarchy for
+:switch:`-t`
+ If this switch is set, then ``gnatfind`` will output the type hierarchy for
the specified type. It act like -d option but recursively from parent
type to parent type. When this switch is set it is not possible to
specify more than one file.
@@ -866,44 +870,44 @@ The following switches are available:
All these switches may be in any order on the command line, and may even
appear after the file names. They need not be separated by spaces, thus
-you can say :samp:`gnatxref -ag` instead of
-:samp:`gnatxref -a -g`.
+you can say ``gnatxref -ag`` instead of
+``gnatxref -a -g``.
-As stated previously, gnatfind will search in every directory in the
+As stated previously, ``gnatfind`` will search in every directory in the
search path. You can force it to look only in the current directory if
-you specify `*` at the end of the command line.
+you specify ``*`` at the end of the command line.
.. _Configuration_Files_for_gnatxref_and_gnatfind:
-Configuration Files for *gnatxref* and *gnatfind*
--------------------------------------------------
+Configuration Files for ``gnatxref`` and ``gnatfind``
+-----------------------------------------------------
-Configuration files are used by `gnatxref` and `gnatfind` to specify
+Configuration files are used by ``gnatxref`` and ``gnatfind`` to specify
the list of source and object directories to consider. They can be
-specified via the :samp:`-p` switch.
+specified via the :switch:`-p` switch.
The following lines can be included, in any order in the file:
* *src_dir=DIR*
- [default: `"./"`].
- Specifies a directory where to look for source files. Multiple `src_dir`
+ [default: ``"./"``].
+ Specifies a directory where to look for source files. Multiple ``src_dir``
lines can be specified and they will be searched in the order they
are specified.
* *obj_dir=DIR*
- [default: `"./"`].
+ [default: ``"./"``].
Specifies a directory where to look for object and library files. Multiple
- `obj_dir` lines can be specified, and they will be searched in the order
+ ``obj_dir`` lines can be specified, and they will be searched in the order
they are specified
Any other line will be silently ignored.
.. _Regular_Expressions_in_gnatfind_and_gnatxref:
-Regular Expressions in `gnatfind` and `gnatxref`
-------------------------------------------------
+Regular Expressions in ``gnatfind`` and ``gnatxref``
+----------------------------------------------------
-As specified in the section about *gnatfind*, the pattern can be a
+As specified in the section about ``gnatfind``, the pattern can be a
regular expression. Two kinds of regular expressions
are recognized:
@@ -925,7 +929,7 @@ are recognized:
* *Full regular expression*
The second set of regular expressions is much more powerful. This is the
- type of regular expressions recognized by utilities such as :samp:`grep`.
+ type of regular expressions recognized by utilities such as ``grep``.
The following is the form of a regular expression, expressed in same BNF
style as is found in the Ada Reference Manual:
@@ -955,7 +959,7 @@ are recognized:
Here are a few examples:
``abcde|fghi``
- will match any of the two strings :samp:`abcde` and :samp:`fghi`,
+ will match any of the two strings ``abcde`` and ``fghi``,
``abc*d``
will match any string like ``abd``, ``abcd``, ``abccd``,
@@ -968,8 +972,8 @@ are recognized:
.. _Examples_of_gnatxref_Usage:
-Examples of `gnatxref` Usage
-----------------------------
+Examples of ``gnatxref`` Usage
+------------------------------
General Usage
^^^^^^^^^^^^^
@@ -1009,7 +1013,7 @@ the cross-referencing information.
You can then issue any of the following commands:
* ``gnatxref main.adb``
- `gnatxref` generates cross-reference information for main.adb
+ ``gnatxref`` generates cross-reference information for main.adb
and every unit 'with'ed by main.adb.
The output would be:
@@ -1044,48 +1048,48 @@ You can then issue any of the following commands:
Ref: main.adb 6:12 7:12
- This shows that the entity `Main` is declared in main.ads, line 2, column 9,
+ This shows that the entity ``Main`` is declared in main.ads, line 2, column 9,
its body is in main.adb, line 1, column 14 and is not referenced any where.
- The entity `Print` is declared in bar.ads, line 2, column 15 and it
- is referenced in main.adb, line 6 column 12 and line 7 column 12.
+ The entity ``Print`` is declared in :file:`bar.ads`, line 2, column 15 and it
+ is referenced in :file:`main.adb`, line 6 column 12 and line 7 column 12.
* ``gnatxref package1.adb package2.ads``
- `gnatxref` will generates cross-reference information for
- package1.adb, package2.ads and any other package 'with'ed by any
+ ``gnatxref`` will generates cross-reference information for
+ :file:`package1.adb`, :file:`package2.ads` and any other package ``with``\ ed by any
of these.
-Using gnatxref with vi
-^^^^^^^^^^^^^^^^^^^^^^
+Using ``gnatxref`` with ``vi``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-`gnatxref` can generate a tags file output, which can be used
-directly from *vi*. Note that the standard version of *vi*
+``gnatxref`` can generate a tags file output, which can be used
+directly from ``vi``. Note that the standard version of ``vi``
will not work properly with overloaded symbols. Consider using another
-free implementation of *vi*, such as *vim*.
+free implementation of ``vi``, such as ``vim``.
::
$ gnatxref -v gnatfind.adb > tags
-The following command will generate the tags file for `gnatfind` itself
+The following command will generate the tags file for ``gnatfind`` itself
(if the sources are in the search path!):
::
$ gnatxref -v gnatfind.adb > tags
-From *vi*, you can then use the command :samp:`:tag {entity}`
-(replacing `entity` by whatever you are looking for), and vi will
+From ``vi``, you can then use the command :samp:`:tag {entity}`
+(replacing ``entity`` by whatever you are looking for), and vi will
display a new file with the corresponding declaration of entity.
.. _Examples_of_gnatfind_Usage:
-Examples of `gnatfind` Usage
-----------------------------
+Examples of ``gnatfind`` Usage
+------------------------------
* ``gnatfind -f xyz:main.adb``
Find declarations for all entities xyz referenced at least once in
@@ -1108,7 +1112,7 @@ Examples of `gnatfind` Usage
declared at line 45 of foo.ads
* ``gnatfind -fs xyz:main.adb``
- This is the same command as the previous one, but `gnatfind` will
+ This is the same command as the previous one, but ``gnatfind`` will
display the content of the Ada source file lines.
The output will look like:
@@ -1150,32 +1154,32 @@ Examples of `gnatfind` Usage
.. _The_Ada_to_HTML_Converter_gnathtml:
-The Ada to HTML Converter `gnathtml`
-====================================
+The Ada to HTML Converter ``gnathtml``
+======================================
.. index:: ! gnathtml
-*gnathtml* is a Perl script that allows Ada source files to be browsed using
+``gnathtml`` is a Perl script that allows Ada source files to be browsed using
standard Web browsers. For installation information, see :ref:`Installing_gnathtml`.
Ada reserved keywords are highlighted in a bold font and Ada comments in
-a blue font. Unless your program was compiled with the gcc *-gnatx*
+a blue font. Unless your program was compiled with the gcc :switch:`-gnatx`
switch to suppress the generation of cross-referencing information, user
defined variables and types will appear in a different color; you will
be able to click on any identifier and go to its declaration.
.. _Invoking_gnathtml:
-Invoking *gnathtml*
--------------------
+Invoking ``gnathtml``
+---------------------
The command line is as follows:
::
- $ perl gnathtml.pl [`switches`] `ada-files`
+ $ perl gnathtml.pl [ switches ] ada-files
-You can specify as many Ada files as you want. `gnathtml` will generate
+You can specify as many Ada files as you want. ``gnathtml`` will generate
an html file for every ada file, and a global file called :file:`index.htm`.
This file is an index of every identifier defined in the files.
@@ -1196,14 +1200,14 @@ The following switches are available:
:samp:`d`
If the Ada files depend on some other files (for instance through
- `with` clauses, the latter files will also be converted to html.
+ ``with`` clauses, the latter files will also be converted to html.
Only the files in the user project will be converted to html, not the files
in the run-time library itself.
.. index:: -D (gnathtml)
:samp:`D`
- This command is the same as *-d* above, but *gnathtml* will
+ This command is the same as :switch:`-d` above, but ``gnathtml`` will
also look for files in the run-time library, and generate html files for them.
.. index:: -ext (gnathtml)
@@ -1217,14 +1221,14 @@ The following switches are available:
:samp:`f`
By default, gnathtml will generate html links only for global entities
('with'ed units, global variables and types,...). If you specify
- *-f* on the command line, then links will be generated for local
+ :switch:`-f` on the command line, then links will be generated for local
entities too.
.. index:: -l (gnathtml)
:samp:`l {number}`
- If this switch is provided and `number` is not 0, then
- `gnathtml` will number the html files every `number` line.
+ If this switch is provided and ``number`` is not 0, then
+ ``gnathtml`` will number the html files every ``number`` line.
.. index:: -I (gnathtml)
@@ -1269,15 +1273,15 @@ The following switches are available:
.. _Installing_gnathtml:
-Installing `gnathtml`
----------------------
+Installing ``gnathtml``
+-----------------------
-`Perl` needs to be installed on your machine to run this script.
-`Perl` is freely available for almost every architecture and
+``Perl`` needs to be installed on your machine to run this script.
+``Perl`` is freely available for almost every architecture and
operating system via the Internet.
On Unix systems, you may want to modify the first line of the script
-`gnathtml`, to explicitly specify where Perl
+``gnathtml``, to explicitly specify where Perl
is located. The syntax of this line is:
::
@@ -1288,7 +1292,7 @@ Alternatively, you may run the script using the following command line:
::
- $ perl gnathtml.pl [`switches`] `files`
+ $ perl gnathtml.pl [ switches ] files
@@ -1301,26 +1305,26 @@ Alternatively, you may run the script using the following command line:
.. _The_Ada-to-XML_converter_gnat2xml:
- The Ada-to-XML converter *gnat2xml*
- ===================================
+ The Ada-to-XML converter ``gnat2xml``
+ =====================================
.. index:: ! gnat2xml
.. index:: XML generation
- The *gnat2xml* tool is an ASIS-based utility that converts
+ The ``gnat2xml`` tool is an ASIS-based utility that converts
Ada source code into XML.
- *gnat2xml* is a project-aware tool
+ ``gnat2xml`` is a project-aware tool
(see :ref:`Using_Project_Files_with_GNAT_Tools` for a description of
the project-related switches). The project file package that can specify
- *gnat2xml* switches is named ``gnat2xml``.
+ ``gnat2xml`` switches is named ``gnat2xml``.
- .. _Switches_for_*gnat2xml*:
+ .. _Switches_for_``gnat2xml``:
- Switches for *gnat2xml*
- -----------------------
+ Switches for ``gnat2xml``
+ -------------------------
- *gnat2xml* takes Ada source code as input, and produces XML
+ ``gnat2xml`` takes Ada source code as input, and produces XML
that conforms to the schema.
Usage:
@@ -1331,85 +1335,88 @@ Alternatively, you may run the script using the following command line:
Options:
- :samp:`--help`
+ :switch:`--help`
Generate usage information and quit, ignoring all other options
- :samp:`-h`
+ :switch:`-h`
Same as ``--help``
- :samp:`--version`
+ :switch:`--version`
Print version and quit, ignoring all other options
- :samp:`-P{file}`
+ :switch:`-P{file}`
indicates the name of the project file that describes
the set of sources to be processed. The exact set of argument
sources depends on other options specified, see below.
- :samp:`-U`
+ :switch:`-U`
If a project file is specified and no argument source is explicitly
specified, process all the units of the closure of the argument project.
Otherwise this option has no effect.
- :samp:`-U {main_unit}`
+ :switch:`-U {main_unit}`
If a project file is specified and no argument source
- is explicitly specified (either directly or by means of *-files*
- option), process the closure of units rooted at `main_unit`.
+ is explicitly specified (either directly or by means of :switch:`-files`
+ option), process the closure of units rooted at ``main_unit``.
Otherwise this option has no effect.
- :samp:`-X{name}={value}`
- Indicates that external variable `name` in
- the argument project has the value `value`. Has no effect if no
+ :switch:`-X{name}={value}`
+ Indicates that external variable ``name`` in
+ the argument project has the value ``value``. Has no effect if no
project is specified as tool argument.
- :samp:`--RTS={rts-path}`
+ :switch:`--RTS={rts-path}`
Specifies the default location of the runtime
- library. Same meaning as the equivalent *gnatmake* flag
+ library. Same meaning as the equivalent ``gnatmake`` flag
(:ref:`Switches_for_gnatmake`).
- :samp:`--incremental`
+ :switch:`--incremental`
Incremental processing on a per-file basis. Source files are
only processed if they have been modified, or if files they depend
on have been modified. This is similar to the way gnatmake/gprbuild
only compiles files that need to be recompiled. A project file
is required in this mode.
- :samp:`-j{n}`
- In *--incremental* mode, use `n` *gnat2xml*
- processes to perform XML generation in parallel. If `n` is 0, then
+ :switch:`-j{n}`
+ In :switch:`--incremental` mode, use ``n`` ``gnat2xml``
+ processes to perform XML generation in parallel. If ``n`` is 0, then
the maximum number of parallel tree creations is the number of core
processors on the platform.
- :samp:`--output-dir={dir}`
+ :switch:`--output-dir={dir}`
Generate one .xml file for each Ada source file, in
directory :file:`dir`. (Default is to generate the XML to standard
output.)
- :samp:`-I{include-dir}`
+ :switch:`-I{include-dir}`
Directories to search for dependencies.
You can also set the ADA_INCLUDE_PATH environment variable for this.
- :samp:`--compact`
+ :switch:`--compact`
Debugging version, with interspersed source, and a more
compact representation of "sloc". This version does not conform
to any schema.
- :samp:`--rep-clauses`
+ :switch:`--rep-clauses`
generate representation clauses (see :ref:`Generating_Representation_Clauses`).
- :samp:`-files={filename}`
- The name of a text file containing a list of Ada source files to process
+ :switch:`-files={filename}`
+ Take as arguments the files listed in text file ``file``.
+ Text file ``file`` may contain empty lines that are ignored.
+ Each nonempty line should contain the name of an existing file.
+ Several such switches may be specified simultaneously.
- :samp:`-q`
+ :switch:`-q`
Quiet
- :samp:`-v`
+ :switch:`-v`
Verbose
- :samp:`-cargs` ...
+ :switch:`-cargs` ...
Options to pass to gcc
If a project file is specified and no argument source is explicitly
- specified, and no *-U* is specified, then the set of processed
+ specified, and no :switch:`-U` is specified, then the set of processed
sources is all the immediate units of the argument project.
Example:
@@ -1430,12 +1437,12 @@ Alternatively, you may run the script using the following command line:
--------------
The distribution includes two other programs that are related to
- *gnat2xml*:
+ ``gnat2xml``:
- *gnat2xsd* is the schema generator, which generates the schema
+ ``gnat2xsd`` is the schema generator, which generates the schema
to standard output, based on the structure of Ada as encoded by
- ASIS. You don't need to run *gnat2xsd* in order to use
- *gnat2xml*. To generate the schema, type:
+ ASIS. You don't need to run ``gnat2xsd`` in order to use
+ ``gnat2xml``. To generate the schema, type:
::
@@ -1443,13 +1450,13 @@ Alternatively, you may run the script using the following command line:
$ gnat2xsd > ada-schema.xsd
- *gnat2xml* generates XML files that will validate against
+ ``gnat2xml`` generates XML files that will validate against
:file:`ada-schema.xsd`.
- *xml2gnat* is a back-translator that translates the XML back
- into Ada source code. The Ada generated by *xml2gnat* has
+ ``xml2gnat`` is a back-translator that translates the XML back
+ into Ada source code. The Ada generated by ``xml2gnat`` has
identical semantics to the original Ada code passed to
- *gnat2xml*. It is not textually identical, however --- for
+ ``gnat2xml``. It is not textually identical, however --- for
example, no attempt is made to preserve the original indentation.
.. _Structure_of_the_XML:
@@ -1458,7 +1465,7 @@ Alternatively, you may run the script using the following command line:
--------------------
The primary documentation for the structure of the XML generated by
- *gnat2xml* is the schema (see *gnat2xsd* above). The
+ ``gnat2xml`` is the schema (see ``gnat2xsd`` above). The
following documentation gives additional details needed to understand
the schema and therefore the XML.
@@ -1534,7 +1541,7 @@ Alternatively, you may run the script using the following command line:
Some subelements are 'Boolean'. For example, Private_Type_Definition
has has_abstract_q and has_limited_q, to indicate whether those
- keywords are present, as in `type T is abstract limited private;`.
+ keywords are present, as in ``type T is abstract limited private;``.
False is represented by a Nil_Element. True is represented
by an element type specific to that query (for example, Abstract and
Limited).
@@ -1546,14 +1553,14 @@ Alternatively, you may run the script using the following command line:
in package Asis.
* unit_full_name is the full expanded name of the unit, starting from a
- root library unit. So for `package P.Q.R is ...`,
- `unit_full_name="P.Q.R"`. Same for `separate (P.Q) package R is ...`.
+ root library unit. So for ``package P.Q.R is ...``,
+ ``unit_full_name="P.Q.R"``. Same for ``separate (P.Q) package R is ...``.
* def_name is the same as unit_full_name for library units; for subunits,
it is just the simple name.
* source_file is the name of the Ada source file. For example, for
- the spec of `P.Q.R`, `source_file="p-q-r.ads"`. This allows one to
+ the spec of ``P.Q.R``, ``source_file="p-q-r.ads"``. This allows one to
interpret the source locations --- the 'sloc' of all elements
within this Compilation_Unit refers to line and column numbers
within the named file.
@@ -1579,7 +1586,7 @@ Alternatively, you may run the script using the following command line:
algorithm, which is subject to change; we just guarantee that the
names are unique in the face of overloading.
- * type is the type of the declared object, or `null` for
+ * type is the type of the declared object, or ``null`` for
declarations of things other than objects.
Usage occurrences have these attributes:
@@ -1591,14 +1598,14 @@ Alternatively, you may run the script using the following command line:
* ref is the same as the def of the corresponding defining
occurrence.
- In summary, `def_name` and `ref_name` are as in the source
- code of the declaration, possibly overloaded, whereas `def` and
- `ref` are unique-ified.
+ In summary, ``def_name`` and ``ref_name`` are as in the source
+ code of the declaration, possibly overloaded, whereas ``def`` and
+ ``ref`` are unique-ified.
Literal elements have this attribute:
* lit_val is the value of the literal as written in the source text,
- appropriately escaped (e.g. `"` ---> `&quot;`). This applies
+ appropriately escaped (e.g. ``"`` |rightarrow| ``&quot;``). This applies
only to numeric and string literals. Enumeration literals in Ada are
not really "literals" in the usual sense; they are usage occurrences,
and have ref_name and ref as described above. Note also that string
@@ -1716,18 +1723,18 @@ Alternatively, you may run the script using the following command line:
Generating Representation Clauses
---------------------------------
- If the *--rep-clauses* switch is given, *gnat2xml* will
+ If the :switch:`--rep-clauses` switch is given, ``gnat2xml`` will
generate representation clauses for certain types showing the
representation chosen by the compiler. The information is produced by
the ASIS 'Data Decomposition' facility --- see the
- `Asis.Data_Decomposition` package for details.
+ ``Asis.Data_Decomposition`` package for details.
- Not all types are supported. For example, `Type_Model_Kind` must
- be `A_Simple_Static_Model`. Types declared within generic units
+ Not all types are supported. For example, ``Type_Model_Kind`` must
+ be ``A_Simple_Static_Model``. Types declared within generic units
have no representation. The clauses that are generated include
- `attribute_definition_clauses` for `Size` and
- `Component_Size`, as well as
- `record_representation_clauses`.
+ ``attribute_definition_clauses`` for ``Size`` and
+ ``Component_Size``, as well as
+ ``record_representation_clauses``.
There is no guarantee that the generated representation clauses could
have actually come from legal Ada code; Ada has some restrictions that
@@ -1750,19 +1757,19 @@ Alternatively, you may run the script using the following command line:
.. _The_Program_Property_Verifier_gnatcheck:
- The Program Property Verifier *gnatcheck*
- =========================================
+ The Coding Standard Verifier ``gnatcheck``
+ ==========================================
.. index:: ! gnatcheck
.. index:: ASIS
- The *gnatcheck* tool is an ASIS-based utility that checks properties
- of Ada source files according to a given set of semantic rules.
+ The ``gnatcheck`` tool is an ASIS-based utility that checks coding standard
+ compliance of Ada source files according to a given set of semantic rules.
- *gnatcheck* is a project-aware tool
+ ``gnatcheck`` is a project-aware tool
(see :ref:`Using_Project_Files_with_GNAT_Tools` for a description of
the project-related switches). The project file package that can specify
- *gnatcheck* switches is named ``Check``.
+ ``gnatcheck`` switches is named ``Check``.
For full details, plese refer to :title:`GNATcheck Reference Manual`.
@@ -1772,24 +1779,24 @@ Alternatively, you may run the script using the following command line:
.. _The_GNAT_Metrics_Tool_gnatmetric:
- The GNAT Metrics Tool *gnatmetric*
- ==================================
+ The GNAT Metrics Tool ``gnatmetric``
+ ====================================
.. index:: ! gnatmetric
.. index:: Metric tool
- The *gnatmetric* tool is an ASIS-based utility
+ The ``gnatmetric`` tool is an ASIS-based utility
for computing various program metrics.
It takes an Ada source file as input and generates a file containing the
metrics data as output. Various switches control which
metrics are computed and output.
- *gnatmetric* is a project-aware tool
+ ``gnatmetric`` is a project-aware tool
(see :ref:`Using_Project_Files_with_GNAT_Tools` for a description of
the project-related switches). The project file package that can specify
- *gnatmetric* switches is named ``Metrics``.
+ ``gnatmetric`` switches is named ``Metrics``.
- To compute program metrics, *gnatmetric* invokes the Ada
+ To compute program metrics, ``gnatmetric`` invokes the Ada
compiler and generates and uses the ASIS tree for the input source;
thus the input must be legal Ada code, and the tool should have all the
information needed to compile the input source. To provide this information,
@@ -1797,45 +1804,45 @@ Alternatively, you may run the script using the following command line:
(or you may call *gnatmetric*
through the *gnat* driver (see :ref:`The_GNAT_Driver_and_Project_Files`).
Another possibility is to specify the source search
- path and needed configuration files in *-cargs* section of *gnatmetric*
- call, see the description of the *gnatmetric* switches below.
+ path and needed configuration files in :switch:`-cargs` section of ``gnatmetric``
+ call, see the description of the ``gnatmetric`` switches below.
- If the set of sources to be processed by `gnatmetric` contains sources with
+ If the set of sources to be processed by ``gnatmetric`` contains sources with
preprocessing directives
then the needed options should be provided to run preprocessor as a part of
- the *gnatmetric* call, and the computed metrics
+ the ``gnatmetric`` call, and the computed metrics
will correspond to preprocessed sources.
- The *gnatmetric* command has the form
+ The ``gnatmetric`` command has the form
::
- $ gnatmetric [`switches`] {`filename`} [-cargs `gcc_switches`]
+ $ gnatmetric [ switches ] { filename } [ -cargs gcc_switches ]
where:
- * `switches` specify the metrics to compute and define the destination for
+ * ``switches`` specify the metrics to compute and define the destination for
the output
- * Each `filename` is the name (including the extension) of a source
+ * Each ``filename`` is the name (including the extension) of a source
file to process. 'Wildcards' are allowed, and
the file name may contain path information.
- If no `filename` is supplied, then the `switches` list must contain
+ If no ``filename`` is supplied, then the ``switches`` list must contain
at least one
- *-files* switch (see :ref:`Other_gnatmetric_Switches`).
- Including both a *-files* switch and one or more
- `filename` arguments is permitted.
-
- * `gcc_switches` is a list of switches for
- *gcc*. They will be passed on to all compiler invocations made by
- *gnatmetric* to generate the ASIS trees. Here you can provide
- *-I* switches to form the source search path,
- and use the *-gnatec* switch to set the configuration file,
- use the *-gnat05* switch if sources should be compiled in
+ :switch:`-files` switch (see :ref:`Other_gnatmetric_Switches`).
+ Including both a :switch:`-files` switch and one or more
+ ``filename`` arguments is permitted.
+
+ * ``gcc_switches`` is a list of switches for
+ ``gcc``. They will be passed on to all compiler invocations made by
+ ``gnatmetric`` to generate the ASIS trees. Here you can provide
+ :switch:`-I` switches to form the source search path,
+ and use the :switch:`-gnatec` switch to set the configuration file,
+ use the :switch:`-gnat05` switch if sources should be compiled in
Ada 2005 mode etc.
The following subsections describe the various switches accepted by
- *gnatmetric*, organized by category.
+ ``gnatmetric``, organized by category.
.. _Output_File_Control-gnatmetric:
@@ -1844,11 +1851,11 @@ Alternatively, you may run the script using the following command line:
.. index:: Output file control in gnatmetric
- *gnatmetric* has two output formats. It can generate a
+ ``gnatmetric`` has two output formats. It can generate a
textual (human-readable) form, and also XML. By default only textual
output is generated.
- When generating the output in textual form, *gnatmetric* creates
+ When generating the output in textual form, ``gnatmetric`` creates
for each Ada source file a corresponding text file
containing the computed metrics, except for the case when the set of metrics
specified by gnatmetric parameters consists only of metrics that are computed
@@ -1856,35 +1863,35 @@ Alternatively, you may run the script using the following command line:
By default, the name of the file containing metric information for a source
is obtained by appending the :file:`.metrix` suffix to the
name of the input source file. If not otherwise specified and no project file
- is specified as *gnatmetric* option this file is placed in the same
- directory as where the source file is located. If *gnatmetric* has a
+ is specified as ``gnatmetric`` option this file is placed in the same
+ directory as where the source file is located. If ``gnatmetric`` has a
project file as its parameter, it places all the generated files in the
object directory of the project (or in the project source directory if the
- project does not define an objects directory), if *--subdirs* option
+ project does not define an objects directory), if :switch:`--subdirs` option
is specified, the files are placed in the subrirectory of this directory
specified by this option.
All the output information generated in XML format is placed in a single
file. By default the name of this file is :file:`metrix.xml`.
If not otherwise specified and if no project file is specified
- as *gnatmetric* option this file is placed in the
+ as ``gnatmetric`` option this file is placed in the
current directory.
Some of the computed metrics are summed over the units passed to
- *gnatmetric*; for example, the total number of lines of code.
+ ``gnatmetric``; for example, the total number of lines of code.
By default this information is sent to :file:`stdout`, but a file
- can be specified with the *-og* switch.
+ can be specified with the :switch:`-og` switch.
- The following switches control the *gnatmetric* output:
+ The following switches control the ``gnatmetric`` output:
.. index:: -x (gnatmetric)
- :samp:`-x`
+ :switch:`-x`
Generate the XML output
.. index:: -xs (gnatmetric)
- :samp:`-xs`
+ :switch:`-xs`
Generate the XML output and the XML schema file that describes the structure
of the XML metric report, this schema is assigned to the XML file. The schema
file has the same name as the XML output file with :file:`.xml` suffix replaced
@@ -1893,42 +1900,42 @@ Alternatively, you may run the script using the following command line:
.. index:: -nt (gnatmetric)
- :samp:`-nt`
- Do not generate the output in text form (implies *-x*)
+ :switch:`-nt`
+ Do not generate the output in text form (implies :switch:`-x`)
.. index:: -d (gnatmetric)
- :samp:`-d {output_dir}`
- Put text files with detailed metrics into `output_dir`
+ :switch:`-d {output_dir}`
+ Put text files with detailed metrics into ``output_dir``
.. index:: -o (gnatmetric)
- :samp:`-o {file_suffix}`
- Use `file_suffix`, instead of :file:`.metrix`
+ :switch:`-o {file_suffix}`
+ Use ``file_suffix``, instead of :file:`.metrix`
in the name of the output file.
.. index:: -og (gnatmetric)
- :samp:`-og {file_name}`
- Put global metrics into `file_name`
+ :switch:`-og {file_name}`
+ Put global metrics into ``file_name``
.. index:: -ox (gnatmetric)
- :samp:`-ox {file_name}`
- Put the XML output into `file_name` (also implies *-x*)
+ :switch:`-ox {file_name}`
+ Put the XML output into ``file_name`` (also implies :switch:`-x`)
.. index:: -sfn (gnatmetric)
- :samp:`-sfn`
- Use 'short' source file names in the output. (The *gnatmetric*
+ :switch:`-sfn`
+ Use 'short' source file names in the output. (The ``gnatmetric``
output includes the name(s) of the Ada source file(s) from which the metrics
are computed. By default each name includes the absolute path. The
- *-sfn* switch causes *gnatmetric*
+ :switch:`-sfn` switch causes ``gnatmetric``
to exclude all directory information from the file names that are output.)
@@ -1939,13 +1946,13 @@ Alternatively, you may run the script using the following command line:
Disable Metrics For Local Units
-------------------------------
- *gnatmetric* relies on the GNAT compilation model --
+ ``gnatmetric`` relies on the GNAT compilation model --
one compilation
unit per one source file. It computes line metrics for the whole source
file, and it also computes syntax
and complexity metrics for the file's outermost unit.
- By default, *gnatmetric* will also compute all metrics for certain
+ By default, ``gnatmetric`` will also compute all metrics for certain
kinds of locally declared program units:
* subprogram (and generic subprogram) bodies;
@@ -1974,7 +1981,7 @@ Alternatively, you may run the script using the following command line:
.. index:: -nolocal (gnatmetric)
- :samp:`-nolocal`
+ :switch:`-nolocal`
Do not compute detailed metrics for eligible local program units
@@ -1999,7 +2006,7 @@ Alternatively, you may run the script using the following command line:
.. index:: Line metrics control in gnatmetric
For any (legal) source file, and for each of its
- eligible local program units, *gnatmetric* computes the following
+ eligible local program units, ``gnatmetric`` computes the following
metrics:
* the total number of lines;
@@ -2020,7 +2027,7 @@ Alternatively, you may run the script using the following command line:
bodies and statement sequences in package bodies (this metric is only computed
across the whole set of the analyzed units)
- *gnatmetric* sums the values of the line metrics for all the
+ ``gnatmetric`` sums the values of the line metrics for all the
files being processed and then generates the cumulative results. The tool
also computes for all the files being processed the average number of code
lines in bodies.
@@ -2033,71 +2040,71 @@ Alternatively, you may run the script using the following command line:
.. index:: --no-lines (gnatmetric)
- :samp:`--lines-all`
+ :switch:`--lines-all`
Report all the line metrics
- :samp:`--no-lines-all`
+ :switch:`--no-lines-all`
Do not report any of line metrics
- :samp:`--lines`
+ :switch:`--lines`
Report the number of all lines
- :samp:`--no-lines`
+ :switch:`--no-lines`
Do not report the number of all lines
- :samp:`--lines-code`
+ :switch:`--lines-code`
Report the number of code lines
- :samp:`--no-lines-code`
+ :switch:`--no-lines-code`
Do not report the number of code lines
- :samp:`--lines-comment`
+ :switch:`--lines-comment`
Report the number of comment lines
- :samp:`--no-lines-comment`
+ :switch:`--no-lines-comment`
Do not report the number of comment lines
- :samp:`--lines-eol-comment`
+ :switch:`--lines-eol-comment`
Report the number of code lines containing
end-of-line comments
- :samp:`--no-lines-eol-comment`
+ :switch:`--no-lines-eol-comment`
Do not report the number of code lines containing
end-of-line comments
- :samp:`--lines-ratio`
+ :switch:`--lines-ratio`
Report the comment percentage in the program text
- :samp:`--no-lines-ratio`
+ :switch:`--no-lines-ratio`
Do not report the comment percentage in the program text
- :samp:`--lines-blank`
+ :switch:`--lines-blank`
Report the number of blank lines
- :samp:`--no-lines-blank`
+ :switch:`--no-lines-blank`
Do not report the number of blank lines
- :samp:`--lines-average`
+ :switch:`--lines-average`
Report the average number of code lines in subprogram bodies, task bodies,
entry bodies and statement sequences in package bodies. The metric is computed
and reported for the whole set of processed Ada sources only.
- :samp:`--no-lines-average`
+ :switch:`--no-lines-average`
Do not report the average number of code lines in subprogram bodies,
task bodies, entry bodies and statement sequences in package bodies.
@@ -2109,7 +2116,7 @@ Alternatively, you may run the script using the following command line:
.. index:: Syntax metrics control in gnatmetric
- *gnatmetric* computes various syntactic metrics for the
+ ``gnatmetric`` computes various syntactic metrics for the
outermost unit and for each eligible local unit:
* *LSLOC ('Logical Source Lines Of Code')*
@@ -2151,7 +2158,7 @@ Alternatively, you may run the script using the following command line:
subprogram declaration but is not a completion of previous declaration.
This metric is not reported for generic and formal subprograms.
- For the outermost unit in the file, *gnatmetric* additionally computes
+ For the outermost unit in the file, ``gnatmetric`` additionally computes
the following metrics:
* *Public subprograms*
@@ -2210,82 +2217,82 @@ Alternatively, you may run the script using the following command line:
.. index:: --no-syntax (gnatmetric)
- :samp:`--syntax-all`
+ :switch:`--syntax-all`
Report all the syntax metrics
- :samp:`--no-syntax-all`
+ :switch:`--no-syntax-all`
Do not report any of syntax metrics
- :samp:`--declarations`
+ :switch:`--declarations`
Report the total number of declarations
- :samp:`--no-declarations`
+ :switch:`--no-declarations`
Do not report the total number of declarations
- :samp:`--statements`
+ :switch:`--statements`
Report the total number of statements
- :samp:`--no-statements`
+ :switch:`--no-statements`
Do not report the total number of statements
- :samp:`--public-subprograms`
+ :switch:`--public-subprograms`
Report the number of public subprograms in a compilation unit
- :samp:`--no-public-subprograms`
+ :switch:`--no-public-subprograms`
Do not report the number of public subprograms in a compilation unit
- :samp:`--all-subprograms`
+ :switch:`--all-subprograms`
Report the number of all the subprograms in a compilation unit
- :samp:`--no-all-subprograms`
+ :switch:`--no-all-subprograms`
Do not report the number of all the subprograms in a compilation unit
- :samp:`--public-types`
+ :switch:`--public-types`
Report the number of public types in a compilation unit
- :samp:`--no-public-types`
+ :switch:`--no-public-types`
Do not report the number of public types in a compilation unit
- :samp:`--all-types`
+ :switch:`--all-types`
Report the number of all the types in a compilation unit
- :samp:`--no-all-types`
+ :switch:`--no-all-types`
Do not report the number of all the types in a compilation unit
- :samp:`--unit-nesting`
+ :switch:`--unit-nesting`
Report the maximal program unit nesting level
- :samp:`--no-unit-nesting`
+ :switch:`--no-unit-nesting`
Do not report the maximal program unit nesting level
- :samp:`--construct-nesting`
+ :switch:`--construct-nesting`
Report the maximal construct nesting level
- :samp:`--no-construct-nesting`
+ :switch:`--no-construct-nesting`
Do not report the maximal construct nesting level
- :samp:`--param-number`
+ :switch:`--param-number`
Report the number of subprogram parameters
- :samp:`--no-param-number`
+ :switch:`--no-param-number`
Do not report the number of subprogram parameters
@@ -2298,7 +2305,7 @@ Alternatively, you may run the script using the following command line:
For a program unit that is an executable body (a subprogram body (including
generic bodies), task body, entry body or a package body containing
- its own statement sequence) *gnatmetric* computes the following
+ its own statement sequence) ``gnatmetric`` computes the following
complexity metrics:
* McCabe cyclomatic complexity;
@@ -2319,14 +2326,14 @@ Alternatively, you may run the script using the following command line:
* the complexity introduced by control
statements only, without taking into account short-circuit forms
- (referred as `statement complexity` in *gnatmetric* output),
+ (referred as ``statement complexity`` in ``gnatmetric`` output),
* the complexity introduced by short-circuit control forms only
- (referred as `expression complexity` in *gnatmetric* output), and
+ (referred as ``expression complexity`` in ``gnatmetric`` output), and
* the total
cyclomatic complexity, which is the sum of these two values
- (referred as `cyclomatic complexity` in *gnatmetric* output).
+ (referred as ``cyclomatic complexity`` in ``gnatmetric`` output).
The cyclomatic complexity is also computed for Ada 2012 expression functions.
An expression function cannot have statements as its components, so only one
@@ -2335,22 +2342,22 @@ Alternatively, you may run the script using the following command line:
The origin of cyclomatic complexity metric is the need to estimate the number
of independent paths in the control flow graph that in turn gives the number
of tests needed to satisfy paths coverage testing completeness criterion.
- Considered from the testing point of view, a static Ada `loop` (that is,
- the `loop` statement having static subtype in loop parameter
+ Considered from the testing point of view, a static Ada ``loop`` (that is,
+ the ``loop`` statement having static subtype in loop parameter
specification) does not add to cyclomatic complexity. By providing
- *--no-static-loop* option a user
+ :switch:`--no-static-loop` option a user
may specify that such loops should not be counted when computing the
cyclomatic complexity metric
The Ada essential complexity metric is a McCabe cyclomatic complexity metric
counted for the code that is reduced by excluding all the pure structural Ada
control statements. An compound statement is considered as a non-structural
- if it contains a `raise` or `return` statement as it subcomponent,
- or if it contains a `goto` statement that transfers the control outside
- the operator. A selective accept statement with `terminate` alternative
- is considered as non-structural statement. When computing this metric,
- `exit` statements are treated in the same way as `goto`
- statements unless *-ne* option is specified.
+ if it contains a ``raise`` or ``return`` statement as it subcomponent,
+ or if it contains a ``goto`` statement that transfers the control outside
+ the operator. A selective ``accept`` statement with a ``terminate`` alternative
+ is considered a non-structural statement. When computing this metric,
+ ``exit`` statements are treated in the same way as ``goto``
+ statements unless the :switch:`-ne` option is specified.
The Ada essential complexity metric defined here is intended to quantify
the extent to which the software is unstructured. It is adapted from
@@ -2360,7 +2367,7 @@ Alternatively, you may run the script using the following command line:
suitable for typical Ada usage. For example, short circuit forms
are not penalized as unstructured in the Ada essential complexity metric.
- When computing cyclomatic and essential complexity, *gnatmetric* skips
+ When computing cyclomatic and essential complexity, ``gnatmetric`` skips
the code in the exception handlers and in all the nested program units. The
code of assertions and predicates (that is, subprogram preconditions and
postconditions, subtype predicates and type invariants) is also skipped.
@@ -2374,72 +2381,72 @@ Alternatively, you may run the script using the following command line:
.. index:: --no-complexity (gnatmetric)
- :samp:`--complexity-all`
+ :switch:`--complexity-all`
Report all the complexity metrics
- :samp:`--no-complexity-all`
+ :switch:`--no-complexity-all`
Do not report any of complexity metrics
- :samp:`--complexity-cyclomatic`
+ :switch:`--complexity-cyclomatic`
Report the McCabe Cyclomatic Complexity
- :samp:`--no-complexity-cyclomatic`
+ :switch:`--no-complexity-cyclomatic`
Do not report the McCabe Cyclomatic Complexity
- :samp:`--complexity-essential`
+ :switch:`--complexity-essential`
Report the Essential Complexity
- :samp:`--no-complexity-essential`
+ :switch:`--no-complexity-essential`
Do not report the Essential Complexity
- :samp:`--loop-nesting`
+ :switch:`--loop-nesting`
Report maximal loop nesting level
- :samp:`-no-loop-nesting`
+ :switch:`-no-loop-nesting`
Do not report maximal loop nesting level
- :samp:`--complexity-average`
+ :switch:`--complexity-average`
Report the average McCabe Cyclomatic Complexity for all the subprogram bodies,
task bodies, entry bodies and statement sequences in package bodies.
The metric is computed and reported for whole set of processed Ada sources
only.
- :samp:`--no-complexity-average`
+ :switch:`--no-complexity-average`
Do not report the average McCabe Cyclomatic Complexity for all the subprogram
bodies, task bodies, entry bodies and statement sequences in package bodies
.. index:: -ne (gnatmetric)
- :samp:`-ne`
- Do not consider `exit` statements as `goto`\ s when
+ :switch:`-ne`
+ Do not consider ``exit`` statements as ``goto``\ s when
computing Essential Complexity
.. index:: --no-static-loop (gnatmetric)
- :samp:`--no-static-loop`
+ :switch:`--no-static-loop`
Do not consider static loops when computing cyclomatic complexity
- :samp:`--extra-exit-points`
+ :switch:`--extra-exit-points`
Report the extra exit points for subprogram bodies. As an exit point, this
- metric counts `return` statements and raise statements in case when the
+ metric counts ``return`` statements and raise statements in case when the
raised exception is not handled in the same body. In case of a function this
metric subtracts 1 from the number of exit points, because a function body
- must contain at least one `return` statement.
+ must contain at least one ``return`` statement.
- :samp:`--no-extra-exit-points`
+ :switch:`--no-extra-exit-points`
Do not report the extra exit points for subprogram bodies
@@ -2456,7 +2463,7 @@ Alternatively, you may run the script using the following command line:
entities in the program. This information is useful since high coupling
may signal potential issues with maintainability as the program evolves.
- *gnatmetric* computes the following coupling metrics:
+ ``gnatmetric`` computes the following coupling metrics:
* *object-oriented coupling*, for classes in traditional object-oriented
@@ -2492,13 +2499,13 @@ Alternatively, you may run the script using the following command line:
and/or method members). A *category* (of classes) is a group of closely
related classes that are reused and/or modified together.
- A class `K`'s fan-out coupling is the number of classes
- that `K` depends upon.
+ A class ``K``\ 's fan-out coupling is the number of classes
+ that ``K`` depends upon.
A category's fan-out coupling is the number of classes outside the
category that the classes inside the category depend upon.
- A class `K`'s fan-in coupling is the number of classes
- that depend upon `K`.
+ A class ``K``\ 's fan-in coupling is the number of classes
+ that depend upon ``K``.
A category's fan-in coupling is the number of classes outside the
category that depend on classes belonging to the category.
@@ -2528,7 +2535,7 @@ Alternatively, you may run the script using the following command line:
Similarly, for unit and control coupling an entity is considered to be the
conceptual construct consisting of the entity's specification, body, and
any subunits (transitively).
- *gnatmetric* computes
+ ``gnatmetric`` computes
the dependencies of all these units as a whole, but
metrics are only reported for spec
units (or for a subprogram body unit in case if there is no
@@ -2574,7 +2581,7 @@ Alternatively, you may run the script using the following command line:
end Fun;
end Pack;
- If we apply *gnatmetric* with the *--coupling-all* option to
+ If we apply ``gnatmetric`` with the :switch:`--coupling-all` option to
these units, the result will be:
::
@@ -2602,27 +2609,27 @@ Alternatively, you may run the script using the following command line:
coupling because none of the argument units contains a tagged type and
therefore none of these units can be treated as a class.
- The `Pack` package (spec and body) depends on two
- units -- `Lib_1` `and Lib_2` -- and so its unit fan-out coupling
+ The ``Pack`` package (spec and body) depends on two
+ units -- ``Lib_1`` and ``Lib_2`` -- and so its unit fan-out coupling
is 2. Since nothing depends on it, its unit fan-in coupling is 0, as
- is its control fan-in coupling. Only one of the units `Pack` depends
+ is its control fan-in coupling. Only one of the units ``Pack`` depends
upon defines a subprogram, so its control fan-out coupling is 1.
- `Lib_2` depends on nothing, so its fan-out metrics are 0. It does
+ ``Lib_2`` depends on nothing, so its fan-out metrics are 0. It does
not define any subprograms, so it has no control fan-in metric.
- One unit (`Pack`) depends on it , so its unit fan-in coupling is 1.
+ One unit (``Pack``) depends on it , so its unit fan-in coupling is 1.
- `Lib_1` is similar to `Lib_2`, but it does define a subprogram.
+ ``Lib_1`` is similar to ``Lib_2``, but it does define a subprogram.
Its control fan-in coupling is 1 (because there is one unit
depending on it).
- When computing coupling metrics, *gnatmetric* counts only
- dependencies between units that are arguments of the *gnatmetric*
+ When computing coupling metrics, ``gnatmetric`` counts only
+ dependencies between units that are arguments of the ``gnatmetric``
invocation. Coupling metrics are program-wide (or project-wide) metrics, so
- you should invoke *gnatmetric* for
+ you should invoke ``gnatmetric`` for
the complete set of sources comprising your program. This can be done
- by invoking *gnatmetric* with the corresponding project file
- and with the *-U* option.
+ by invoking ``gnatmetric`` with the corresponding project file
+ and with the :switch:`-U` option.
By default, all the coupling metrics are disabled. You can use the following
switches to specify the coupling metrics to be computed and reported:
@@ -2632,65 +2639,65 @@ Alternatively, you may run the script using the following command line:
.. index:: --unit-coupling (gnatmetric)
.. index:: --control-coupling (gnatmetric)
- :samp:`--coupling-all`
+ :switch:`--coupling-all`
Report all the coupling metrics
- :samp:`--tagged-coupling-out`
+ :switch:`--tagged-coupling-out`
Report tagged (class) fan-out coupling
- :samp:`--tagged-coupling-in`
+ :switch:`--tagged-coupling-in`
Report tagged (class) fan-in coupling
- :samp:`--hierarchy-coupling-out`
+ :switch:`--hierarchy-coupling-out`
Report hierarchy (category) fan-out coupling
- :samp:`--hierarchy-coupling-in`
+ :switch:`--hierarchy-coupling-in`
Report hierarchy (category) fan-in coupling
- :samp:`--unit-coupling-out`
+ :switch:`--unit-coupling-out`
Report unit fan-out coupling
- :samp:`--unit-coupling-in`
+ :switch:`--unit-coupling-in`
Report unit fan-in coupling
- :samp:`--control-coupling-out`
+ :switch:`--control-coupling-out`
Report control fan-out coupling
- :samp:`--control-coupling-in`
+ :switch:`--control-coupling-in`
Report control fan-in coupling
.. _Other_gnatmetric_Switches:
- Other `gnatmetric` Switches
- ---------------------------
+ Other ``gnatmetric`` Switches
+ -----------------------------
- Additional *gnatmetric* switches are as follows:
+ Additional ``gnatmetric`` switches are as follows:
.. index:: --version (gnatmetric)
- :samp:`--version`
+ :switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatmetric)
- :samp:`--help`
+ :switch:`--help`
Display usage, then exit disregarding all other options.
.. index:: -P (gnatmetric)
- :samp:`-P {file}`
+ :switch:`-P {file}`
Indicates the name of the project file that describes the set of sources
to be processed. The exact set of argument sources depends on other options
specified, see below.
@@ -2698,94 +2705,93 @@ Alternatively, you may run the script using the following command line:
.. index:: -U (gnatmetric)
- :samp:`-U`
+ :switch:`-U`
If a project file is specified and no argument source is explicitly
- specified (either directly or by means of *-files* option), process
+ specified (either directly or by means of :switch:`-files` option), process
all the units of the closure of the argument project. Otherwise this option
has no effect.
- :samp:`-U {main_unit}`
+ :switch:`-U {main_unit}`
If a project file is specified and no argument source is explicitly
- specified (either directly or by means of *-files* option), process
- the closure of units rooted at `main_unit`. Otherwise this option
+ specified (either directly or by means of :switch:`-files` option), process
+ the closure of units rooted at ``main_unit``. Otherwise this option
has no effect.
.. index:: -X (gnatmetric)
- :samp:`-X{name}={value}`
- Indicates that external variable `name` in the argument project
- has the value `value`. Has no effect if no project is specified as
+ :switch:`-X{name}={value}`
+ Indicates that external variable ``name`` in the argument project
+ has the value ``value``. Has no effect if no project is specified as
tool argument.
.. index:: --RTS (gnatmetric)
- :samp:`--RTS={rts-path}`
+ :switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (see :ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (see :ref:`Switches_for_gnatmake`).
.. index:: --subdirs=dir (gnatmetric)
- :samp:`--subdirs={dir}`
+ :switch:`--subdirs={dir}`
Use the specified subdirectory of the project objects file (or of the
project file directory if the project does not specify an object directory)
for tool output files. Has no effect if no project is specified as
- tool argument r if *--no_objects_dir* is specified.
+ tool argument r if :switch:`--no_objects_dir` is specified.
.. index:: --no_objects_dir (gnatmetric)
- :samp:`--no_objects_dir`
+ :switch:`--no_objects_dir`
Place all the result files into the current directory instead of
- project objects directory. This corresponds to the *gnatcheck*
+ project objects directory. This corresponds to the ``gnatcheck``
behavior when it is called with the project file from the
GNAT driver. Has no effect if no project is specified.
.. index:: -files (gnatmetric)
- :samp:`-files {filename}`
- Take the argument source files from the specified file. This file should be an
- ordinary text file containing file names separated by spaces or
- line breaks. You can use this switch more than once in the same call to
- *gnatmetric*. You also can combine this switch with
- an explicit list of files.
+ :switch:`-files {filename}`
+ Take as arguments the files listed in text file ``file``.
+ Text file ``file`` may contain empty lines that are ignored.
+ Each nonempty line should contain the name of an existing file.
+ Several such switches may be specified simultaneously.
.. index:: -j (gnatmetric)
- :samp:`-j{n}`
- Use `n` processes to carry out the tree creations (internal representations
+ :switch:`-j{n}`
+ Use ``n`` processes to carry out the tree creations (internal representations
of the argument sources). On a multiprocessor machine this speeds up processing
- of big sets of argument sources. If `n` is 0, then the maximum number of
+ of big sets of argument sources. If ``n`` is 0, then the maximum number of
parallel tree creations is the number of core processors on the platform.
.. index:: -t (gnatmetric)
- :samp:`-t`
+ :switch:`-t`
Print out execution time.
.. index:: -v (gnatmetric)
- :samp:`-v`
+ :switch:`-v`
Verbose mode;
- *gnatmetric* generates version information and then
+ ``gnatmetric`` generates version information and then
a trace of sources being processed.
.. index:: -q (gnatmetric)
- :samp:`-q`
+ :switch:`-q`
Quiet mode.
If a project file is specified and no argument source is explicitly
- specified (either directly or by means of *-files* option), and no
- *-U* is specified, then the set of processed sources is
+ specified (either directly or by means of :switch:`-files` option), and no
+ :switch:`-U` is specified, then the set of processed sources is
all the immediate units of the argument project.
@@ -2793,25 +2799,25 @@ Alternatively, you may run the script using the following command line:
.. _The_GNAT_Pretty-Printer_gnatpp:
- The GNAT Pretty-Printer *gnatpp*
- ================================
+ The GNAT Pretty-Printer ``gnatpp``
+ ==================================
.. index:: ! gnatpp
.. index:: Pretty-Printer
- The *gnatpp* tool is an ASIS-based utility
+ The ``gnatpp`` tool is an ASIS-based utility
for source reformatting / pretty-printing.
It takes an Ada source file as input and generates a reformatted
version as output.
You can specify various style directives via switches; e.g.,
identifier case conventions, rules of indentation, and comment layout.
- *gnatpp* is a project-aware tool
+ ``gnatpp`` is a project-aware tool
(see :ref:`Using_Project_Files_with_GNAT_Tools` for a description of
the project-related switches). The project file package that can specify
- *gnatpp* switches is named ``Pretty_Printer``.
+ ``gnatpp`` switches is named ``Pretty_Printer``.
- To produce a reformatted file, *gnatpp* invokes the Ada
+ To produce a reformatted file, ``gnatpp`` invokes the Ada
compiler and generates and uses the ASIS tree for the input source;
thus the input must be legal Ada code, and the tool should have all the
information needed to compile the input source. To provide this information,
@@ -2819,42 +2825,42 @@ Alternatively, you may run the script using the following command line:
(or you may call *gnatpp*
through the *gnat* driver (see :ref:`The_GNAT_Driver_and_Project_Files`).
Another possibility is to specify the source search
- path and needed configuration files in ``-cargs`` section of *gnatpp*
- call, see the description of the *gnatpp* switches below.
+ path and needed configuration files in ``-cargs`` section of ``gnatpp``
+ call, see the description of the ``gnatpp`` switches below.
- *gnatpp* cannot process sources that contain preprocessing directives.
+ ``gnatpp`` cannot process sources that contain preprocessing directives.
- The *gnatpp* command has the form
+ The ``gnatpp`` command has the form
::
- $ gnatpp [`switches`] `filename` [-cargs `gcc_switches`]
+ $ gnatpp [ switches ] filename [ -cargs gcc_switches ]
where
- * `switches` is an optional sequence of switches defining such properties as
+ * ``switches`` is an optional sequence of switches defining such properties as
the formatting rules, the source search path, and the destination for the
output source file
- * `filename` is the name (including the extension) of the source file to
+ * ``filename`` is the name (including the extension) of the source file to
reformat; wildcards or several file names on the same gnatpp command are
allowed. The file name may contain path information; it does not have to
follow the GNAT file naming rules
- * `gcc_switches` is a list of switches for
- *gcc*. They will be passed on to all compiler invocations made by
- *gnatpp* to generate the ASIS trees. Here you can provide
+ * ``gcc_switches`` is a list of switches for
+ ``gcc``. They will be passed on to all compiler invocations made by
+ ``gnatpp`` to generate the ASIS trees. Here you can provide
``-I`` switches to form the source search path,
use the ``-gnatec`` switch to set the configuration file, etc.
.. _Switches_for_gnatpp:
- Switches for *gnatpp*
- ---------------------
+ Switches for ``gnatpp``
+ -----------------------
The following subsections describe the various switches accepted by
- *gnatpp*, organized by category.
+ ``gnatpp``, organized by category.
You specify a switch by supplying a name and generally also a value.
In many cases the values for a switch with a given name are incompatible with
@@ -2862,10 +2868,10 @@ Alternatively, you may run the script using the following command line:
(for example the switch that controls the casing of a reserved word may have
exactly one value: upper case, lower case, or
mixed case) and thus exactly one such switch can be in effect for an
- invocation of *gnatpp*.
+ invocation of ``gnatpp``.
If more than one is supplied, the last one is used.
However, some values for the same switch are mutually compatible.
- You may supply several such switches to *gnatpp*, but then
+ You may supply several such switches to ``gnatpp``, but then
each must be specified in full, with both the name and the value.
Abbreviated forms (the name appearing once, followed by each value) are
not permitted.
@@ -2891,11 +2897,11 @@ Alternatively, you may run the script using the following command line:
.. index:: -A1 (gnatpp)
- :samp:`-A0`
+ :switch:`-A0`
Set alignment to OFF
- :samp:`-A1`
+ :switch:`-A1`
Set alignment to ON
.. _Casing_Control:
@@ -2906,7 +2912,7 @@ Alternatively, you may run the script using the following command line:
.. index:: Casing control in gnatpp
- *gnatpp* allows you to specify the casing for reserved words,
+ ``gnatpp`` allows you to specify the casing for reserved words,
pragma names, attribute designators and identifiers.
For identifiers you may define a
general rule for name casing but also override this rule
@@ -2920,126 +2926,126 @@ Alternatively, you may run the script using the following command line:
.. index:: -a (gnatpp)
- :samp:`-aL`
+ :switch:`-aL`
Attribute designators are lower case
- :samp:`-aU`
+ :switch:`-aU`
Attribute designators are upper case
- :samp:`-aM`
+ :switch:`-aM`
Attribute designators are mixed case (this is the default)
.. index:: -k (gnatpp)
- :samp:`-kL`
+ :switch:`-kL`
Keywords (technically, these are known in Ada as *reserved words*) are
lower case (this is the default)
- :samp:`-kU`
+ :switch:`-kU`
Keywords are upper case
.. index:: -n (gnatpp)
- :samp:`-nD`
+ :switch:`-nD`
Name casing for defining occurrences are as they appear in the source file
(this is the default)
- :samp:`-nU`
+ :switch:`-nU`
Names are in upper case
- :samp:`-nL`
+ :switch:`-nL`
Names are in lower case
- :samp:`-nM`
+ :switch:`-nM`
Names are in mixed case
.. index:: -ne (gnatpp)
- :samp:`-neD`
+ :switch:`-neD`
Enumeration literal casing for defining occurrences are as they appear in the
source file. Overrides -n casing setting.
- :samp:`-neU`
+ :switch:`-neU`
Enumeration literals are in upper case. Overrides -n casing
setting.
- :samp:`-neL`
+ :switch:`-neL`
Enumeration literals are in lower case. Overrides -n casing
setting.
- :samp:`-neM`
+ :switch:`-neM`
Enumeration literals are in mixed case. Overrides -n casing
setting.
.. index:: -nt (gnatpp)
- :samp:`-ntD`
+ :switch:`-ntD`
Names introduced by type and subtype declarations are always
cased as they appear in the declaration in the source file.
Overrides -n casing setting.
- :samp:`-ntU`
+ :switch:`-ntU`
Names introduced by type and subtype declarations are always in
upper case. Overrides -n casing setting.
- :samp:`-ntL`
+ :switch:`-ntL`
Names introduced by type and subtype declarations are always in
lower case. Overrides -n casing setting.
- :samp:`-ntM`
+ :switch:`-ntM`
Names introduced by type and subtype declarations are always in
mixed case. Overrides -n casing setting.
- :samp:`-nnU`
+ :switch:`-nnU`
Names introduced by number declarations are always in
upper case. Overrides -n casing setting.
- :samp:`-nnL`
+ :switch:`-nnL`
Names introduced by number declarations are always in
lower case. Overrides -n casing setting.
- :samp:`-nnM`
+ :switch:`-nnM`
Names introduced by number declarations are always in
mixed case. Overrides -n casing setting.
.. index:: -p (gnatpp)
- :samp:`-pL`
+ :switch:`-pL`
Pragma names are lower case
- :samp:`-pU`
+ :switch:`-pU`
Pragma names are upper case
- :samp:`-pM`
+ :switch:`-pM`
Pragma names are mixed case (this is the default)
.. index:: -D (gnatpp)
- :samp:`-D{file}`
- Use `file` as a *dictionary file* that defines
+ :switch:`-D{file}`
+ Use ``file`` as a *dictionary file* that defines
the casing for a set of specified names,
thereby overriding the effect on these names by
any explicit or implicit
@@ -3047,14 +3053,14 @@ Alternatively, you may run the script using the following command line:
To supply more than one dictionary file,
use several ``-D`` switches.
- *gnatpp* implicitly uses a *default dictionary file*
+ ``gnatpp`` implicitly uses a *default dictionary file*
to define the casing for the Ada predefined names and
the names declared in the GNAT libraries.
.. index:: -D- (gnatpp)
- :samp:`-D-`
+ :switch:`-D-`
Do not use the default dictionary file;
instead, use the casing
defined by a ``-n`` switch and any explicit
@@ -3063,11 +3069,11 @@ Alternatively, you may run the script using the following command line:
The structure of a dictionary file, and details on the conventions
used in the default dictionary file, are defined in :ref:`Name_Casing`.
- The ``-D-`` and
- ``-D-``\ `file` switches are mutually
+ The :switch:`-D-` and
+ :switch:`-D{file}` switches are mutually
compatible.
- This group of *gnatpp* switches controls the layout of comments and
+ This group of ``gnatpp`` switches controls the layout of comments and
complex syntactic constructs. See :ref:`Formatting_Comments` for details
on their effect.
@@ -3075,79 +3081,79 @@ Alternatively, you may run the script using the following command line:
.. index:: -c (gnatpp)
- :samp:`-c0`
+ :switch:`-c0`
All comments remain unchanged.
- :samp:`-c1`
+ :switch:`-c1`
GNAT-style comment line indentation.
This is the default.
- :samp:`-c3`
+ :switch:`-c3`
GNAT-style comment beginning.
- :samp:`-c4`
+ :switch:`-c4`
Fill comment blocks.
- :samp:`-c5`
+ :switch:`-c5`
Keep unchanged special form comments.
This is the default.
.. index:: --comments-only (gnatpp)
- :samp:`--comments-only`
+ :switch:`--comments-only`
Format just the comments.
.. index:: --no-end-id (gnatpp)
- :samp:`--no-end-id`
- Do not insert the name of a unit after `end`; leave whatever comes
- after `end`, if anything, alone.
+ :switch:`--no-end-id`
+ Do not insert the name of a unit after ``end``; leave whatever comes
+ after ``end``, if anything, alone.
.. index:: --no-separate-is (gnatpp)
- :samp:`--no-separate-is`
- Do not place the keyword `is` on a separate line in a subprogram body in
+ :switch:`--no-separate-is`
+ Do not place the keyword ``is`` on a separate line in a subprogram body in
case if the spec occupies more than one line.
.. index:: --separate-loop-then (gnatpp)
- :samp:`--separate-loop-then`
- Place the keyword `loop` in FOR and WHILE loop statements and the
- keyword `then` in IF statements on a separate line.
+ :switch:`--separate-loop-then`
+ Place the keyword ``loop`` in FOR and WHILE loop statements and the
+ keyword ``then`` in IF statements on a separate line.
.. index:: --no-separate-loop-then (gnatpp)
- :samp:`--no-separate-loop-then`
- Do not place the keyword `loop` in FOR and WHILE loop statements and the
- keyword `then` in IF statements on a separate line. This option is
- incompatible with ``--separate-loop-then`` option.
+ :switch:`--no-separate-loop-then`
+ Do not place the keyword ``loop`` in FOR and WHILE loop statements and the
+ keyword ``then`` in IF statements on a separate line. This option is
+ incompatible with the :switch:`--separate-loop-then` option.
.. index:: --use-on-new-line (gnatpp)
- :samp:`--use-on-new-line`
+ :switch:`--use-on-new-line`
Start each USE clause in a context clause from a separate line.
.. index:: --insert-blank-lines (gnatpp)
- :samp:`--insert-blank-lines`
+ :switch:`--insert-blank-lines`
Insert blank lines where appropriate (between bodies and other large
constructs).
.. index:: --preserve-blank-lines (gnatpp)
- :samp:`--preserve-blank-lines`
+ :switch:`--preserve-blank-lines`
Preserve blank lines in the input. By default, gnatpp will squeeze
multiple blank lines down to one.
@@ -3166,21 +3172,21 @@ Alternatively, you may run the script using the following command line:
.. index:: -M (gnatpp)
- :samp:`-M{nnn}`
- Maximum line length, `nnn` from 32...256, the default value is 79
+ :switch:`-M{nnn}`
+ Maximum line length, ``nnn`` from 32...256, the default value is 79
.. index:: -i (gnatpp)
- :samp:`-i{nnn}`
- Indentation level, `nnn` from 1...9, the default value is 3
+ :switch:`-i{nnn}`
+ Indentation level, ``nnn`` from 1...9, the default value is 3
.. index:: -cl (gnatpp)
- :samp:`-cl{nnn}`
+ :switch:`-cl{nnn}`
Indentation level for continuation lines (relative to the line being
- continued), `nnn` from 1...9.
+ continued), ``nnn`` from 1...9.
The default
value is one less than the (normal) indentation level, unless the
indentation is set to 1 (in which case the default value for continuation
@@ -3196,25 +3202,25 @@ Alternatively, you may run the script using the following command line:
.. index:: --decimal-grouping (gnatpp)
- :samp:`--decimal-grouping={n}`
+ :switch:`--decimal-grouping={n}`
Put underscores in decimal literals (numeric literals without a base)
- every `n` characters. If a literal already has one or more
+ every ``n`` characters. If a literal already has one or more
underscores, it is not modified. For example, with
- `--decimal-grouping=3`, `1000000` will be changed to
- `1_000_000`.
+ ``--decimal-grouping=3``, ``1000000`` will be changed to
+ ``1_000_000``.
.. index:: --based-grouping (gnatpp)
- :samp:`--based-grouping={n}`
- Same as `--decimal-grouping`, but for based literals. For
- example, with `--based-grouping=4`, `16#0001FFFE#` will be
- changed to `16#0001_FFFE#`.
+ :switch:`--based-grouping={n}`
+ Same as ``--decimal-grouping``, but for based literals. For
+ example, with ``--based-grouping=4``, ``16#0001FFFE#`` will be
+ changed to ``16#0001_FFFE#``.
.. index:: --split-line-before-op (gnatpp)
- :samp:`--split-line-before-op`
+ :switch:`--split-line-before-op`
If it is necessary to split a line at a binary operator, by default
the line is split after the operator. With this option, it is split
before the operator.
@@ -3222,33 +3228,33 @@ Alternatively, you may run the script using the following command line:
.. index:: --RM-style-spacing (gnatpp)
- :samp:`--RM-style-spacing`
+ :switch:`--RM-style-spacing`
Do not insert an extra blank before various occurrences of
'(' and ':'. This also turns off alignment.
.. index:: -ff (gnatpp)
- :samp:`-ff`
+ :switch:`-ff`
Insert a Form Feed character after a pragma Page.
.. index:: --call_threshold (gnatpp)
- :samp:`--call_threshold={nnn}`
- If the number of parameter associations is greater than `nnn` and if at
+ :switch:`--call_threshold={nnn}`
+ If the number of parameter associations is greater than ``nnn`` and if at
least one association uses named notation, start each association from
- a new line. If `nnn` is 0, no check for the number of associations
+ a new line. If ``nnn`` is 0, no check for the number of associations
is made; this is the default.
.. index:: --par_threshold (gnatpp)
- :samp:`--par_threshold={nnn}`
- If the number of parameter specifications is greater than `nnn`
- (or equal to `nnn` in case of a function), start each specification from
- a new line. If `nnn` is 0, and `--no-separate-is` was not specified, then
- the "is" is placed on a separate line. This feature is disabled by default.
+ :switch:`--par_threshold={nnn}`
+ If the number of parameter specifications is greater than ``nnn``
+ (or equal to ``nnn`` in case of a function), start each specification from
+ a new line. If ``nnn`` is 0, and :switch:`--no-separate-is` was not specified, then
+ the ``is`` is placed on a separate line. This feature is disabled by default.
.. _Setting_the_Source_Search_Path:
@@ -3256,21 +3262,21 @@ Alternatively, you may run the script using the following command line:
Setting the Source Search Path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- To define the search path for the input source file, *gnatpp*
+ To define the search path for the input source file, ``gnatpp``
uses the same switches as the GNAT compiler, with the same effects:
.. index:: -I (gnatpp)
- :samp:`-I{dir}`
+ :switch:`-I{dir}`
.. index:: -I- (gnatpp)
- :samp:`-I-`
+ :switch:`-I-`
.. index:: -gnatec (gnatpp)
- :samp:`-gnatec={path}`
+ :switch:`-gnatec={path}`
.. _Output_File_Control-gnatpp:
@@ -3282,14 +3288,14 @@ Alternatively, you may run the script using the following command line:
the :file:`.pp` suffix to the name of the input file.
If the file with this name already exists, it is overwritten.
Thus if the input file is :file:`my_ada_proc.adb` then
- *gnatpp* will produce :file:`my_ada_proc.adb.pp`
+ ``gnatpp`` will produce :file:`my_ada_proc.adb.pp`
as output file.
The output may be redirected by the following switches:
.. index:: --output-dir (gnatpp)
- :samp:`--output-dir={dir}`
+ :switch:`--output-dir={dir}`
Generate output file in directory :file:`dir` with the same name as the input
file. If :file:`dir` is the same as the directory containing the input file,
the input file is not processed; use ``-rnb``
@@ -3298,53 +3304,53 @@ Alternatively, you may run the script using the following command line:
.. index:: -pipe (gnatpp)
- :samp:`-pipe`
- Send the output to `Standard_Output`
+ :switch:`-pipe`
+ Send the output to ``Standard_Output``
.. index:: -o (gnatpp)
- :samp:`-o {output_file}`
- Write the output into `output_file`.
- If `output_file` already exists, *gnatpp* terminates without
+ :switch:`-o {output_file}`
+ Write the output into ``output_file``.
+ If ``output_file`` already exists, ``gnatpp`` terminates without
reading or processing the input file.
.. index:: -of (gnatpp)
- :samp:`-of {output_file}`
- Write the output into `output_file`, overwriting the existing file
+ :switch:`-of {output_file}`
+ Write the output into ``output_file``, overwriting the existing file
(if one is present).
.. index:: -r (gnatpp)
- :samp:`-r`
+ :switch:`-r`
Replace the input source file with the reformatted output, and copy the
original input source into the file whose name is obtained by appending the
:file:`.npp` suffix to the name of the input file.
- If a file with this name already exists, *gnatpp* terminates without
+ If a file with this name already exists, ``gnatpp`` terminates without
reading or processing the input file.
.. index:: -rf (gnatpp)
- :samp:`-rf`
+ :switch:`-rf`
Like ``-r`` except that if the file with the specified name
already exists, it is overwritten.
.. index:: -rnb (gnatpp)
- :samp:`-rnb`
+ :switch:`-rnb`
Replace the input source file with the reformatted output without
creating any backup copy of the input source.
.. index:: --eol (gnatpp)
- :samp:`--eol={xxx}`
- Specifies the line-ending style of the reformatted output file. The `xxx`
+ :switch:`--eol={xxx}`
+ Specifies the line-ending style of the reformatted output file. The ``xxx``
string specified with the switch may be:
* *dos* - MS DOS style, lines end with CR LF characters*
@@ -3354,9 +3360,9 @@ Alternatively, you may run the script using the following command line:
.. index:: -W (gnatpp)
- :samp:`-W{e}`
+ :switch:`-W{e}`
Specify the wide character encoding method for the input and output files.
- `e` is one of the following:
+ ``e`` is one of the following:
* *h* - Hex encoding
@@ -3379,27 +3385,27 @@ Alternatively, you may run the script using the following command line:
.. _Other_gnatpp_Switches:
- Other `gnatpp` Switches
- ^^^^^^^^^^^^^^^^^^^^^^^
+ Other ``gnatpp`` Switches
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
- The additional *gnatpp* switches are defined in this subsection.
+ The additional ``gnatpp`` switches are defined in this subsection.
.. index:: --version (gnatpp)
- :samp:`--version`
+ :switch:`--version`
Display copyright and version, then exit disregarding all other options.
.. index:: --help (gnatpp)
- :samp:`--help`
+ :switch:`--help`
Display usage, then exit disregarding all other options.
.. index:: -P (gnatpp)
- :samp:`-P {file}`
+ :switch:`-P {file}`
Indicates the name of the project file that describes the set of sources
to be processed. The exact set of argument sources depends on other options
specified; see below.
@@ -3407,38 +3413,38 @@ Alternatively, you may run the script using the following command line:
.. index:: -U (gnatpp)
- :samp:`-U`
+ :switch:`-U`
If a project file is specified and no argument source is explicitly
specified (either directly or by means of ``-files`` option), process
all the units of the closure of the argument project. Otherwise this option
has no effect.
- :samp:`-U {main_unit}`
+ :switch:`-U {main_unit}`
If a project file is specified and no argument source is explicitly
specified (either directly or by means of ``-files`` option), process
- the closure of units rooted at `main_unit`. Otherwise this option
+ the closure of units rooted at ``main_unit``. Otherwise this option
has no effect.
.. index:: -X (gnatpp)
- :samp:`-X{name}={value}`
- Indicates that external variable `name` in the argument project
- has the value `value`. Has no effect if no project is specified as
+ :switch:`-X{name}={value}`
+ Indicates that external variable ``name`` in the argument project
+ has the value ``value``. Has no effect if no project is specified as
tool argument.
.. index:: --RTS (gnatpp)
- :samp:`--RTS={rts-path}`
+ :switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`).
.. index:: --incremental (gnatpp)
- :samp:`--incremental`
+ :switch:`--incremental`
Incremental processing on a per-file basis. Source files are only
processed if they have been modified, or if files they depend on have
been modified. This is similar to the way gnatmake/gprbuild only
@@ -3449,62 +3455,61 @@ Alternatively, you may run the script using the following command line:
.. index:: --pp-off (gnatpp)
- :samp:`--pp-off={xxx}`
- Use `--xxx` as the command to turn off pretty printing, instead
- of the default `--!pp off`.
+ :switch:`--pp-off={xxx}`
+ Use :switch:`--xxx` as the command to turn off pretty printing, instead
+ of the default ``--!pp off``.
.. index:: --pp-on (gnatpp)
- :samp:`--pp-on={xxx}`
- Use `--xxx` as the command to turn pretty printing back on, instead
- of the default `--!pp on`.
+ :switch:`--pp-on={xxx}`
+ Use :switch:`--xxx` as the command to turn pretty printing back on, instead
+ of the default ``--!pp on``.
.. index:: -files (gnatpp)
- :samp:`-files {filename}`
- Take the argument source files from the specified file. This file should be an
- ordinary text file containing file names separated by spaces or
- line breaks. You can use this switch more than once in the same call to
- *gnatpp*. You also can combine this switch with an explicit list of
- files.
+ :switch:`-files {filename}`
+ Take as arguments the files listed in text file ``file``.
+ Text file ``file`` may contain empty lines that are ignored.
+ Each nonempty line should contain the name of an existing file.
+ Several such switches may be specified simultaneously.
.. index:: -j (gnatpp)
- :samp:`-j{n}`
- Without ``--incremental``, use `n` processes to carry out the
+ :switch:`-j{n}`
+ Without ``--incremental``, use *n* processes to carry out the
tree creations (internal representations of the argument sources). On
a multiprocessor machine this speeds up processing of big sets of
- argument sources. If `n` is 0, then the maximum number of parallel
+ argument sources. If *n* is 0, then the maximum number of parallel
tree creations is the number of core processors on the platform. This
- option cannot be used together with ``-r``,
- ``-rf`` or
- ``-rnb`` option.
+ option cannot be used together with the :switch:`-r`,
+ :switch:`-rf` or
+ :switch:`-rnb` options.
- With ``--incremental``, use `n` *gnatpp* processes to
- perform pretty-printing in parallel. `n` = 0 means the same as
- above. In this case, ``-r``,
- ``-rf`` or
- ``-rnb`` options are allowed.
+ With ``--incremental``, use *n* ``gnatpp`` processes to
+ perform pretty-printing in parallel. *n* = 0 means the same as
+ above. In this case, the :switch:`-r`,
+ :switch:`-rf` and
+ :switch:`-rnb` options are allowed.
.. index:: -t (gnatpp)
- :samp:`-t`
+ :switch:`-t`
Print out execution time.
.. index:: -v (gnatpp)
- :samp:`-v`
+ :switch:`-v`
Verbose mode
.. index:: -q (gnatpp)
- :samp:`-q`
+ :switch:`-q`
Quiet mode
If a project file is specified and no argument source is explicitly
@@ -3518,7 +3523,7 @@ Alternatively, you may run the script using the following command line:
Formatting Rules
----------------
- The following subsections show how *gnatpp* treats white space,
+ The following subsections show how ``gnatpp`` treats white space,
comments, program layout, and name casing.
They provide detailed descriptions of the switches shown above.
@@ -3572,7 +3577,7 @@ Alternatively, you may run the script using the following command line:
White Space and Empty Lines
^^^^^^^^^^^^^^^^^^^^^^^^^^^
- *gnatpp* does not have an option to control space characters.
+ ``gnatpp`` does not have an option to control space characters.
It will add or remove spaces according to the style illustrated by the
examples in the :title:`Ada Reference Manual`.
The output file will contain no lines with trailing white space.
@@ -3610,7 +3615,7 @@ Alternatively, you may run the script using the following command line:
turns off comment formatting.
Special-form comments such as SPARK-style ``--#...`` are left alone.
- For an end-of-line comment, *gnatpp* tries to leave the same
+ For an end-of-line comment, ``gnatpp`` tries to leave the same
number of spaces between the end of the preceding Ada code and the
beginning of the comment as appear in the original source.
@@ -3619,7 +3624,7 @@ Alternatively, you may run the script using the following command line:
effect:
* For each whole-line comment that does not end with two hyphens,
- *gnatpp* inserts spaces if necessary after the starting two hyphens
+ ``gnatpp`` inserts spaces if necessary after the starting two hyphens
to ensure that there are at least two spaces between these hyphens and the
first non-blank character of the comment.
@@ -3635,7 +3640,7 @@ Alternatively, you may run the script using the following command line:
``--comments-only -c4`` means to fill comment paragraphs, and do nothing else.
Likewise,
``--comments-only -c3`` ensures comments start with at least two
- spaces after `--`, and ``--comments-only -c3 -c4`` does
+ spaces after ``--``, and ``--comments-only -c3 -c4`` does
both. If ``--comments-only`` is given without ``-c3`` or
``-c4``, then gnatpp doesn't format anything.
@@ -3645,7 +3650,7 @@ Alternatively, you may run the script using the following command line:
Name Casing
^^^^^^^^^^^
- *gnatpp* always converts the usage occurrence of a (simple) name to
+ ``gnatpp`` always converts the usage occurrence of a (simple) name to
the same casing as the corresponding defining identifier.
You control the casing for defining occurrences via the
@@ -3659,29 +3664,29 @@ Alternatively, you may run the script using the following command line:
``-nM`` --
result in
upper, lower, or mixed case, respectively.
- If *gnatpp* changes the casing of a defining
+ If ``gnatpp`` changes the casing of a defining
occurrence, it analogously changes the casing of all the
usage occurrences of this name.
If the defining occurrence of a name is not in the source compilation unit
- currently being processed by *gnatpp*, the casing of each reference to
+ currently being processed by ``gnatpp``, the casing of each reference to
this name is changed according to the value of the ``-n``
switch (subject to the dictionary file mechanism described below).
- Thus *gnatpp* acts as though the ``-n`` switch
+ Thus ``gnatpp`` acts as though the ``-n`` switch
had affected the
casing for the defining occurrence of the name.
The options
- :samp:`-a{x}`,
- :samp:`-k{x}`,
- :samp:`-ne{x}`,
- :samp:`-nt{x}`,
- :samp:`-nn{x}`, and
- :samp:`-p{x}`
+ :switch:`-a{x}`,
+ :switch:`-k{x}`,
+ :switch:`-ne{x}`,
+ :switch:`-nt{x}`,
+ :switch:`-nn{x}`, and
+ :switch:`-p{x}`
allow finer-grained control over casing for
attributes, keywords, enumeration literals,
types, named numbers and pragmas, respectively.
- :samp:`-nt{x}` covers subtypes and
+ :switch:`-nt{x}` covers subtypes and
task and protected bodies as well.
Some names may need to be spelled with casing conventions that are not
@@ -3693,7 +3698,7 @@ Alternatively, you may run the script using the following command line:
any ``-n`` switch.
To handle the casing of Ada predefined names and the names from GNAT libraries,
- *gnatpp* assumes a default dictionary file.
+ ``gnatpp`` assumes a default dictionary file.
The name of each predefined entity is spelled with the same casing as is used
for the entity in the :title:`Ada Reference Manual` (usually mixed case).
The name of each entity in the GNAT libraries is spelled with the same casing
@@ -3703,8 +3708,8 @@ Alternatively, you may run the script using the following command line:
the default dictionary file. Instead, the casing for predefined and
GNAT-defined names will be established by the
``-n`` switch or explicit dictionary files. For
- example, by default the names `Ada.Text_IO` and
- `GNAT.OS_Lib` will appear as just shown, even in the presence of
+ example, by default the names ``Ada.Text_IO`` and
+ ``GNAT.OS_Lib`` will appear as just shown, even in the presence of
a ``-nU`` switch. To ensure that even
such names are rendered in uppercase, additionally supply the
-D- switch (or else place these names
@@ -3718,43 +3723,43 @@ Alternatively, you may run the script using the following command line:
::
- `casing_schema` ::= `identifier` | `simple_identifier`
+ casing_schema ::= identifier | simple_identifier
- `simple_identifier` ::= `letter`{`letter_or_digit`}
+ simple_identifier ::= letter{letter_or_digit}
(See :title:`Ada Reference Manual`, Section 2.3) for the definition of the
- `identifier` lexical element and the `letter_or_digit` category.)
+ ``identifier`` lexical element and the ``letter_or_digit`` category.)
The casing schema string can be followed by white space and/or an Ada-style
comment; any amount of white space is allowed before the string.
If a dictionary file is passed as
- the value of a :samp:`-D{file}` switch
+ the value of a :switch:`-D{file}` switch
then for every
- simple name and every identifier, *gnatpp* checks if the dictionary
+ simple name and every identifier, ``gnatpp`` checks if the dictionary
defines the casing for the name or for some of its parts (the term 'subword'
is used below to denote the part of a name which is delimited by '_' or by
the beginning or end of the word and which does not contain any '_' inside):
- * if the whole name is in the dictionary, *gnatpp* uses for this name
+ * if the whole name is in the dictionary, ``gnatpp`` uses for this name
the casing defined by the dictionary; no subwords are checked for this word
- * for every subword *gnatpp* checks if the dictionary contains the
- corresponding string of the form `*`simple_identifier`*`,
- and if it does, the casing of this `simple_identifier` is used
+ * for every subword ``gnatpp`` checks if the dictionary contains the
+ corresponding string of the form ``simple_identifier``,
+ and if it does, the casing of this ``simple_identifier`` is used
for this subword
* if the whole name does not contain any '_' inside, and if for this name
- the dictionary contains two entries - one of the form `identifier`,
- and another - of the form *`simple_identifier`*, then the first one
+ the dictionary contains two entries -- one of the form ``identifier``,
+ and another of the form ``simple_identifier`` -- then the first one
is applied to define the casing of this name
- * if more than one dictionary file is passed as *gnatpp* switches, each
+ * if more than one dictionary file is passed as ``gnatpp`` switches, each
dictionary adds new casing exceptions and overrides all the existing casing
exceptions set by the previous dictionaries
- * when *gnatpp* checks if the word or subword is in the dictionary,
+ * when ``gnatpp`` checks if the word or subword is in the dictionary,
this check is not case sensitive
For example, suppose we have the following source to reformat:
@@ -3782,13 +3787,13 @@ Alternatively, you may run the script using the following command line:
*dict2:*
*NAME3*
- If *gnatpp* is called with the following switches:
+ If ``gnatpp`` is called with the following switches:
::
$ gnatpp -nM -D dict1 -D dict2 test.adb
- then we will get the following name casing in the *gnatpp* output:
+ then we will get the following name casing in the ``gnatpp`` output:
.. code-block:: ada
@@ -3812,20 +3817,20 @@ Alternatively, you may run the script using the following command line:
.. index:: ! gnatstub
- *gnatstub* creates empty but compilable bodies
+ ``gnatstub`` creates empty but compilable bodies
for library unit declarations, and empty but compilable
subunit for body stubs.
- *gnatstub* is a project-aware tool.
+ ``gnatstub`` is a project-aware tool.
(See :ref:`Using_Project_Files_with_GNAT_Tools` for a description of
- the project-related switches but note that *gnatstub* does not support
- the :samp:`-U`, :samp:`-U {main_unit}`, :samp:`--subdirs={dir}`, or
- :samp:`--no_objects_dir` switches.)
+ the project-related switches but note that ``gnatstub`` does not support
+ the :switch:`-U`, :switch:`-U {main_unit}`, :switch:`--subdirs={dir}`, or
+ :switch:`--no_objects_dir` switches.)
The project file package that can specify
- *gnatstub* switches is named ``gnatstub``.
+ ``gnatstub`` switches is named ``gnatstub``.
- To create a body or a subunit, *gnatstub* invokes the Ada
+ To create a body or a subunit, ``gnatstub`` invokes the Ada
compiler and generates and uses the ASIS tree for the input source;
thus the input must be legal Ada code, and the tool should have all the
information needed to compile the input source. To provide this information,
@@ -3833,29 +3838,29 @@ Alternatively, you may run the script using the following command line:
(or you may call *gnatstub*
through the *gnat* driver (see :ref:`The_GNAT_Driver_and_Project_Files`).
Another possibility is to specify the source search
- path and needed configuration files in ``-cargs`` section of *gnatstub*
- call, see the description of the *gnatstub* switches below.
+ path and needed configuration files in ``-cargs`` section of ``gnatstub``
+ call, see the description of the ``gnatstub`` switches below.
- If the *gnatstub* argument source contains preprocessing directives
+ If the ``gnatstub`` argument source contains preprocessing directives
then the needed options should be provided to run preprocessor as a part of
- the *gnatstub* call, and the generated body stub will correspond to
+ the ``gnatstub`` call, and the generated body stub will correspond to
the preprocessed source.
- By default, all the program unit bodies generated by `gnatstub`
- raise the predefined `Program_Error` exception, which will catch
+ By default, all the program unit bodies generated by ``gnatstub``
+ raise the predefined ``Program_Error`` exception, which will catch
accidental calls of generated stubs. This behavior can be changed with
option ``--no-exception`` (see below).
.. _Running_gnatstub:
- Running *gnatstub*
- ------------------
+ Running ``gnatstub``
+ --------------------
- *gnatstub* invocation has the following form:
+ ``gnatstub`` invocation has the following form:
::
- $ gnatstub [`switches`] `filename` [-cargs `gcc_switches`]
+ $ gnatstub [ switches ] filename [ -cargs gcc_switches ]
where
@@ -3868,10 +3873,10 @@ Alternatively, you may run the script using the following command line:
of seitches does not contain a project file that defines naming
conventions, the name of the body file must
be provided
- explicitly as the value of the :samp:`-o{body-name}` option.
+ explicitly as the value of the :switch:`-o{body-name}` option.
If the file name follows the GNAT file naming
conventions and the name of the body file is not provided,
- *gnatstub*
+ ``gnatstub``
takes the naming conventions for the generated source from the
project file provided as a parameter of ``-P`` switch if any,
or creates the name file to generate using the standard GNAT
@@ -3879,7 +3884,7 @@ Alternatively, you may run the script using the following command line:
* *gcc_switches* is a list of switches for *gcc*.
They will be passed on to all compiler invocations made by
- *gnatstub* to generate the ASIS trees. Here you can provide
+ ``gnatstub`` to generate the ASIS trees. Here you can provide
``-I`` switches to form the source search path,
use the ``-gnatec`` switch to set the configuration file,
use the ``-gnat05`` switch if sources should be compiled in
@@ -3891,56 +3896,56 @@ Alternatively, you may run the script using the following command line:
.. _Switches_for_gnatstub:
- Switches for *gnatstub*
- -----------------------
+ Switches for ``gnatstub``
+ -------------------------
.. index:: --version (gnatstub)
- :samp:`--version`
+ :switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatstub)
- :samp:`--help`
+ :switch:`--help`
Display usage, then exit disregarding all other options.
.. index:: -P (gnatstub)
- :samp:`-P {file}`
+ :switch:`-P {file}`
Indicates the name of the project file that describes the set of sources
to be processed.
.. index:: -X (gnatstub)
- :samp:`-X{name}={value}`
- Indicates that external variable `name` in the argument project
- has the value `value`. Has no effect if no project is specified as
+ :switch:`-X{name}={value}`
+ Indicates that external variable ``name`` in the argument project
+ has the value ``value``. Has no effect if no project is specified as
tool argument.
.. index:: --RTS (gnatstub)
- :samp:`--RTS={rts-path}`
+ :switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`).
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`).
.. index:: --subunits (gnatstub)
- :samp:`--subunits`
+ :switch:`--subunits`
Generate subunits for body stubs. If this switch is specified,
- *gnatstub* expects a library unit body as an agrument file,
+ ``gnatstub`` expects a library unit body as an agrument file,
otherwise a library unit declaration is expected. If a body stub
- already has a corresponding subunit, *gnatstub* does not
+ already has a corresponding subunit, ``gnatstub`` does not
generate anything for it.
.. index:: -f (gnatstub)
- :samp:`-f`
+ :switch:`-f`
If the destination directory already contains a file with the name of the
body file
for the argument spec file, replace it with the generated body stub.
@@ -3949,7 +3954,7 @@ Alternatively, you may run the script using the following command line:
.. index:: -hs (gnatstub)
- :samp:`-hs`
+ :switch:`-hs`
Put the comment header (i.e., all the comments preceding the
compilation unit) from the source of the library unit declaration
into the body stub.
@@ -3957,40 +3962,40 @@ Alternatively, you may run the script using the following command line:
.. index:: -hg (gnatstub)
- :samp:`-hg`
+ :switch:`-hg`
Put a sample comment header into the body stub.
.. index:: --header-file (gnatstub)
- :samp:`--header-file={filename}`
+ :switch:`--header-file={filename}`
Use the content of the file as the comment header for a generated body stub.
.. index:: -IDIR (gnatstub)
.. index:: -I- (gnatstub)
- :samp:`-I{DIR}`, :samp:`-I-`
+ :switch:`-I{DIR}`, :switch:`-I-`
These switches have the same meaning as in calls to
- *gcc*.
+ ``gcc``.
They define the source search path in the call to
- *gcc* issued
- by *gnatstub* to compile an argument source file.
+ ``gcc`` issued
+ by ``gnatstub`` to compile an argument source file.
.. index:: -gnatec (gnatstub)
- :samp:`-gnatec{PATH}`
- This switch has the same meaning as in calls to *gcc*.
+ :switch:`-gnatec{PATH}`
+ This switch has the same meaning as in calls to ``gcc``.
It defines the additional configuration file to be passed to the call to
- *gcc* issued
- by *gnatstub* to compile an argument source file.
+ ``gcc`` issued
+ by ``gnatstub`` to compile an argument source file.
.. index:: -gnatyM (gnatstub)
- :samp:`-gnatyM{n}`
- (`n` is a non-negative integer). Set the maximum line length that is
+ :switch:`-gnatyM{n}`
+ (``n`` is a non-negative integer). Set the maximum line length that is
allowed in a source file. The default is 79. The maximum value that can be
specified is 32767. Note that in the special case of configuration
pragma files, the maximum is always 32767 regardless of whether or
@@ -3999,55 +4004,55 @@ Alternatively, you may run the script using the following command line:
.. index:: -gnaty (gnatstub)
- :samp:`-gnaty{n}`
- (`n` is a non-negative integer from 1 to 9). Set the indentation level in
- the generated body sample to `n`.
+ :switch:`-gnaty{n}`
+ (``n`` is a non-negative integer from 1 to 9). Set the indentation level in
+ the generated body sample to ``n``.
The default indentation is 3.
.. index:: -gnatyo (gnatstub)
- :samp:`-gnatyo`
+ :switch:`-gnatyo`
Order local bodies alphabetically. (By default local bodies are ordered
in the same way as the corresponding local specs in the argument spec file.)
.. index:: -i (gnatstub)
- :samp:`-i{n}`
- Same as :samp:`-gnaty{n}``
+ :switch:`-i{n}`
+ Same as :switch:`-gnaty{n}``
.. index:: -k (gnatstub)
- :samp:`-k`
+ :switch:`-k`
Do not remove the tree file (i.e., the snapshot of the compiler internal
- structures used by *gnatstub*) after creating the body stub.
+ structures used by ``gnatstub``) after creating the body stub.
.. index:: -l (gnatstub)
- :samp:`-l{n}`
+ :switch:`-l{n}`
Same as ``-gnatyM`n```
.. index:: --no-exception (gnatstub)
- :samp:`--no-exception`
+ :switch:`--no-exception`
Avoid raising PROGRAM_ERROR in the generated bodies of program unit stubs.
This is not always possible for function stubs.
.. index:: --no-local-header (gnatstub)
- :samp:`--no-local-header`
+ :switch:`--no-local-header`
Do not place local comment header with unit name before body stub for a
unit.
.. index:: -o (gnatstub)
- :samp:`-o {body-name}`
+ :switch:`-o {body-name}`
Body file name. This should be set if the argument file name does not
follow
the GNAT file naming
@@ -4058,7 +4063,7 @@ Alternatively, you may run the script using the following command line:
.. index:: --dir (gnatstub)
- :samp:`--dir={dir-name}`
+ :switch:`--dir={dir-name}`
The path to the directory to place the generated files into.
If this switch is not set, the generated library unit body is
placed in the current directory, and generated sununits -
@@ -4067,9 +4072,9 @@ Alternatively, you may run the script using the following command line:
.. index:: -W (gnatstub)
- :samp:`-W{e}`
+ :switch:`-W{e}`
Specify the wide character encoding method for the output body file.
- `e` is one of the following:
+ ``e`` is one of the following:
==== ==================================
*h* Hex encoding
@@ -4083,7 +4088,7 @@ Alternatively, you may run the script using the following command line:
.. index:: -q (gnatstub)
- :samp:`-q`
+ :switch:`-q`
Quiet mode: do not generate a confirmation when a body is
successfully created, and do not generate a message when a body is not
required for an
@@ -4092,9 +4097,9 @@ Alternatively, you may run the script using the following command line:
.. index:: -r (gnatstub)
- :samp:`-r`
+ :switch:`-r`
Reuse the tree file (if it exists) instead of creating it. Instead of
- creating the tree file for the library unit declaration, *gnatstub*
+ creating the tree file for the library unit declaration, ``gnatstub``
tries to find it in the current directory and use it for creating
a body. If the tree file is not found, no body is created. This option
also implies ``-k``, whether or not
@@ -4103,18 +4108,18 @@ Alternatively, you may run the script using the following command line:
.. index:: -t (gnatstub)
- :samp:`-t`
+ :switch:`-t`
Overwrite the existing tree file. If the current directory already
contains the file which, according to the GNAT file naming rules should
be considered as a tree file for the argument source file,
- *gnatstub*
+ ``gnatstub``
will refuse to create the tree file needed to create a sample body
unless this option is set.
.. index:: -v (gnatstub)
- :samp:`-v`
+ :switch:`-v`
Verbose mode: generate version information.
@@ -4123,23 +4128,23 @@ Alternatively, you may run the script using the following command line:
.. _The_Unit_Test_Generator_gnattest:
- The Unit Test Generator *gnattest*
- ==================================
+ The Unit Test Generator ``gnattest``
+ ====================================
.. index:: ! gnattest
- *gnattest* is an ASIS-based utility that creates unit-test skeletons
- as well as a test driver infrastructure (harness). *gnattest* creates
+ ``gnattest`` is an ASIS-based utility that creates unit-test skeletons
+ as well as a test driver infrastructure (harness). ``gnattest`` creates
a skeleton for each visible subprogram in the packages under consideration when
they do not exist already.
- *gnattest* is a project-aware tool.
+ ``gnattest`` is a project-aware tool.
(See :ref:`Using_Project_Files_with_GNAT_Tools` for a description of
- the project-related switches but note that *gnattest* does not support
- the :samp:`-U`, :samp:`-eL`, :samp:`--subdirs={dir}`, or
- :samp:`--no_objects_dir` switches.)
+ the project-related switches but note that ``gnattest`` does not support
+ the :switch:`-U`, :switch:`-eL`, :switch:`--subdirs={dir}`, or
+ :switch:`--no_objects_dir` switches.)
The project file package that can specify
- *gnattest* switches is named ``gnattest``.
+ ``gnattest`` switches is named ``gnattest``.
The user can choose to generate a single test driver
that will run all individual tests, or separate test drivers for each test. The
@@ -4147,13 +4152,13 @@ Alternatively, you may run the script using the following command line:
allows to benefit from parallel tests execution to increase performance, and
provides stubbing support.
- *gnattest* also has a mode of operation where it acts as the test
+ ``gnattest`` also has a mode of operation where it acts as the test
aggregator when multiple test executables must be run, in particular when
the separate test drivers were generated. In this mode it handles individual
tests execution and upon completion reports the summary results of the test
run.
- In order to process source files from a project, *gnattest* has to
+ In order to process source files from a project, ``gnattest`` has to
semantically analyze the sources. Therefore, test skeletons can only be
generated for legal Ada units. If a unit is dependent on other units,
those units should be among the source files of the project or of other projects
@@ -4162,52 +4167,52 @@ Alternatively, you may run the script using the following command line:
Generated skeletons and harnesses are based on the AUnit testing framework.
AUnit is an Ada adaptation of the xxxUnit testing frameworks, similar to JUnit
for Java or CppUnit for C++. While it is advised that gnattest users read
- the AUnit manual, deep knowledge of AUnit is not necessary for using *gnattest*.
- For correct operation of *gnattest*, AUnit should be installed and
+ the AUnit manual, deep knowledge of AUnit is not necessary for using ``gnattest``.
+ For correct operation of ``gnattest``, AUnit should be installed and
aunit.gpr must be on the project path. Except for some special circumstances
(e.g. a custom run-time is used), this should normally be the case out of the box.
.. _Running_gnattest:
- Running *gnattest*
- ------------------
+ Running ``gnattest``
+ --------------------
- There are two ways of running *gnattest*.
+ There are two ways of running ``gnattest``.
.. _Framework_Generation_Mode:
Framework Generation Mode
^^^^^^^^^^^^^^^^^^^^^^^^^
- In this mode *gnattest* has the following command-line interface:
+ In this mode ``gnattest`` has the following command-line interface:
::
- $ gnattest `-Pprojname` [`switches`] [`filename`] [-cargs `gcc_switches`]
+ $ gnattest -Pprojname [ switches ] [ filename ] [ -cargs gcc_switches ]
where
- * :samp:`-P{projname}`
+ * :switch:`-P{projname}`
specifies the project defining the location of source files. When no
file names are provided on the command line, all sources in the project
are used as input. This switch is required.
- * :samp:`{filename}`
- is the name of the source file containing the library unit package declaration
- for which a test package will be created. The file name may be given with a
- path.
+ * :switch:`{filename}`
+ is the name of the source file containing the library unit package *declaration*
+ (the package "spec") for which a test package will be created. The file name
+ may be given with a path.
* :samp:`{switches}`
is an optional sequence of switches as described below.
* :samp:`{gcc_switches}`
is a list of additional switches for
- *gcc* that will be passed to all compiler invocations
- made by *gnattest* to generate a set of ASIS trees.
+ ``gcc`` that will be passed to all compiler invocations
+ made by ``gnattest`` to generate a set of ASIS trees.
- *gnattest* results can be found in two different places.
+ ``gnattest`` results can be found in two different places.
* *automatic harness*:
This is the harness code, which is located by default in
@@ -4216,7 +4221,7 @@ Alternatively, you may run the script using the following command line:
automatically and can be destroyed and regenerated at will, with the
exception of the file *gnattest_common.gpr*, which is created if absent,
but never overwritten. It is not recommended to modify other files
- manually, since these modifications will be lost if *gnattest* is re-run.
+ manually, since these modifications will be lost if ``gnattest`` is re-run.
The entry point in the harness code is
the project file named *test_driver.gpr*. Tests can be compiled and run
using a command such as:
@@ -4247,11 +4252,11 @@ Alternatively, you may run the script using the following command line:
Test Execution Mode
^^^^^^^^^^^^^^^^^^^
- In this mode *gnattest* has a the following command-line interface:
+ In this mode ``gnattest`` has a the following command-line interface:
::
- $ gnattest `test_drivers.list` [`switches`]
+ $ gnattest test_drivers.list [ switches ]
where
@@ -4267,104 +4272,112 @@ Alternatively, you may run the script using the following command line:
.. _Switches_for_gnattest_in_framework_generation_mode:
- Switches for *gnattest* in framework generation mode
- ----------------------------------------------------
+ Switches for ``gnattest`` in framework generation mode
+ ------------------------------------------------------
+
+ .. index:: --strict (gnattest)
+
+ :switch:`--strict`
+ Return error exit code if there are any compilation errors.
.. index:: -q (gnattest)
- :samp:`-q`
+ :switch:`-q`
Quiet mode: suppresses noncritical output messages.
.. index:: -v (gnattest)
- :samp:`-v`
+ :switch:`-v`
Verbose mode: produces additional output about the execution of the tool.
When specified alone on the command line, prints tool version and exits.
.. index:: -r (gnattest)
- :samp:`-r`
+ :switch:`-r`
Recursively considers all sources from all projects.
.. index:: -files (gnattest)
- :samp:`-files={filename}`
- The name of a text file containing a list of Ada source files to process.
+ :switch:`-files={filename}`
+ Take as arguments the files listed in text file ``file``.
+ Text file ``file`` may contain empty lines that are ignored.
+ Each nonempty line should contain the name of an existing file.
+ Several such switches may be specified simultaneously.
.. index:: --RTS (gnattest)
- :samp:`--RTS={rts-path}`
+ :switch:`--RTS={rts-path}`
Specifies the default location of the runtime library. Same meaning as the
- equivalent *gnatmake* flag (:ref:`Switches_for_gnatmake`). For restricted
- profiles, *gnattest* takes into account the run-time limitations when
+ equivalent ``gnatmake`` flag (:ref:`Switches_for_gnatmake`). For restricted
+ profiles, ``gnattest`` takes into account the run-time limitations when
generating the harness.
.. index:: --additional-tests (gnattest)
- :samp:`--additional-tests={projname}`
- Sources described in `projname` are considered potential additional
+ :switch:`--additional-tests={projname}`
+ Sources described in ``projname`` are considered potential additional
manual tests to be added to the test suite.
.. index:: --harness-only (gnattest)
- :samp:`--harness-only`
- When this option is given, *gnattest* creates a harness for all
+ :switch:`--harness-only`
+ When this option is given, ``gnattest`` creates a harness for all
sources, treating them as test packages.
.. index:: --separate-drivers (gnattest)
- :samp:`--separate-drivers[={val}]`
+ :switch:`--separate-drivers[={val}]`
Generates a separate test driver for each test or unit under test, rather
- than a single executable incorporating all tests. `val` can be "unit" or
+ than a single executable incorporating all tests. ``val`` can be "unit" or
"test", or may be omitted, which defaults to "unit".
.. index:: --stub (gnattest)
- :samp:`--stub`
+ :switch:`--stub`
Generates the testing framework that uses subsystem stubbing to isolate the
code under test.
.. index:: --harness-dir (gnattest)
- :samp:`--harness-dir={dirname}`
+ :switch:`--harness-dir={dirname}`
Specifies the directory that will hold the harness packages and project file
- for the test driver. If the `dirname` is a relative path, it is considered
+ for the test driver. If the ``dirname`` is a relative path, it is considered
relative to the object directory of the project file.
.. index:: --tests-dir (gnattest)
- :samp:`--tests-dir={dirname}`
- All test packages are placed in the `dirname` directory.
- If the `dirname` is a relative path, it is considered relative to the object
+ :switch:`--tests-dir={dirname}`
+ All test packages are placed in the ``dirname`` directory.
+ If the ``dirname`` is a relative path, it is considered relative to the object
directory of the project file. When all sources from all projects are taken
- recursively from all projects, `dirname` directories are created for each
+ recursively from all projects, ``dirname`` directories are created for each
project in their object directories and test packages are placed accordingly.
.. index:: --subdir (gnattest)
- :samp:`--subdir={dirname}`
+ :switch:`--subdir={dirname}`
Test packages are placed in a subdirectory of the corresponding source
- directory, with the name `dirname`. Thus, each set of unit tests is located
+ directory, with the name ``dirname``. Thus, each set of unit tests is located
in a subdirectory of the code under test. If the sources are in separate
- directories, each source directory has a test subdirectory named `dirname`.
+ directories, each source directory has a test subdirectory named ``dirname``.
.. index:: --tests-root (gnattest)
- :samp:`--tests-root={dirname}`
- The hierarchy of source directories, if any, is recreated in the `dirname`
+ :switch:`--tests-root={dirname}`
+ The hierarchy of source directories, if any, is recreated in the ``dirname``
directory, with test packages placed in directories corresponding to those
of the sources.
- If the `dirname` is a relative path, it is considered relative to the object
+ If the ``dirname`` is a relative path, it is considered relative to the object
directory of the project file. When projects are considered recursively,
directory hierarchies of tested sources are
recreated for each project in their object directories and test packages are
@@ -4373,11 +4386,11 @@ Alternatively, you may run the script using the following command line:
.. index:: --stubs-dir (gnattest)
- :samp:`--stubs-dir={dirname}`
+ :switch:`--stubs-dir={dirname}`
The hierarchy of directories containing stubbed units is recreated in
- the `dirname` directory, with stubs placed in directories corresponding to
+ the ``dirname`` directory, with stubs placed in directories corresponding to
projects they are derived from.
- If the `dirname` is a relative path, it is considered relative to the object
+ If the ``dirname`` is a relative path, it is considered relative to the object
directory of the project file. When projects are considered recursively,
directory hierarchies of stubs are
recreated for each project in their object directories and test packages are
@@ -4386,62 +4399,77 @@ Alternatively, you may run the script using the following command line:
.. index:: --exclude-from-stubbing (gnattest)
- :samp:`--exclude-from-stubbing={filename}`
- Disables stubbing of units listed in `filename`. The file should contain
+ :switch:`--exclude-from-stubbing={filename}`
+ Disables stubbing of units listed in ``filename``. The file should contain
corresponding spec files, one per line.
- :samp:`--exclude-from-stubbing:{unit}={filename}`
+ :switch:`--exclude-from-stubbing:{unit}={filename}`
Same as above, but corresponding units will not be stubbed only when testing
- specified `unit`.
+ specified ``unit``.
.. index:: --validate-type-extensions (gnattest)
- :samp:`--validate-type-extensions`
+ :switch:`--validate-type-extensions`
Enables substitution check: run all tests from all parents in order
to check substitutability in accordance with the Liskov substitution principle (LSP).
+ .. index:: --inheritance-check (gnattest)
+
+ :switch:`--inheritance-check`
+ Enables inheritance check: run inherited tests against descendants.
+
+ .. index:: --no-inheritance-check (gnattest)
+
+ :switch:`--no-inheritance-check`
+ Disables inheritance check.
+
+ .. index:: --no-inheritance-check (gnattest)
+
+ :switch:`--test-case-only`
+ Generates test skeletons only for subprograms that have at least one
+ associated pragma or aspect Test_Case.
.. index:: --skeleton-default (gnattest)
- :samp:`--skeleton-default={val}`
- Specifies the default behavior of generated skeletons. `val` can be either
+ :switch:`--skeleton-default={val}`
+ Specifies the default behavior of generated skeletons. ``val`` can be either
"fail" or "pass", "fail" being the default.
.. index:: --passed-tests (gnattest)
- :samp:`--passed-tests={val}`
- Specifies whether or not passed tests should be shown. `val` can be either
+ :switch:`--passed-tests={val}`
+ Specifies whether or not passed tests should be shown. ``val`` can be either
"show" or "hide", "show" being the default.
.. index:: --exit-status (gnattest)
- :samp:`--exit-status={val}`
+ :switch:`--exit-status={val}`
Specifies whether or not generated test driver should return failure exit
- status if at least one test fails or crashes. `val` can be either
+ status if at least one test fails or crashes. ``val`` can be either
"on" or "off", "off" being the default.
.. index:: --omit-sloc (gnattest)
- :samp:`--omit-sloc`
+ :switch:`--omit-sloc`
Suppresses comment line containing file name and line number of corresponding
subprograms in test skeletons.
.. index:: --no-command-line (gnattest)
- :samp:`--no-command-line`
+ :switch:`--no-command-line`
Don't add command line support to test driver. Note that regardless of this
- switch, *gnattest* will automatically refrain from adding command
+ switch, ``gnattest`` will automatically refrain from adding command
line support if it detects that the selected run-time doesn't provide
this capability.
.. index:: --separates (gnattest)
- :samp:`--separates`
+ :switch:`--separates`
Bodies of all test routines are generated as separates. Note that this mode is
kept for compatibility reasons only and it is not advised to use it due to
possible problems with hash in names of test skeletons when using an
@@ -4452,7 +4480,7 @@ Alternatively, you may run the script using the following command line:
.. index:: --transition (gnattest)
- :samp:`--transition`
+ :switch:`--transition`
This allows transition from separate test routines to monolith test packages.
All matching test routines are overwritten with contents of corresponding
separates. Note that if separate test routines had any manually added with
@@ -4462,41 +4490,41 @@ Alternatively, you may run the script using the following command line:
.. index:: --test-duration (gnattest)
- :samp:`--test-duration`
+ :switch:`--test-duration`
Adds time measurements for each test in generated test driver.
- :samp:`--tests_root`, ``--subdir`` and ``--tests-dir`` switches are mutually exclusive.
+ :switch:`--tests_root`, :switch:`--subdir` and :switch:`--tests-dir` switches are mutually exclusive.
.. _Switches_for_gnattest_in_test_execution_mode:
- Switches for *gnattest* in test execution mode
- ----------------------------------------------
+ Switches for ``gnattest`` in test execution mode
+ ------------------------------------------------
.. index:: --passed-tests (gnattest)
- :samp:`--passed-tests={val}`
- Specifies whether or not passed tests should be shown. `val` can be either
+ :switch:`--passed-tests={val}`
+ Specifies whether or not passed tests should be shown. ``val`` can be either
"show" or "hide", "show" being the default.
.. index:: --queues (gnattest)
.. index:: -j (gnattest)
- :samp:`--queues={n}`, :samp:`-j{n}`
- Runs `n` tests in parallel (default is 1).
+ :switch:`--queues={n}`, :switch:`-j{n}`
+ Runs ``n`` tests in parallel (default is 1).
.. _Project_Attributes_for_gnattest:
- Project Attributes for *gnattest*
- ---------------------------------
+ Project Attributes for ``gnattest``
+ -----------------------------------
Most of the command-line options can also be passed to the tool by adding
special attributes to the project file. Those attributes should be put in
- package **Gnattest**. Here is the list of attributes:
+ package ``Gnattest``. Here is the list of attributes:
* ``Tests_Root``
@@ -4534,8 +4562,8 @@ Alternatively, you may run the script using the following command line:
``--exclude-from-stubbing:unit=filename``.
Each of those attributes can be overridden from the command line if needed.
- Other *gnattest* switches can also be passed via the project
- file as an attribute list called *Gnattest_Switches*.
+ Other ``gnattest`` switches can also be passed via the project
+ file as an attribute list called ``Gnattest_Switches``.
.. _Simple_gnattest_Example:
@@ -4543,14 +4571,14 @@ Alternatively, you may run the script using the following command line:
Simple Example
--------------
- Let's take a very simple example using the first *gnattest* example
+ Let's take a very simple example using the first ``gnattest`` example
located in:
::
<install_prefix>/share/examples/gnattest/simple
- This project contains a simple package containing one subprogram. By running *gnattest*:
+ This project contains a simple package containing one subprogram. By running ``gnattest``:
::
@@ -4580,13 +4608,13 @@ Alternatively, you may run the script using the following command line:
bodies and are surrounded by special comment sections. Those comment sections
should not be removed or modified in order for gnattest to be able to regenerate
test packages and keep already written tests in place.
- The test routine `Test_Inc_5eaee3` located at ``simple-test_data-tests.adb`` contains
- a single statement: a call to procedure `Assert`. It has two arguments:
+ The test routine ``Test_Inc_5eaee3`` located at :file:`simple-test_data-tests.adb` contains
+ a single statement: a call to procedure ``Assert``. It has two arguments:
the Boolean expression we want to check and the diagnosis message to display if
the condition is false.
That is where actual testing code should be written after a proper setup.
- An actual check can be performed by replacing the `Assert` call with:
+ An actual check can be performed by replacing the ``Assert`` call with:
::
@@ -4602,13 +4630,13 @@ Alternatively, you may run the script using the following command line:
---------------------------------------------------
Besides test routines themselves, each test package has a parent package
- `Test_Data` that has two procedures: `Set_Up` and `Tear_Down`. This package is never
- overwritten by the tool. `Set_Up` is called before each test routine of the
- package, and `Tear_Down` is called after each test routine. Those two procedures
+ ``Test_Data`` that has two procedures: ``Set_Up`` and ``Tear_Down``. This package is never
+ overwritten by the tool. ``Set_Up`` is called before each test routine of the
+ package, and ``Tear_Down`` is called after each test routine. Those two procedures
can be used to perform necessary initialization and finalization,
- memory allocation, etc. Test type declared in `Test_Data` package is parent type
+ memory allocation, etc. Test type declared in ``Test_Data`` package is parent type
for the test type of test package and can have user-defined components whose
- values can be set by `Set_Up` routine and used in test routines afterwards.
+ values can be set by ``Set_Up`` routine and used in test routines afterwards.
.. _Regenerating_Tests:
@@ -4616,7 +4644,7 @@ Alternatively, you may run the script using the following command line:
Regenerating Tests
------------------
- Bodies of test routines and `Test_Data` packages are never overridden after they
+ Bodies of test routines and ``Test_Data`` packages are never overridden after they
have been created once. As long as the name of the subprogram, full expanded Ada
names and order of its parameters are the same, and comment sections are
intact, the old test routine will fit in its place and no test skeleton will be
@@ -4624,7 +4652,7 @@ Alternatively, you may run the script using the following command line:
This can be demonstrated with the previous example. By uncommenting declaration
and body of function Dec in ``simple.ads`` and ``simple.adb``, running
- *gnattest* on the project, and then running the test driver:
+ ``gnattest`` on the project, and then running the test driver:
::
@@ -4634,7 +4662,7 @@ Alternatively, you may run the script using the following command line:
$ test_runner
The old test is not replaced with a stub, nor is it lost, but a new test
- skeleton is created for function `Dec`.
+ skeleton is created for function ``Dec``.
The only way of regenerating tests skeletons is to remove the previously created
tests together with corresponding comment sections.
@@ -4651,11 +4679,11 @@ Alternatively, you may run the script using the following command line:
actually failing).
The test driver accepts a switch to specify this behavior:
- :samp:`--skeleton-default={val}`, where ``val`` is either ``pass`` or ``fail`` (exactly as for
- *gnattest*).
+ :switch:`--skeleton-default={val}`, where ``val`` is either ``pass`` or ``fail`` (exactly as for
+ ``gnattest``).
The default behavior of the test driver is set with the same switch
- as passed to *gnattest* when generating the test driver.
+ as passed to ``gnattest`` when generating the test driver.
Passing it to the driver generated on the first example:
@@ -4674,10 +4702,10 @@ Alternatively, you may run the script using the following command line:
Creation of test skeletons for primitive operations of tagged types entails
a number of features. Test routines for all primitives of a given tagged type
are placed in a separate child package named according to the tagged type. For
- example, if you have tagged type *T* in package *P*, all tests for primitives
- of *T* will be in *P.T_Test_Data.T_Tests*.
+ example, if you have tagged type ``T`` in package ``P``, all tests for primitives
+ of ``T`` will be in ``P.T_Test_Data.T_Tests``.
- Consider running *gnattest* on the second example (note: actual tests for this
+ Consider running ``gnattest`` on the second example (note: actual tests for this
example already exist, so there's no need to worry if the tool reports that
no new stubs were generated):
@@ -4699,16 +4727,16 @@ Alternatively, you may run the script using the following command line:
when generating test packages for primitive operations, there are some things
the user needs to know.
- Type *Test_Controller* has components that allow assignment of various
- derivations of type *Controller*. And if you look at the specification of
- package *Speed2.Auto_Controller*, you will see that *Test_Auto_Controller*
- actually derives from *Test_Controller* rather than AUnit type *Test_Fixture*.
+ Type ``Test_Controller`` has components that allow assignment of various
+ derivations of type ``Controller``. And if you look at the specification of
+ package *Speed2.Auto_Controller*, you will see that ``Test_Auto_Controller``
+ actually derives from ``Test_Controller`` rather than AUnit type ``Test_Fixture``.
Thus, test types mirror the hierarchy of tested types.
- The *Set_Up* procedure of *Test_Data* package corresponding to a test package
- of primitive operations of type *T* assigns to *Fixture* a reference to an
- object of that exact type *T*. Note, however, that if the tagged type has
- discriminants, the *Set_Up* only has a commented template for setting
+ The ``Set_Up`` procedure of ``Test_Data`` package corresponding to a test package
+ of primitive operations of type ``T`` assigns to ``Fixture`` a reference to an
+ object of that exact type ``T``. Note, however, that if the tagged type has
+ discriminants, the ``Set_Up`` only has a commented template for setting
up the fixture, since filling the discriminant with actual value is up
to the user.
@@ -4744,9 +4772,9 @@ Alternatively, you may run the script using the following command line:
*Tagged Type Substitutability Testing* is a way of verifying the global type
consistency by testing. Global type consistency is a principle stating that if
- *S* is a subtype of *T* (in Ada, *S* is a derived type of tagged type *T*),
- then objects of type *T* may be replaced with objects of type *S* (that is,
- objects of type *S* may be substituted for objects of type *T*), without
+ ``S`` is a subtype of ``T`` (in Ada, ``S`` is a derived type of tagged type ``T``),
+ then objects of type ``T`` may be replaced with objects of type ``S`` (that is,
+ objects of type ``S`` may be substituted for objects of type ``T``), without
altering any of the desirable properties of the program. When the properties
of the program are expressed in the form of subprogram preconditions and
postconditions (let's call them pre and post), the principle is formulated as
@@ -4762,10 +4790,10 @@ Alternatively, you may run the script using the following command line:
derived types.
In the example used in the previous section, there was clearly a violation of
- type consistency. The overriding primitive *Adjust_Speed* in package *Speed2*
+ type consistency. The overriding primitive ``Adjust_Speed`` in package ``Speed2``
removes the functionality of the overridden primitive and thus doesn't respect
the consistency principle.
- *Gnattest* has a special option to run overridden parent tests against objects
+ ``gnattest`` has a special option to run overridden parent tests against objects
of the type which have overriding primitives:
::
@@ -4775,7 +4803,7 @@ Alternatively, you may run the script using the following command line:
$ gprbuild -Ptest_driver
$ test_runner
- While all the tests pass by themselves, the parent test for *Adjust_Speed* fails
+ While all the tests pass by themselves, the parent test for ``Adjust_Speed`` fails
against objects of the derived type.
Non-overridden tests are already inherited for derived test types, so the
@@ -4788,13 +4816,13 @@ Alternatively, you may run the script using the following command line:
Testing with Contracts
----------------------
- *gnattest* supports pragmas *Pre*, *Post*, and *Test_Case*,
+ ``gnattest`` supports pragmas ``Pre``, ``Post``, and ``Test_Case``,
as well as the corresponding Ada 2012 aspects.
- Test routines are generated, one per each *Test_Case* associated with a tested
+ Test routines are generated, one per each ``Test_Case`` associated with a tested
subprogram. Those test routines have special wrappers for tested functions
that have composition of pre- and postcondition of the subprogram with
- "requires" and "ensures" of the *Test_Case* (depending on the mode, pre and post
- either count for *Nominal* mode or do **not** count for *Robustness* mode).
+ "requires" and "ensures" of the ``Test_Case`` (depending on the mode, pre and post
+ either count for ``Nominal`` mode or do *not* count for ``Robustness`` mode).
The third example demonstrates how this works:
@@ -4837,15 +4865,15 @@ Alternatively, you may run the script using the following command line:
Additional Tests
----------------
- *gnattest* can add user-written tests to the main suite of the test
- driver. *gnattest* traverses the given packages and searches for test
+ ``gnattest`` can add user-written tests to the main suite of the test
+ driver. ``gnattest`` traverses the given packages and searches for test
routines. All procedures with a single in out parameter of a type which is
derived from *AUnit.Test_Fixtures.Test_Fixture* and that are declared in package
specifications are added to the suites and are then executed by the test driver.
- (*Set_Up* and *Tear_Down* are filtered out.)
+ (``Set_Up`` and ``Tear_Down`` are filtered out.)
An example illustrates two ways of creating test harnesses for user-written
- tests. Directory `additional_tests` contains an AUnit-based test driver written
+ tests. Directory ``additional_tests`` contains an AUnit-based test driver written
by hand.
::
@@ -4877,7 +4905,7 @@ Alternatively, you may run the script using the following command line:
Individual Test Drivers
-----------------------
- By default, *gnattest* generates a monolithic test driver that
+ By default, ``gnattest`` generates a monolithic test driver that
aggregates the individual tests into a single executable. It is also possible
to generate separate executables for each test or each unit under test, by
passing the switch ``--separate-drivers`` with corresponding parameter. This
@@ -4886,7 +4914,7 @@ Alternatively, you may run the script using the following command line:
also provide a major performance benefit on multi-core systems by allowing
simultaneous execution of multiple tests.
- *gnattest* can take charge of executing the individual tests; for this,
+ ``gnattest`` can take charge of executing the individual tests; for this,
instead of passing a project file, a text file containing the list of
executables can be passed. Such a file is automatically generated by gnattest
under the name :file:`test_drivers.list`, but it can be
@@ -4908,7 +4936,7 @@ Alternatively, you may run the script using the following command line:
This mode of test harness generation is activated by the switch ``--stub``.
- The implementation approach chosen by *gnattest* is as follows.
+ The implementation approach chosen by ``gnattest`` is as follows.
For each package under consideration all the packages it is directly depending
on are stubbed, excluding the generic packages and package instantiations.
The stubs are shared for each package under test. The specs of packages to stub
@@ -4931,9 +4959,9 @@ Alternatively, you may run the script using the following command line:
.. note::
Developing a stubs-based testing campaign requires
- good understanding of the infrastructure created by *gnattest* for
+ good understanding of the infrastructure created by ``gnattest`` for
this purpose. We recommend following the two stubbing tutorials
- `simple_stubbing` and `advanced_stubbing` provided
+ ``simple_stubbing`` and ``advanced_stubbing`` provided
under :file:`<install_prefix>/share/examples/gnattest` before
attempting to use this powerful feature.
@@ -4943,7 +4971,7 @@ Alternatively, you may run the script using the following command line:
Integration with GNATcoverage
-----------------------------
- In addition to the harness, *gnattest* generates a Makefile. This Makefile
+ In addition to the harness, ``gnattest`` generates a Makefile. This Makefile
provides targets for building the test drivers and also the targets for
computing the coverage information using GNATcoverage framework when this
coverage analysis tool is available. The target ``coverage`` fully automates
@@ -4966,7 +4994,7 @@ Alternatively, you may run the script using the following command line:
Putting Tests under Version Control
-----------------------------------
- As has been stated earlier, *gnattest* generates two different types
+ As has been stated earlier, ``gnattest`` generates two different types
of code, test skeletons and harness. The harness is generated completely
automatically each time, does not require manual changes and therefore should
not be put under version control.
@@ -4987,8 +5015,8 @@ Alternatively, you may run the script using the following command line:
* generic tests for nested generic packages and their instantiations are
not supported;
* tests for protected subprograms and entries are not supported;
- * pragma *No_Run_Time* is not supported;
- * pragma *No_Secondary_Stack* is not supported;
+ * pragma ``No_Run_Time`` is not supported;
+ * pragma ``No_Secondary_Stack`` is not supported;
* if pragmas for interfacing with foreign languages are used, manual
adjustments might be necessary to make the test harness compilable;
* use of some constructs, such as elaboration-control pragmas, Type_Invariant
@@ -5021,12 +5049,12 @@ Alternatively, you may run the script using the following command line:
The following switches are used by the project-aware GNAT tools:
- :samp:`-P{project_file}`
+ :switch:`-P{project_file}`
Indicates the name of the project file whose source files are to
be processed. The exact set of sources depends on other options
specified, see below.
- :samp:`-U`
+ :switch:`-U`
If a project file is supplied, say for project ``proj``,
but no sources are specified for ``proj`` (either by a
project attribute or through a tool option that provides a list
@@ -5034,33 +5062,33 @@ Alternatively, you may run the script using the following command line:
from projects imported either directly or indirectly by ``proj``.
Otherwise this option has no effect.
- :samp:`-U {source_file}`
- Similar to :samp:`-U`, but if no sources are specified then
+ :switch:`-U {source_file}`
+ Similar to :switch:`-U`, but if no sources are specified then
process only those source files for units in the closure of
- the Ada source contained in `source_file`. Note that this option
+ the Ada source contained in ``source_file``. Note that this option
expects the source file name but not the Ada unit name as its
parameter.
- :samp:`-X{name}={val}`
+ :switch:`-X{name}={val}`
Indicates that the external variable ``name`` in the project has the
value ``val``. Has no effect if no project has been specified.
- :samp:`--subdirs={dir}`
- Use the `dir` subdirectory of the project's object directory (or the `dir`
+ :switch:`--subdirs={dir}`
+ Use the ``dir`` subdirectory of the project's object directory (or the ``dir``
subdirectory of the project file directory if the project does not specify
an object directory) for tool output files. Has no effect if no project
- has been specified or if :samp:`--no_objects_dir` is specified.
+ has been specified or if :switch:`--no_objects_dir` is specified.
- :samp:`--no_objects_dir`
+ :switch:`--no_objects_dir`
Place all the result files into the current directory (i.e., the directory
from which the tool invocation command is issued) instead of the project's
object directory. Has no effect if no project has been specified.
- :samp:`-eL`
+ :switch:`-eL`
Follow all symbolic links when processing project files.
- If a project file is specified and there is neither a :samp:`-U` option,
- nor a :samp:`-U {main_unit}` option, nor some other explicit option to
+ If a project file is specified and there is neither a :switch:`-U` option,
+ nor a :switch:`-U {main_unit}` option, nor some other explicit option to
specify the source files, then the sources to be processed are the
immediate sources of the specified project (i.e., the source files directly
defined by that project, either implicitly by residing in the project
diff --git a/gcc/ada/doc/gnat_ugn/inline_assembler.rst b/gcc/ada/doc/gnat_ugn/inline_assembler.rst
index f2c0e72..b539e17 100644
--- a/gcc/ada/doc/gnat_ugn/inline_assembler.rst
+++ b/gcc/ada/doc/gnat_ugn/inline_assembler.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. _Inline_Assembler:
****************
@@ -13,7 +15,7 @@ external routines written in assembly language, an Ada feature fully
supported by GNAT. However, for small sections of code it may be simpler
or more efficient to include assembly language statements directly
in your Ada source program, using the facilities of the implementation-defined
-package `System.Machine_Code`, which incorporates the gcc
+package ``System.Machine_Code``, which incorporates the gcc
Inline Assembler. The Inline Assembler approach offers a number of advantages,
including the following:
@@ -38,58 +40,58 @@ Basic Assembler Syntax
The assembler used by GNAT and gcc is based not on the Intel assembly
language, but rather on a language that descends from the AT&T Unix
-assembler *as* (and which is often referred to as 'AT&T syntax').
-The following table summarizes the main features of *as* syntax
+assembler ``as`` (and which is often referred to as 'AT&T syntax').
+The following table summarizes the main features of ``as`` syntax
and points out the differences from the Intel conventions.
-See the gcc *as* and *gas* (an *as* macro
+See the gcc ``as`` and ``gas`` (an ``as`` macro
pre-processor) documentation for further information.
| *Register names*
-| gcc / *as*: Prefix with '%'; for example `%eax`
-| Intel: No extra punctuation; for example `eax`
+| gcc / ``as``: Prefix with '%'; for example ``%eax``
+| Intel: No extra punctuation; for example ``eax``
| *Immediate operand*
-| gcc / *as*: Prefix with '$'; for example `$4`
-| Intel: No extra punctuation; for example `4`
+| gcc / ``as``: Prefix with '$'; for example ``$4``
+| Intel: No extra punctuation; for example ``4``
| *Address*
-| gcc / *as*: Prefix with '$'; for example `$loc`
-| Intel: No extra punctuation; for example `loc`
+| gcc / ``as``: Prefix with '$'; for example ``$loc``
+| Intel: No extra punctuation; for example ``loc``
| *Memory contents*
-| gcc / *as*: No extra punctuation; for example `loc`
-| Intel: Square brackets; for example `[loc]`
+| gcc / ``as``: No extra punctuation; for example ``loc``
+| Intel: Square brackets; for example ``[loc]``
| *Register contents*
-| gcc / *as*: Parentheses; for example `(%eax)`
-| Intel: Square brackets; for example `[eax]`
+| gcc / ``as``: Parentheses; for example ``(%eax)``
+| Intel: Square brackets; for example ``[eax]``
| *Hexadecimal numbers*
-| gcc / *as*: Leading '0x' (C language syntax); for example `0xA0`
-| Intel: Trailing 'h'; for example `A0h`
+| gcc / ``as``: Leading '0x' (C language syntax); for example ``0xA0``
+| Intel: Trailing 'h'; for example ``A0h``
| *Operand size*
-| gcc / *as*: Explicit in op code; for example `movw` to move a 16-bit word
-| Intel: Implicit, deduced by assembler; for example `mov`
+| gcc / ``as``: Explicit in op code; for example ``movw`` to move a 16-bit word
+| Intel: Implicit, deduced by assembler; for example ``mov``
| *Instruction repetition*
-| gcc / *as*: Split into two lines; for example
-| `rep`
-| `stosl`
-| Intel: Keep on one line; for example `rep stosl`
+| gcc / ``as``: Split into two lines; for example
+| ``rep``
+| ``stosl``
+| Intel: Keep on one line; for example ``rep stosl``
| *Order of operands*
-| gcc / *as*: Source first; for example `movw $4, %eax`
-| Intel: Destination first; for example `mov eax, 4`
+| gcc / ``as``: Source first; for example ``movw $4, %eax``
+| Intel: Destination first; for example ``mov eax, 4``
.. _A_Simple_Example_of_Inline_Assembler:
@@ -98,7 +100,7 @@ A Simple Example of Inline Assembler
====================================
The following example will generate a single assembly language statement,
-`nop`, which does nothing. Despite its lack of run-time effect,
+``nop``, which does nothing. Despite its lack of run-time effect,
the example will be useful in illustrating the basics of
the Inline Assembler facility.
@@ -110,19 +112,19 @@ the Inline Assembler facility.
Asm ("nop");
end Nothing;
-`Asm` is a procedure declared in package `System.Machine_Code`;
+``Asm`` is a procedure declared in package ``System.Machine_Code``;
here it takes one parameter, a *template string* that must be a static
expression and that will form the generated instruction.
-`Asm` may be regarded as a compile-time procedure that parses
+``Asm`` may be regarded as a compile-time procedure that parses
the template string and additional parameters (none here),
from which it generates a sequence of assembly language instructions.
The examples in this chapter will illustrate several of the forms
-for invoking `Asm`; a complete specification of the syntax
-is found in the `Machine_Code_Insertions` section of the
+for invoking ``Asm``; a complete specification of the syntax
+is found in the ``Machine_Code_Insertions`` section of the
:title:`GNAT Reference Manual`.
-Under the standard GNAT conventions, the `Nothing` procedure
+Under the standard GNAT conventions, the ``Nothing`` procedure
should be in a file named :file:`nothing.adb`.
You can build the executable in the usual way:
@@ -140,20 +142,20 @@ To see this output, invoke the compiler as follows:
where the options are:
-* :samp:`-c`
+* :switch:`-c`
compile only (no bind or link)
-* :samp:`-S`
+* :switch:`-S`
generate assembler listing
-* :samp:`-fomit-frame-pointer`
+* :switch:`-fomit-frame-pointer`
do not set up separate stack frames
-* :samp:`-gnatp`
+* :switch:`-gnatp`
do not add runtime checks
This gives a human-readable assembler version of the code. The resulting
-file will have the same name as the Ada source file, but with a `.s`
+file will have the same name as the Ada source file, but with a ``.s``
extension. In our example, the file :file:`nothing.s` has the following
contents:
@@ -175,7 +177,7 @@ contents:
ret
The assembly code you included is clearly indicated by
-the compiler, between the `#APP` and `#NO_APP`
+the compiler, between the ``#APP`` and ``#NO_APP``
delimiters. The character before the 'APP' and 'NOAPP'
can differ on different targets. For example, GNU/Linux uses '#APP' while
on NT you will see '/APP'.
@@ -185,7 +187,7 @@ wrong size modifier, or using a wrong operand for the instruction) GNAT
will report this error in a temporary file, which will be deleted when
the compilation is finished. Generating an assembler file will help
in such cases, since you can assemble this file separately using the
-*as* assembler that comes with gcc.
+``as`` assembler that comes with gcc.
Assembling the file using the command
@@ -195,7 +197,7 @@ Assembling the file using the command
will give you error messages whose lines correspond to the assembler
input file, so you can easily find and correct any mistakes you made.
-If there are no errors, *as* will generate an object file
+If there are no errors, ``as`` will generate an object file
:file:`nothing.out`.
@@ -261,12 +263,12 @@ actually do. This is a useful convention.
When writing Inline Assembler instructions, you need to precede each register
and variable name with a percent sign. Since the assembler already requires
a percent sign at the beginning of a register name, you need two consecutive
-percent signs for such names in the Asm template string, thus `%%eax`.
+percent signs for such names in the Asm template string, thus ``%%eax``.
In the generated assembly code, one of the percent signs will be stripped off.
-Names such as `%0`, `%1`, `%2`, etc., denote input or output
-variables: operands you later define using `Input` or `Output`
-parameters to `Asm`.
+Names such as ``%0``, ``%1``, ``%2``, etc., denote input or output
+variables: operands you later define using ``Input`` or ``Output``
+parameters to ``Asm``.
An output variable is illustrated in
the third statement in the Asm template string:
@@ -275,21 +277,21 @@ the third statement in the Asm template string:
movl %%eax, %0
The intent is to store the contents of the eax register in a variable that can
-be accessed in Ada. Simply writing `movl %%eax, Flags` would not
+be accessed in Ada. Simply writing ``movl %%eax, Flags`` would not
necessarily work, since the compiler might optimize by using a register
-to hold Flags, and the expansion of the `movl` instruction would not be
+to hold Flags, and the expansion of the ``movl`` instruction would not be
aware of this optimization. The solution is not to store the result directly
but rather to advise the compiler to choose the correct operand form;
-that is the purpose of the `%0` output variable.
+that is the purpose of the ``%0`` output variable.
-Information about the output variable is supplied in the `Outputs`
-parameter to `Asm`:
+Information about the output variable is supplied in the ``Outputs``
+parameter to ``Asm``:
.. code-block:: ada
Outputs => Unsigned_32'Asm_Output ("=g", Flags));
-The output is defined by the `Asm_Output` attribute of the target type;
+The output is defined by the ``Asm_Output`` attribute of the target type;
the general format is
.. code-block:: ada
@@ -303,21 +305,21 @@ to store/access the associated variable. In the example
Unsigned_32'Asm_Output ("=m", Flags);
-the `"m"` (memory) constraint tells the compiler that the variable
-`Flags` should be stored in a memory variable, thus preventing
+the ``"m"`` (memory) constraint tells the compiler that the variable
+``Flags`` should be stored in a memory variable, thus preventing
the optimizer from keeping it in a register. In contrast,
.. code-block:: ada
Unsigned_32'Asm_Output ("=r", Flags);
-uses the `"r"` (register) constraint, telling the compiler to
+uses the ``"r"`` (register) constraint, telling the compiler to
store the variable in a register.
If the constraint is preceded by the equal character '=', it tells
the compiler that the variable will be used to store data into it.
-In the `Get_Flags` example, we used the `"g"` (global) constraint,
+In the ``Get_Flags`` example, we used the ``"g"`` (global) constraint,
allowing the optimizer to choose whatever it deems best.
There are a fairly large number of constraints, but the ones that are
@@ -338,7 +340,7 @@ most useful (for the Intel x86 processor) are the following:
*q* use one of eax, ebx, ecx, edx, esi or edi
====== ==========================================
-The full set of constraints is described in the gcc and *as*
+The full set of constraints is described in the gcc and ``as``
documentation; note that it is possible to combine certain constraints
in one constraint string.
@@ -354,16 +356,16 @@ integer. Thus in
Outputs => Unsigned_32'Asm_Output ("=g", Flags));
-`%0` will be replaced in the expanded code by the appropriate operand,
+``%0`` will be replaced in the expanded code by the appropriate operand,
whatever
-the compiler decided for the `Flags` variable.
+the compiler decided for the ``Flags`` variable.
In general, you may have any number of output variables:
-* Count the operands starting at 0; thus `%0`, `%1`, etc.
+* Count the operands starting at 0; thus ``%0``, ``%1``, etc.
-* Specify the `Outputs` parameter as a parenthesized comma-separated list
- of `Asm_Output` attributes
+* Specify the ``Outputs`` parameter as a parenthesized comma-separated list
+ of ``Asm_Output`` attributes
For example:
@@ -376,13 +378,13 @@ For example:
Unsigned_32'Asm_Output ("=g", Var_B), -- %1 = Var_B
Unsigned_32'Asm_Output ("=g", Var_C))); -- %2 = Var_C
-where `Var_A`, `Var_B`, and `Var_C` are variables
+where ``Var_A``, ``Var_B``, and ``Var_C`` are variables
in the Ada program.
-As a variation on the `Get_Flags` example, we can use the constraints
-string to direct the compiler to store the eax register into the `Flags`
+As a variation on the ``Get_Flags`` example, we can use the constraints
+string to direct the compiler to store the eax register into the ``Flags``
variable, instead of including the store instruction explicitly in the
-`Asm` template string:
+``Asm`` template string:
.. code-block:: ada
@@ -399,7 +401,7 @@ variable, instead of including the store instruction explicitly in the
Put_Line ("Flags register:" & Flags'Img);
end Get_Flags_2;
-The `"a"` constraint tells the compiler that the `Flags`
+The ``"a"`` constraint tells the compiler that the ``Flags``
variable will come from the eax register. Here is the resulting code:
::
@@ -466,13 +468,13 @@ The program simply increments its input value by 1:
Put_Line ("Value after is" & Value'Img);
end Increment;
-The `Outputs` parameter to `Asm` specifies
+The ``Outputs`` parameter to ``Asm`` specifies
that the result will be in the eax register and that it is to be stored
-in the `Result` variable.
+in the ``Result`` variable.
-The `Inputs` parameter looks much like the `Outputs` parameter,
-but with an `Asm_Input` attribute.
-The `"="` constraint, indicating an output value, is not present.
+The ``Inputs`` parameter looks much like the ``Outputs`` parameter,
+but with an ``Asm_Input`` attribute.
+The ``"="`` constraint, indicating an output value, is not present.
You can have multiple input variables, in the same way that you can have more
than one output variable.
@@ -480,18 +482,18 @@ than one output variable.
The parameter count (%0, %1) etc, still starts at the first output statement,
and continues with the input statements.
-Just as the `Outputs` parameter causes the register to be stored into the
+Just as the ``Outputs`` parameter causes the register to be stored into the
target variable after execution of the assembler statements, so does the
-`Inputs` parameter cause its variable to be loaded into the register
+``Inputs`` parameter cause its variable to be loaded into the register
before execution of the assembler statements.
-Thus the effect of the `Asm` invocation is:
+Thus the effect of the ``Asm`` invocation is:
-* load the 32-bit value of `Value` into eax
-* execute the `incl %eax` instruction
-* store the contents of eax into the `Result` variable
+* load the 32-bit value of ``Value`` into eax
+* execute the ``incl %eax`` instruction
+* store the contents of eax into the ``Result`` variable
-The resulting assembler file (with *-O2* optimization) contains:
+The resulting assembler file (with :switch:`-O2` optimization) contains:
::
@@ -512,10 +514,10 @@ The resulting assembler file (with *-O2* optimization) contains:
Inlining Inline Assembler Code
==============================
-For a short subprogram such as the `Incr` function in the previous
+For a short subprogram such as the ``Incr`` function in the previous
section, the overhead of the call and return (creating / deleting the stack
frame) can be significant, compared to the amount of code in the subprogram
-body. A solution is to apply Ada's `Inline` pragma to the subprogram,
+body. A solution is to apply Ada's ``Inline`` pragma to the subprogram,
which directs the compiler to expand invocations of the subprogram at the
point(s) of call, instead of setting up a stack frame for out-of-line calls.
Here is the resulting program:
@@ -546,11 +548,11 @@ Here is the resulting program:
Put_Line ("Value after is" & Value'Img);
end Increment_2;
-Compile the program with both optimization (*-O2*) and inlining
-(*-gnatn*) enabled.
+Compile the program with both optimization (:switch:`-O2`) and inlining
+(:switch:`-gnatn`) enabled.
-The `Incr` function is still compiled as usual, but at the
-point in `Increment` where our function used to be called:
+The ``Incr`` function is still compiled as usual, but at the
+point in ``Increment`` where our function used to be called:
::
@@ -572,31 +574,31 @@ the code for the function body directly appears:
thus saving the overhead of stack frame setup and an out-of-line call.
-.. _Other_`Asm`_Functionality:
+.. _Other_Asm_Functionality:
-Other `Asm` Functionality
-=========================
+Other ``Asm`` Functionality
+===========================
-This section describes two important parameters to the `Asm`
-procedure: `Clobber`, which identifies register usage;
-and `Volatile`, which inhibits unwanted optimizations.
+This section describes two important parameters to the ``Asm``
+procedure: ``Clobber``, which identifies register usage;
+and ``Volatile``, which inhibits unwanted optimizations.
-.. _The_`Clobber`_Parameter:
+.. _The_Clobber_Parameter:
-The `Clobber` Parameter
------------------------
+The ``Clobber`` Parameter
+-------------------------
One of the dangers of intermixing assembly language and a compiled language
such as Ada is that the compiler needs to be aware of which registers are
being used by the assembly code. In some cases, such as the earlier examples,
the constraint string is sufficient to indicate register usage (e.g.,
-`"a"` for
+``"a"`` for
the eax register). But more generally, the compiler needs an explicit
identification of the registers that are used by the Inline Assembly
statements.
Using a register that the compiler doesn't know about
-could be a side effect of an instruction (like `mull`
+could be a side effect of an instruction (like ``mull``
storing its result in both eax and edx).
It can also arise from explicit register usage in your
assembly code; for example:
@@ -608,10 +610,10 @@ assembly code; for example:
Outputs => Unsigned_32'Asm_Output ("=g", Var_Out),
Inputs => Unsigned_32'Asm_Input ("g", Var_In));
-where the compiler (since it does not analyze the `Asm` template string)
+where the compiler (since it does not analyze the ``Asm`` template string)
does not know you are using the ebx register.
-In such cases you need to supply the `Clobber` parameter to `Asm`,
+In such cases you need to supply the ``Clobber`` parameter to ``Asm``,
to identify the registers that will be used by your assembly code:
@@ -626,28 +628,28 @@ to identify the registers that will be used by your assembly code:
The Clobber parameter is a static string expression specifying the
register(s) you are using. Note that register names are *not* prefixed
by a percent sign. Also, if more than one register is used then their names
-are separated by commas; e.g., `"eax, ebx"`
+are separated by commas; e.g., ``"eax, ebx"``
-The `Clobber` parameter has several additional uses:
+The ``Clobber`` parameter has several additional uses:
-* Use 'register' name `cc` to indicate that flags might have changed
-* Use 'register' name `memory` if you changed a memory location
+* Use 'register' name ``cc`` to indicate that flags might have changed
+* Use 'register' name ``memory`` if you changed a memory location
-.. _The_`Volatile`_Parameter:
+.. _The_Volatile_Parameter:
-The `Volatile` Parameter
-------------------------
+The ``Volatile`` Parameter
+--------------------------
.. index:: Volatile parameter
Compiler optimizations in the presence of Inline Assembler may sometimes have
-unwanted effects. For example, when an `Asm` invocation with an input
+unwanted effects. For example, when an ``Asm`` invocation with an input
variable is inside a loop, the compiler might move the loading of the input
variable outside the loop, regarding it as a one-time initialization.
If this effect is not desired, you can disable such optimizations by setting
-the `Volatile` parameter to `True`; for example:
+the ``Volatile`` parameter to ``True``; for example:
.. code-block:: ada
@@ -658,11 +660,11 @@ the `Volatile` parameter to `True`; for example:
Clobber => "ebx",
Volatile => True);
-By default, `Volatile` is set to `False` unless there is no
-`Outputs` parameter.
+By default, ``Volatile`` is set to ``False`` unless there is no
+``Outputs`` parameter.
-Although setting `Volatile` to `True` prevents unwanted
+Although setting ``Volatile`` to ``True`` prevents unwanted
optimizations, it will also disable other optimizations that might be
-important for efficiency. In general, you should set `Volatile`
-to `True` only if the compiler's optimizations have created
+important for efficiency. In general, you should set ``Volatile``
+to ``True`` only if the compiler's optimizations have created
problems.
diff --git a/gcc/ada/doc/gnat_ugn/platform_specific_information.rst b/gcc/ada/doc/gnat_ugn/platform_specific_information.rst
index 3618b0a..05270e5 100644
--- a/gcc/ada/doc/gnat_ugn/platform_specific_information.rst
+++ b/gcc/ada/doc/gnat_ugn/platform_specific_information.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. -- Non-breaking space in running text
-- E.g. Ada |nbsp| 95
@@ -199,7 +201,7 @@ Alternatively, you can specify :file:`rts-sjlj/adainclude` in the file
.. index:: --RTS option
Selecting another run-time library temporarily can be
-achieved by using the *--RTS* switch, e.g., *--RTS=sjlj*
+achieved by using the :switch:`--RTS` switch, e.g., :switch:`--RTS=sjlj`
.. _Choosing_the_Scheduling_Policy:
@@ -212,28 +214,28 @@ Choosing the Scheduling Policy
------------------------------
When using a POSIX threads implementation, you have a choice of several
-scheduling policies: `SCHED_FIFO`, `SCHED_RR` and `SCHED_OTHER`.
+scheduling policies: ``SCHED_FIFO``, ``SCHED_RR`` and ``SCHED_OTHER``.
-Typically, the default is `SCHED_OTHER`, while using `SCHED_FIFO`
-or `SCHED_RR` requires special (e.g., root) privileges.
+Typically, the default is ``SCHED_OTHER``, while using ``SCHED_FIFO``
+or ``SCHED_RR`` requires special (e.g., root) privileges.
.. index:: pragma Time_Slice
.. index:: -T0 option
.. index:: pragma Task_Dispatching_Policy
-By default, GNAT uses the `SCHED_OTHER` policy. To specify
-`SCHED_FIFO`,
+By default, GNAT uses the ``SCHED_OTHER`` policy. To specify
+``SCHED_FIFO``,
you can use one of the following:
-* `pragma Time_Slice (0.0)`
-* the corresponding binder option *-T0*
-* `pragma Task_Dispatching_Policy (FIFO_Within_Priorities)`
+* ``pragma Time_Slice (0.0)``
+* the corresponding binder option :switch:`-T0`
+* ``pragma Task_Dispatching_Policy (FIFO_Within_Priorities)``
-To specify `SCHED_RR`,
-you should use `pragma Time_Slice` with a
-value greater than 0.0, or else use the corresponding *-T*
+To specify ``SCHED_RR``,
+you should use ``pragma Time_Slice`` with a
+value greater than 0.0, or else use the corresponding :switch:`-T`
binder option.
@@ -279,15 +281,15 @@ library based on POSIX threads --- *rts-pthread*.
This run-time library has the advantage of being mostly shared across all
POSIX-compliant thread implementations, and it also provides under
-Solaris |nbsp| 8 the `PTHREAD_PRIO_INHERIT`
-and `PTHREAD_PRIO_PROTECT`
+Solaris |nbsp| 8 the ``PTHREAD_PRIO_INHERIT``
+and ``PTHREAD_PRIO_PROTECT``
semantics that can be selected using the predefined pragma
-`Locking_Policy`
+``Locking_Policy``
with respectively
-`Inheritance_Locking` and `Ceiling_Locking` as the policy.
+``Inheritance_Locking`` and ``Ceiling_Locking`` as the policy.
As explained above, the native run-time library is based on the Solaris thread
-library (`libthread`) and is the default library.
+library (``libthread``) and is the default library.
.. index:: GNAT_PROCESSOR environment variable (on Sparc Solaris)
@@ -303,14 +305,14 @@ to one of the following:
========================= ===================================================================
``GNAT_PROCESSOR`` Value Effect
========================= ===================================================================
- *-2* Use the default configuration (run the program on all
- available processors) - this is the same as having `GNAT_PROCESSOR`
+ ``-2`` Use the default configuration (run the program on all
+ available processors) - this is the same as having ``GNAT_PROCESSOR``
unset
- *-1* Let the run-time implementation choose one processor and run the
+ ``-1`` Let the run-time implementation choose one processor and run the
program on that processor
- *0 .. Last_Proc* Run the program on the specified processor.
- `Last_Proc` is equal to `_SC_NPROCESSORS_CONF - 1`
- (where `_SC_NPROCESSORS_CONF` is a system variable).
+ ``0 .. Last_Proc`` Run the program on the specified processor.
+ ``Last_Proc`` is equal to ``_SC_NPROCESSORS_CONF - 1``
+ (where ``_SC_NPROCESSORS_CONF`` is a system variable).
========================= ===================================================================
@@ -322,16 +324,16 @@ AIX-Specific Considerations
.. index:: AIX resolver library
On AIX, the resolver library initializes some internal structure on
-the first call to `get*by*` functions, which are used to implement
-`GNAT.Sockets.Get_Host_By_Name` and
-`GNAT.Sockets.Get_Host_By_Address`.
+the first call to ``get*by*`` functions, which are used to implement
+``GNAT.Sockets.Get_Host_By_Name`` and
+``GNAT.Sockets.Get_Host_By_Address``.
If such initialization occurs within an Ada task, and the stack size for
the task is the default size, a stack overflow may occur.
To avoid this overflow, the user should either ensure that the first call
-to `GNAT.Sockets.Get_Host_By_Name` or
-`GNAT.Sockets.Get_Host_By_Addrss`
-occurs in the environment task, or use `pragma Storage_Size` to
+to ``GNAT.Sockets.Get_Host_By_Name`` or
+``GNAT.Sockets.Get_Host_By_Addrss``
+occurs in the environment task, or use ``pragma Storage_Size`` to
specify a sufficiently large size for the stack of the task that contains
this call.
@@ -359,20 +361,20 @@ platforms.
using the command-line interface.
In order to install one of the GNAT installers from the command
- line you should pass parameter `/S` (and, optionally,
- `/D=<directory>`) as command-line arguments.
+ line you should pass parameter :switch:`/S` (and, optionally,
+ :switch:`/D=<directory>`) as command-line arguments.
.. only:: PRO
For example, for an unattended installation of
GNAT 7.0.2 into the default directory
- `C:\\GNATPRO\\7.0.2` you would run:
+ ``C:\\GNATPRO\\7.0.2`` you would run:
::
gnatpro-7.0.2-i686-pc-mingw32-bin.exe /S
- To install into a custom directory, say, `C:\\TOOLS\\GNATPRO\\7.0.2`:
+ To install into a custom directory, say, ``C:\\TOOLS\\GNATPRO\\7.0.2``:
::
@@ -381,7 +383,7 @@ platforms.
.. only:: GPL
For example, for an unattended installation of
- GNAT 2012 into `C:\\GNAT\\2012`:
+ GNAT 2012 into ``C:\\GNAT\\2012``:
::
@@ -402,8 +404,8 @@ Using GNAT on Windows
---------------------
One of the strengths of the GNAT technology is that its tool set
-(*gcc*, *gnatbind*, *gnatlink*, *gnatmake*, the
-`gdb` debugger, etc.) is used in the same way regardless of the
+(``gcc``, ``gnatbind``, ``gnatlink``, ``gnatmake``, the
+``gdb`` debugger, etc.) is used in the same way regardless of the
platform.
On Windows this tool set is complemented by a number of Microsoft-specific
@@ -411,7 +413,7 @@ tools that have been provided to facilitate interoperability with Windows
when this is required. With these tools:
-* You can build applications using the `CONSOLE` or `WINDOWS`
+* You can build applications using the ``CONSOLE`` or ``WINDOWS``
subsystems.
* You can use any Dynamically Linked Library (DLL) in your Ada code (both
@@ -430,12 +432,12 @@ Other restrictions about specific features like Windows Resources and DLLs
are listed in separate sections below.
-* It is not possible to use `GetLastError` and `SetLastError`
+* It is not possible to use ``GetLastError`` and ``SetLastError``
when tasking, protected records, or exceptions are used. In these
cases, in order to implement Ada semantics, the GNAT run-time system
calls certain Win32 routines that set the last error variable to 0 upon
- success. It should be possible to use `GetLastError` and
- `SetLastError` when tasking, protected record, and exception
+ success. It should be possible to use ``GetLastError`` and
+ ``SetLastError`` when tasking, protected record, and exception
features are not used, but it is not guaranteed to work.
* It is not possible to link against Microsoft C++ libraries except for
@@ -466,7 +468,7 @@ Using a network installation of GNAT
Make sure the system on which GNAT is installed is accessible from the
current machine, i.e., the install location is shared over the network.
Shared resources are accessed on Windows by means of UNC paths, which
-have the format `\\\\server\\sharename\\path`
+have the format ``\\\\server\\sharename\\path``
In order to use such a network installation, simply add the UNC path of the
:file:`bin` directory of your GNAT installation in front of your PATH. For
@@ -491,12 +493,12 @@ CONSOLE and WINDOWS subsystems
.. index:: WINDOWS Subsystem
.. index:: -mwindows
-There are two main subsystems under Windows. The `CONSOLE` subsystem
+There are two main subsystems under Windows. The ``CONSOLE`` subsystem
(which is the default subsystem) will always create a console when
launching the application. This is not something desirable when the
application has a Windows GUI. To get rid of this console the
-application must be using the `WINDOWS` subsystem. To do so
-the *-mwindows* linker option must be specified.
+application must be using the ``WINDOWS`` subsystem. To do so
+the :switch:`-mwindows` linker option must be specified.
::
@@ -530,7 +532,7 @@ Disabling Command Line Argument Expansion
.. index:: Command Line Argument Expansion
-By default, an executable compiled for the **Windows** platform will do
+By default, an executable compiled for the Windows platform will do
the following postprocessing on the arguments passed on the command
line:
@@ -555,13 +557,13 @@ line:
Ada.Command_Line.Argument (1) -> "*.txt"
-Note that if the program is launched from a shell such as **Cygwin** **Bash**
+Note that if the program is launched from a shell such as Cygwin Bash
then quote removal might be performed by the shell.
In some contexts it might be useful to disable this feature (for example if
the program performs its own argument expansion). In order to do this, a C
symbol needs to be defined and set to ``0``. You can do this by
-adding the following code fragment in one of your **Ada** units:
+adding the following code fragment in one of your Ada units:
.. code-block:: ada
@@ -588,7 +590,7 @@ application that contains a mix of Ada and C/C++, the choice of your
Windows C/C++ development environment conditions your overall
interoperability strategy.
-If you use *gcc* or Microsoft C to compile the non-Ada part of
+If you use ``gcc`` or Microsoft C to compile the non-Ada part of
your application, there are no Windows-specific restrictions that
affect the overall interoperability with your Ada code. If you do want
to use the Microsoft tools for your C++ code, you have two choices:
@@ -649,38 +651,38 @@ This section pertain only to Win32. On Win64 there is a single native
calling convention. All convention specifiers are ignored on this
platform.
-When a subprogram `F` (caller) calls a subprogram `G`
-(callee), there are several ways to push `G`'s parameters on the
+When a subprogram ``F`` (caller) calls a subprogram ``G``
+(callee), there are several ways to push ``G``\ 's parameters on the
stack and there are several possible scenarios to clean up the stack
-upon `G`'s return. A calling convention is an agreed upon software
-protocol whereby the responsibilities between the caller (`F`) and
-the callee (`G`) are clearly defined. Several calling conventions
+upon ``G``\ 's return. A calling convention is an agreed upon software
+protocol whereby the responsibilities between the caller (``F``) and
+the callee (``G``) are clearly defined. Several calling conventions
are available for Windows:
-* `C` (Microsoft defined)
+* ``C`` (Microsoft defined)
-* `Stdcall` (Microsoft defined)
+* ``Stdcall`` (Microsoft defined)
-* `Win32` (GNAT specific)
+* ``Win32`` (GNAT specific)
-* `DLL` (GNAT specific)
+* ``DLL`` (GNAT specific)
.. _C_Calling_Convention:
-`C` Calling Convention
-""""""""""""""""""""""
+``C`` Calling Convention
+""""""""""""""""""""""""
This is the default calling convention used when interfacing to C/C++
-routines compiled with either *gcc* or Microsoft Visual C++.
+routines compiled with either ``gcc`` or Microsoft Visual C++.
-In the `C` calling convention subprogram parameters are pushed on the
+In the ``C`` calling convention subprogram parameters are pushed on the
stack by the caller from right to left. The caller itself is in charge of
cleaning up the stack after the call. In addition, the name of a routine
-with `C` calling convention is mangled by adding a leading underscore.
+with ``C`` calling convention is mangled by adding a leading underscore.
The name to use on the Ada side when importing (or exporting) a routine
-with `C` calling convention is the name of the routine. For
+with ``C`` calling convention is the name of the routine. For
instance the C function:
::
@@ -694,38 +696,38 @@ should be imported from Ada as follows:
function Get_Val (V : Interfaces.C.long) return Interfaces.C.int;
pragma Import (C, Get_Val, External_Name => "get_val");
-Note that in this particular case the `External_Name` parameter could
+Note that in this particular case the ``External_Name`` parameter could
have been omitted since, when missing, this parameter is taken to be the
-name of the Ada entity in lower case. When the `Link_Name` parameter
+name of the Ada entity in lower case. When the ``Link_Name`` parameter
is missing, as in the above example, this parameter is set to be the
-`External_Name` with a leading underscore.
+``External_Name`` with a leading underscore.
-When importing a variable defined in C, you should always use the `C`
+When importing a variable defined in C, you should always use the ``C``
calling convention unless the object containing the variable is part of a
-DLL (in which case you should use the `Stdcall` calling
+DLL (in which case you should use the ``Stdcall`` calling
convention, :ref:`Stdcall_Calling_Convention`).
.. _Stdcall_Calling_Convention:
-`Stdcall` Calling Convention
-""""""""""""""""""""""""""""
+``Stdcall`` Calling Convention
+""""""""""""""""""""""""""""""
This convention, which was the calling convention used for Pascal
programs, is used by Microsoft for all the routines in the Win32 API for
efficiency reasons. It must be used to import any routine for which this
convention was specified.
-In the `Stdcall` calling convention subprogram parameters are pushed
+In the ``Stdcall`` calling convention subprogram parameters are pushed
on the stack by the caller from right to left. The callee (and not the
caller) is in charge of cleaning the stack on routine exit. In addition,
-the name of a routine with `Stdcall` calling convention is mangled by
-adding a leading underscore (as for the `C` calling convention) and a
-trailing :samp:`@{nn}`, where `nn` is the overall size (in
+the name of a routine with ``Stdcall`` calling convention is mangled by
+adding a leading underscore (as for the ``C`` calling convention) and a
+trailing :samp:`@{nn}`, where ``nn`` is the overall size (in
bytes) of the parameters passed to the routine.
The name to use on the Ada side when importing a C routine with a
-`Stdcall` calling convention is the name of the C routine. The leading
+``Stdcall`` calling convention is the name of the C routine. The leading
underscore and trailing :samp:`@{nn}` are added automatically by
the compiler. For instance the Win32 function:
@@ -741,7 +743,7 @@ should be imported from Ada as follows:
pragma Import (Stdcall, Get_Val);
-- On the x86 a long is 4 bytes, so the Link_Name is "_get_val@4"
-As for the `C` calling convention, when the `External_Name`
+As for the ``C`` calling convention, when the ``External_Name``
parameter is missing, it is taken to be the name of the Ada entity in lower
case. If instead of writing the above import pragma you write:
@@ -750,16 +752,16 @@ case. If instead of writing the above import pragma you write:
function Get_Val (V : Interfaces.C.long) return Interfaces.C.int;
pragma Import (Stdcall, Get_Val, External_Name => "retrieve_val");
-then the imported routine is `_retrieve_val@4`. However, if instead
-of specifying the `External_Name` parameter you specify the
-`Link_Name` as in the following example:
+then the imported routine is ``_retrieve_val@4``. However, if instead
+of specifying the ``External_Name`` parameter you specify the
+``Link_Name`` as in the following example:
.. code-block:: ada
function Get_Val (V : Interfaces.C.long) return Interfaces.C.int;
pragma Import (Stdcall, Get_Val, Link_Name => "retrieve_val");
-then the imported routine is `retrieve_val`, that is, there is no
+then the imported routine is ``retrieve_val``, that is, there is no
decoration at all. No leading underscore and no Stdcall suffix
:samp:`@{nn}`.
@@ -783,25 +785,25 @@ then, to access this variable from Ada you should write:
pragma Import (Stdcall, My_Var);
Note that to ease building cross-platform bindings this convention
-will be handled as a `C` calling convention on non-Windows platforms.
+will be handled as a ``C`` calling convention on non-Windows platforms.
.. _Win32_Calling_Convention:
-`Win32` Calling Convention
-""""""""""""""""""""""""""
+``Win32`` Calling Convention
+""""""""""""""""""""""""""""
This convention, which is GNAT-specific is fully equivalent to the
-`Stdcall` calling convention described above.
+``Stdcall`` calling convention described above.
.. _DLL_Calling_Convention:
-`DLL` Calling Convention
-""""""""""""""""""""""""
+``DLL`` Calling Convention
+""""""""""""""""""""""""""
This convention, which is GNAT-specific is fully equivalent to the
-`Stdcall` calling convention described above.
+``Stdcall`` calling convention described above.
.. _Introduction_to_Dynamic_Link_Libraries_DLLs:
@@ -852,8 +854,8 @@ and you run your application, here is what happens:
which is part of your application are initialized with the addresses
of the routines and variables in :file:`API.dll`.
-* If present in :file:`API.dll`, routines `DllMain` or
- `DllMainCRTStartup` are invoked. These routines typically contain
+* If present in :file:`API.dll`, routines ``DllMain`` or
+ ``DllMainCRTStartup`` are invoked. These routines typically contain
the initialization code needed for the well-being of the routines and
variables exported by the DLL.
@@ -865,7 +867,7 @@ non-relocatable DLLs overlap and these happen to be used by the same
application, a conflict will occur and the application will run
incorrectly. Hence, when possible, it is always preferable to use and
build relocatable DLLs. Both relocatable and non-relocatable DLLs are
-supported by GNAT. Note that the *-s* linker option (see GNU Linker
+supported by GNAT. Note that the :switch:`-s` linker option (see GNU Linker
User's Guide) removes the debugging symbols from the DLL but the DLL can
still be relocated.
@@ -898,14 +900,14 @@ you must have:
* The actual DLL, :file:`API.dll`.
Once you have all the above, to compile an Ada application that uses the
-services of :file:`API.dll` and whose main subprogram is `My_Ada_App`,
+services of :file:`API.dll` and whose main subprogram is ``My_Ada_App``,
you simply issue the command
::
$ gnatmake my_ada_app -largs -lAPI
-The argument *-largs -lAPI* at the end of the *gnatmake* command
+The argument :switch:`-largs -lAPI` at the end of the ``gnatmake`` command
tells the GNAT linker to look for an import library. The linker will
look for a library name in this specific order:
@@ -926,8 +928,8 @@ following pragma
pragma Linker_Options ("-lAPI");
-you do not have to add *-largs -lAPI* at the end of the
-*gnatmake* command.
+you do not have to add :switch:`-largs -lAPI` at the end of the
+``gnatmake`` command.
If any one of the items above is missing you will have to create it
yourself. The following sections explain how to do so using as an
@@ -993,30 +995,30 @@ DLL. Otherwise read on.
As previously mentioned, and unlike Unix systems, the list of symbols
that are exported from a DLL must be provided explicitly in Windows.
The main goal of a definition file is precisely that: list the symbols
-exported by a DLL. A definition file (usually a file with a `.def`
+exported by a DLL. A definition file (usually a file with a ``.def``
suffix) has the following structure:
::
- [LIBRARY `name`]
- [DESCRIPTION `string`]
+ [LIBRARY ``name``]
+ [DESCRIPTION ``string``]
EXPORTS
- `symbol1`
- `symbol2`
+ ``symbol1``
+ ``symbol2``
...
-*LIBRARY `name`*
+*LIBRARY name*
This section, which is optional, gives the name of the DLL.
-*DESCRIPTION `string`*
+*DESCRIPTION string*
This section, which is optional, gives a description string that will be
embedded in the import library.
*EXPORTS*
This section gives the list of exported symbols (procedures, functions or
- variables). For instance in the case of :file:`API.dll` the `EXPORTS`
+ variables). For instance in the case of :file:`API.dll` the ``EXPORTS``
section of :file:`API.def` looks like:
::
@@ -1039,21 +1041,21 @@ sections are not relevant to the discussion at hand.
You can automatically create the definition file :file:`API.def`
(see :ref:`The Definition File <The_Definition_File>`) from a DLL.
-For that use the `dlltool` program as follows:
+For that use the ``dlltool`` program as follows:
::
$ dlltool API.dll -z API.def --export-all-symbols
- Note that if some routines in the DLL have the `Stdcall` convention
+ Note that if some routines in the DLL have the ``Stdcall`` convention
(:ref:`Windows_Calling_Conventions`) with stripped :samp:`@{nn}`
suffix then you'll have to edit :file:`api.def` to add it, and specify
- *-k* to *gnatdll* when creating the import library.
+ :switch:`-k` to ``gnatdll`` when creating the import library.
Here are some hints to find the right :samp:`@{nn}` suffix.
- If you have the Microsoft import library (.lib), it is possible to get
- the right symbols by using Microsoft `dumpbin` tool (see the
+ the right symbols by using Microsoft ``dumpbin`` tool (see the
corresponding Microsoft documentation for further details).
::
@@ -1070,22 +1072,22 @@ For that use the `dlltool` program as follows:
.. rubric:: GNAT-Style Import Library
To create a static import library from :file:`API.dll` with the GNAT tools
-you should create the .def file, then use `gnatdll` tool
+you should create the .def file, then use ``gnatdll`` tool
(see :ref:`Using_gnatdll`) as follows:
::
$ gnatdll -e API.def -d API.dll
- `gnatdll` takes as input a definition file :file:`API.def` and the
+ ``gnatdll`` takes as input a definition file :file:`API.def` and the
name of the DLL containing the services listed in the definition file
:file:`API.dll`. The name of the static import library generated is
computed from the name of the definition file as follows: if the
- definition file name is `xyz``.def`, the import library name will
- be `lib``xyz``.a`. Note that in the previous example option
- *-e* could have been removed because the name of the definition
- file (before the '`.def`' suffix) is the same as the name of the
- DLL (:ref:`Using_gnatdll` for more information about `gnatdll`).
+ definition file name is :file:`xyz.def`, the import library name will
+ be :file:`libxyz.a`. Note that in the previous example option
+ :switch:`-e` could have been removed because the name of the definition
+ file (before the ``.def`` suffix) is the same as the name of the
+ DLL (:ref:`Using_gnatdll` for more information about ``gnatdll``).
.. _MSVS-Style_Import_Library:
@@ -1098,7 +1100,7 @@ tools (:ref:`Mixed-Language_Programming_on_Windows`).
To create a Microsoft-style import library for :file:`API.dll` you
should create the .def file, then build the actual import library using
-Microsoft's `lib` utility:
+Microsoft's ``lib`` utility:
::
@@ -1112,7 +1114,7 @@ Microsoft's `lib` utility:
LIBRARY "API"
See the Microsoft documentation for further details about the usage of
- `lib`.
+ ``lib``.
.. _Building_DLLs_with_GNAT_Project_files:
@@ -1127,7 +1129,7 @@ See the *Library Projects* section in the *GNAT Project Manager*
chapter of the *GPRbuild User's Guide*.
Due to a system limitation, it is not possible under Windows to create threads
-when inside the `DllMain` routine which is used for auto-initialization
+when inside the ``DllMain`` routine which is used for auto-initialization
of shared libraries, so it is not possible to have library level tasks in SALs.
@@ -1145,11 +1147,11 @@ and use DLLs with GNAT.
* Building object files.
The first step is to build all objects files that are to be included
- into the DLL. This is done by using the standard *gnatmake* tool.
+ into the DLL. This is done by using the standard ``gnatmake`` tool.
* Building the DLL.
- To build the DLL you must use *gcc*'s *-shared* and
- *-shared-libgcc* options. It is quite simple to use this method:
+ To build the DLL you must use the ``gcc`` :switch:`-shared` and
+ :switch:`-shared-libgcc` options. It is quite simple to use this method:
::
@@ -1157,7 +1159,7 @@ and use DLLs with GNAT.
It is important to note that in this case all symbols found in the
object files are automatically exported. It is possible to restrict
- the set of symbols to export by passing to *gcc* a definition
+ the set of symbols to export by passing to ``gcc`` a definition
file (see :ref:`The Definition File <The_Definition_File>`).
For example:
@@ -1183,7 +1185,7 @@ and use DLLs with GNAT.
At this point it is possible to use the DLL by directly linking
against it. Note that you must use the GNAT shared runtime when using
-GNAT shared libraries. This is achieved by using *-shared* binder's
+GNAT shared libraries. This is achieved by using the :switch:`-shared` binder
option.
::
@@ -1203,26 +1205,26 @@ Note that it is preferred to use GNAT Project files
DLL support (:ref:`Building_DLLs_with_GNAT`) or to build DLLs.
This section explains how to build DLLs containing Ada code using
-`gnatdll`. These DLLs will be referred to as Ada DLLs in the
+``gnatdll``. These DLLs will be referred to as Ada DLLs in the
remainder of this section.
The steps required to build an Ada DLL that is to be used by Ada as well as
non-Ada applications are as follows:
-* You need to mark each Ada *entity* exported by the DLL with a `C` or
- `Stdcall` calling convention to avoid any Ada name mangling for the
+* You need to mark each Ada entity exported by the DLL with a ``C`` or
+ ``Stdcall`` calling convention to avoid any Ada name mangling for the
entities exported by the DLL
(see :ref:`Exporting Ada Entities <Exporting_Ada_Entities>`). You can
skip this step if you plan to use the Ada DLL only from Ada applications.
* Your Ada code must export an initialization routine which calls the routine
- `adainit` generated by *gnatbind* to perform the elaboration of
+ ``adainit`` generated by ``gnatbind`` to perform the elaboration of
the Ada code in the DLL (:ref:`Ada_DLLs_and_Elaboration`). The initialization
routine exported by the Ada DLL must be invoked by the clients of the DLL
to initialize the DLL.
* When useful, the DLL should also export a finalization routine which calls
- routine `adafinal` generated by *gnatbind* to perform the
+ routine ``adafinal`` generated by ``gnatbind`` to perform the
finalization of the Ada code in the DLL (:ref:`Ada_DLLs_and_Finalization`).
The finalization routine exported by the Ada DLL must be invoked by the
clients of the DLL when the DLL services are no further needed.
@@ -1233,12 +1235,12 @@ non-Ada applications are as follows:
* You must provide a definition file listing the exported entities
(:ref:`The Definition File <The_Definition_File>`).
-* Finally you must use `gnatdll` to produce the DLL and the import
+* Finally you must use ``gnatdll`` to produce the DLL and the import
library (:ref:`Using_gnatdll`).
-Note that a relocatable DLL stripped using the `strip`
+Note that a relocatable DLL stripped using the ``strip``
binutils tool will not be relocatable anymore. To build a DLL without
-debug information pass `-largs -s` to `gnatdll`. This
+debug information pass :switch:`-largs -s` to ``gnatdll``. This
restriction does not apply to a DLL built using a Library Project.
See the *Library Projects* section in the *GNAT Project Manager*
chapter of the *GPRbuild User's Guide*.
@@ -1259,7 +1261,7 @@ one in the main program.
It is therefore not possible to exchange GNAT run-time objects between the
Ada DLL and the main Ada program. Example of GNAT run-time objects are file
-handles (e.g., `Text_IO.File_Type`), tasks types, protected objects
+handles (e.g., ``Text_IO.File_Type``), tasks types, protected objects
types, etc.
It is completely safe to exchange plain elementary, array or record types,
@@ -1275,9 +1277,9 @@ Exporting Ada Entities
Building a DLL is a way to encapsulate a set of services usable from any
application. As a result, the Ada entities exported by a DLL should be
-exported with the `C` or `Stdcall` calling conventions to avoid
+exported with the ``C`` or ``Stdcall`` calling conventions to avoid
any Ada name mangling. As an example here is an Ada package
-`API`, spec and body, exporting two procedures, a function, and a
+``API``, spec and body, exporting two procedures, a function, and a
variable:
@@ -1327,7 +1329,7 @@ variable:
end API;
If the Ada DLL you are building will only be used by Ada applications
-you do not have to export Ada entities with a `C` or `Stdcall`
+you do not have to export Ada entities with a ``C`` or ``Stdcall``
convention. As an example, the previous package could be written as
follows:
@@ -1359,8 +1361,8 @@ follows:
-- The remainder of this package body is unchanged.
end API;
-Note that if you do not export the Ada entities with a `C` or
-`Stdcall` convention you will have to provide the mangled Ada names
+Note that if you do not export the Ada entities with a ``C`` or
+``Stdcall`` convention you will have to provide the mangled Ada names
in the definition file of the Ada DLL
(:ref:`Creating_the_Definition_File`).
@@ -1378,20 +1380,20 @@ user of your DLL must do is elaborate the Ada code
(:ref:`Elaboration_Order_Handling_in_GNAT`).
To achieve this you must export an initialization routine
-(`Initialize_API` in the previous example), which must be invoked
+(``Initialize_API`` in the previous example), which must be invoked
before using any of the DLL services. This elaboration routine must call
-the Ada elaboration routine `adainit` generated by the GNAT binder
+the Ada elaboration routine ``adainit`` generated by the GNAT binder
(:ref:`Binding_with_Non-Ada_Main_Programs`). See the body of
-`Initialize_Api` for an example. Note that the GNAT binder is
-automatically invoked during the DLL build process by the `gnatdll`
+``Initialize_Api`` for an example. Note that the GNAT binder is
+automatically invoked during the DLL build process by the ``gnatdll``
tool (:ref:`Using_gnatdll`).
When a DLL is loaded, Windows systematically invokes a routine called
-`DllMain`. It would therefore be possible to call `adainit`
-directly from `DllMain` without having to provide an explicit
+``DllMain``. It would therefore be possible to call ``adainit``
+directly from ``DllMain`` without having to provide an explicit
initialization routine. Unfortunately, it is not possible to call
-`adainit` from the `DllMain` if your program has library level
-tasks because access to the `DllMain` entry point is serialized by
+``adainit`` from the ``DllMain`` if your program has library level
+tasks because access to the ``DllMain`` entry point is serialized by
the system (that is, only a single thread can execute 'through' it at a
time), which means that the GNAT run time will deadlock waiting for the
newly created task to complete its initialization.
@@ -1408,11 +1410,11 @@ When the services of an Ada DLL are no longer needed, the client code should
invoke the DLL finalization routine, if available. The DLL finalization
routine is in charge of releasing all resources acquired by the DLL. In the
case of the Ada code contained in the DLL, this is achieved by calling
-routine `adafinal` generated by the GNAT binder
+routine ``adafinal`` generated by the GNAT binder
(:ref:`Binding_with_Non-Ada_Main_Programs`).
-See the body of `Finalize_Api` for an
+See the body of ``Finalize_Api`` for an
example. As already pointed out the GNAT binder is automatically invoked
-during the DLL build process by the `gnatdll` tool
+during the DLL build process by the ``gnatdll`` tool
(:ref:`Using_gnatdll`).
@@ -1423,7 +1425,7 @@ Creating a Spec for Ada DLLs
To use the services exported by the Ada DLL from another programming
language (e.g., C), you have to translate the specs of the exported Ada
-entities in that language. For instance in the case of `API.dll`,
+entities in that language. For instance in the case of ``API.dll``,
the corresponding C header file could look like:
.. code-block:: c
@@ -1435,10 +1437,10 @@ the corresponding C header file could look like:
It is important to understand that when building an Ada DLL to be used by
other Ada applications, you need two different specs for the packages
contained in the DLL: one for building the DLL and the other for using
-the DLL. This is because the `DLL` calling convention is needed to
+the DLL. This is because the ``DLL`` calling convention is needed to
use a variable defined in a DLL, but when building the DLL, the variable
-must have either the `Ada` or `C` calling convention. As an
-example consider a DLL comprising the following package `API`:
+must have either the ``Ada`` or ``C`` calling convention. As an
+example consider a DLL comprising the following package ``API``:
.. code-block:: ada
@@ -1448,8 +1450,8 @@ example consider a DLL comprising the following package `API`:
-- Remainder of the package omitted.
end API;
-After producing a DLL containing package `API`, the spec that
-must be used to import `API.Count` from Ada code outside of the
+After producing a DLL containing package ``API``, the spec that
+must be used to import ``API.Count`` from Ada code outside of the
DLL is:
.. code-block:: ada
@@ -1467,8 +1469,8 @@ Creating the Definition File
The definition file is the last file needed to build the DLL. It lists
the exported symbols. As an example, the definition file for a DLL
-containing only package `API` (where all the entities are exported
-with a `C` calling convention) is:
+containing only package ``API`` (where all the entities are exported
+with a ``C`` calling convention) is:
::
@@ -1478,7 +1480,7 @@ with a `C` calling convention) is:
finalize_api
initialize_api
-If the `C` calling convention is missing from package `API`,
+If the ``C`` calling convention is missing from package ``API``,
then the definition file contains the mangled Ada names of the above
entities, which in this case are:
@@ -1493,141 +1495,141 @@ entities, which in this case are:
.. _Using_gnatdll:
-Using `gnatdll`
-"""""""""""""""
+Using ``gnatdll``
+"""""""""""""""""
.. index:: gnatdll
-`gnatdll` is a tool to automate the DLL build process once all the Ada
+``gnatdll`` is a tool to automate the DLL build process once all the Ada
and non-Ada sources that make up your DLL have been compiled.
-`gnatdll` is actually in charge of two distinct tasks: build the
+``gnatdll`` is actually in charge of two distinct tasks: build the
static import library for the DLL and the actual DLL. The form of the
-`gnatdll` command is
+``gnatdll`` command is
::
- $ gnatdll [`switches`] `list-of-files` [-largs `opts`]
+ $ gnatdll [ switches ] list-of-files [ -largs opts ]
-where `list-of-files` is a list of ALI and object files. The object
+where ``list-of-files`` is a list of ALI and object files. The object
file list must be the exact list of objects corresponding to the non-Ada
sources whose services are to be included in the DLL. The ALI file list
must be the exact list of ALI files for the corresponding Ada sources
-whose services are to be included in the DLL. If `list-of-files` is
+whose services are to be included in the DLL. If ``list-of-files`` is
missing, only the static import library is generated.
-You may specify any of the following switches to `gnatdll`:
+You may specify any of the following switches to ``gnatdll``:
.. index:: -a (gnatdll)
-:samp:`-a[{address}]`
- Build a non-relocatable DLL at `address`. If `address` is not
- specified the default address `0x11000000` will be used. By default,
- when this switch is missing, `gnatdll` builds relocatable DLL. We
+:switch:`-a[{address}]`
+ Build a non-relocatable DLL at ``address``. If ``address`` is not
+ specified the default address ``0x11000000`` will be used. By default,
+ when this switch is missing, ``gnatdll`` builds relocatable DLL. We
advise the reader to build relocatable DLL.
.. index:: -b (gnatdll)
-:samp:`-b {address}`
+:switch:`-b {address}`
Set the relocatable DLL base address. By default the address is
- `0x11000000`.
+ ``0x11000000``.
.. index:: -bargs (gnatdll)
-:samp:`-bargs {opts}`
- Binder options. Pass `opts` to the binder.
+:switch:`-bargs {opts}`
+ Binder options. Pass ``opts`` to the binder.
.. index:: -d (gnatdll)
-:samp:`-d {dllfile}`
- `dllfile` is the name of the DLL. This switch must be present for
- `gnatdll` to do anything. The name of the generated import library is
- obtained algorithmically from `dllfile` as shown in the following
- example: if `dllfile` is `xyz.dll`, the import library name is
- `libxyz.dll.a`. The name of the definition file to use (if not specified
- by option *-e*) is obtained algorithmically from `dllfile`
+:switch:`-d {dllfile}`
+ ``dllfile`` is the name of the DLL. This switch must be present for
+ ``gnatdll`` to do anything. The name of the generated import library is
+ obtained algorithmically from ``dllfile`` as shown in the following
+ example: if ``dllfile`` is :file:`xyz.dll`, the import library name is
+ :file:`libxyz.dll.a`. The name of the definition file to use (if not specified
+ by option :switch:`-e`) is obtained algorithmically from ``dllfile``
as shown in the following example:
- if `dllfile` is `xyz.dll`, the definition
- file used is `xyz.def`.
+ if ``dllfile`` is :file:`xyz.dll`, the definition
+ file used is :file:`xyz.def`.
.. index:: -e (gnatdll)
-:samp:`-e {deffile}`
- `deffile` is the name of the definition file.
+:switch:`-e {deffile}`
+ ``deffile`` is the name of the definition file.
.. index:: -g (gnatdll)
-:samp:`-g`
+:switch:`-g`
Generate debugging information. This information is stored in the object
file and copied from there to the final DLL file by the linker,
where it can be read by the debugger. You must use the
- *-g* switch if you plan on using the debugger or the symbolic
+ :switch:`-g` switch if you plan on using the debugger or the symbolic
stack traceback.
.. index:: -h (gnatdll)
-:samp:`-h`
- Help mode. Displays `gnatdll` switch usage information.
+:switch:`-h`
+ Help mode. Displays ``gnatdll`` switch usage information.
.. index:: -I (gnatdll)
-:samp:`-I{dir}`
- Direct `gnatdll` to search the `dir` directory for source and
+:switch:`-I{dir}`
+ Direct ``gnatdll`` to search the ``dir`` directory for source and
object files needed to build the DLL.
(:ref:`Search_Paths_and_the_Run-Time_Library_RTL`).
.. index:: -k (gnatdll)
-:samp:`-k`
+:switch:`-k`
Removes the :samp:`@{nn}` suffix from the import library's exported
names, but keeps them for the link names. You must specify this
- option if you want to use a `Stdcall` function in a DLL for which
+ option if you want to use a ``Stdcall`` function in a DLL for which
the :samp:`@{nn}` suffix has been removed. This is the case for most
of the Windows NT DLL for example. This option has no effect when
- *-n* option is specified.
+ :switch:`-n` option is specified.
.. index:: -l (gnatdll)
-:samp:`-l {file}`
+:switch:`-l {file}`
The list of ALI and object files used to build the DLL are listed in
- `file`, instead of being given in the command line. Each line in
- `file` contains the name of an ALI or object file.
+ ``file``, instead of being given in the command line. Each line in
+ ``file`` contains the name of an ALI or object file.
.. index:: -n (gnatdll)
-:samp:`-n`
+:switch:`-n`
No Import. Do not create the import library.
.. index:: -q (gnatdll)
-:samp:`-q`
+:switch:`-q`
Quiet mode. Do not display unnecessary messages.
.. index:: -v (gnatdll)
-:samp:`-v`
+:switch:`-v`
Verbose mode. Display extra information.
.. index:: -largs (gnatdll)
-:samp:`-largs {opts}`
- Linker options. Pass `opts` to the linker.
+:switch:`-largs {opts}`
+ Linker options. Pass ``opts`` to the linker.
-.. rubric:: `gnatdll` Example
+.. rubric:: ``gnatdll`` Example
As an example the command to build a relocatable DLL from :file:`api.adb`
once :file:`api.adb` has been compiled and :file:`api.def` created is
@@ -1651,20 +1653,20 @@ Alternatively if you want to create just the import library, type:
$ gnatdll -d api.dll
-.. rubric:: `gnatdll` behind the Scenes
+.. rubric:: ``gnatdll`` behind the Scenes
-This section details the steps involved in creating a DLL. `gnatdll`
+This section details the steps involved in creating a DLL. ``gnatdll``
does these steps for you. Unless you are interested in understanding what
goes on behind the scenes, you should skip this section.
-We use the previous example of a DLL containing the Ada package `API`,
+We use the previous example of a DLL containing the Ada package ``API``,
to illustrate the steps necessary to build a DLL. The starting point is a
set of objects that will make up the DLL and the corresponding ALI
files. In the case of this example this means that :file:`api.o` and
-:file:`api.ali` are available. To build a relocatable DLL, `gnatdll` does
+:file:`api.ali` are available. To build a relocatable DLL, ``gnatdll`` does
the following:
-* `gnatdll` builds the base file (:file:`api.base`). A base file gives
+* ``gnatdll`` builds the base file (:file:`api.base`). A base file gives
the information necessary to generate relocation information for the
DLL.
@@ -1673,13 +1675,13 @@ the following:
$ gnatbind -n api
$ gnatlink api -o api.jnk -mdll -Wl,--base-file,api.base
- In addition to the base file, the *gnatlink* command generates an
- output file :file:`api.jnk` which can be discarded. The *-mdll* switch
- asks *gnatlink* to generate the routines `DllMain` and
- `DllMainCRTStartup` that are called by the Windows loader when the DLL
+ In addition to the base file, the ``gnatlink`` command generates an
+ output file :file:`api.jnk` which can be discarded. The :switch:`-mdll` switch
+ asks ``gnatlink`` to generate the routines ``DllMain`` and
+ ``DllMainCRTStartup`` that are called by the Windows loader when the DLL
is loaded into memory.
-* `gnatdll` uses `dlltool` (see :ref:`Using dlltool <Using_dlltool>`) to build the
+* ``gnatdll`` uses ``dlltool`` (see :ref:`Using dlltool <Using_dlltool>`) to build the
export table (:file:`api.exp`). The export table contains the relocation
information in a form which can be used during the final link to ensure
that the Windows loader is able to place the DLL anywhere in memory.
@@ -1689,9 +1691,9 @@ the following:
$ dlltool --dllname api.dll --def api.def --base-file api.base \\
--output-exp api.exp
-* `gnatdll` builds the base file using the new export table. Note that
- *gnatbind* must be called once again since the binder generated file
- has been deleted during the previous call to *gnatlink*.
+* ``gnatdll`` builds the base file using the new export table. Note that
+ ``gnatbind`` must be called once again since the binder generated file
+ has been deleted during the previous call to ``gnatlink``.
::
@@ -1700,7 +1702,7 @@ the following:
-Wl,--base-file,api.base
-* `gnatdll` builds the new export table using the new base file and
+* ``gnatdll`` builds the new export table using the new base file and
generates the DLL import library :file:`libAPI.dll.a`.
@@ -1709,7 +1711,7 @@ the following:
$ dlltool --dllname api.dll --def api.def --base-file api.base \\
--output-exp api.exp --output-lib libAPI.a
-* Finally `gnatdll` builds the relocatable DLL using the final export
+* Finally ``gnatdll`` builds the relocatable DLL using the final export
table.
::
@@ -1720,78 +1722,78 @@ the following:
.. _Using_dlltool:
-.. rubric:: Using `dlltool`
+.. rubric:: Using ``dlltool``
-`dlltool` is the low-level tool used by `gnatdll` to build
+``dlltool`` is the low-level tool used by ``gnatdll`` to build
DLLs and static import libraries. This section summarizes the most
-common `dlltool` switches. The form of the `dlltool` command
+common ``dlltool`` switches. The form of the ``dlltool`` command
is
::
$ dlltool [`switches`]
-`dlltool` switches include:
+``dlltool`` switches include:
.. index:: --base-file (dlltool)
-:samp:`--base-file {basefile}`
- Read the base file `basefile` generated by the linker. This switch
+:switch:`--base-file {basefile}`
+ Read the base file ``basefile`` generated by the linker. This switch
is used to create a relocatable DLL.
.. index:: --def (dlltool)
-:samp:`--def {deffile}`
+:switch:`--def {deffile}`
Read the definition file.
.. index:: --dllname (dlltool)
-:samp:`--dllname {name}`
+:switch:`--dllname {name}`
Gives the name of the DLL. This switch is used to embed the name of the
- DLL in the static import library generated by `dlltool` with switch
- *--output-lib*.
+ DLL in the static import library generated by ``dlltool`` with switch
+ :switch:`--output-lib`.
.. index:: -k (dlltool)
-:samp:`-k`
+:switch:`-k`
Kill :samp:`@{nn}` from exported names
(:ref:`Windows_Calling_Conventions`
- for a discussion about `Stdcall`-style symbols.
+ for a discussion about ``Stdcall``-style symbols.
.. index:: --help (dlltool)
-:samp:`--help`
- Prints the `dlltool` switches with a concise description.
+:switch:`--help`
+ Prints the ``dlltool`` switches with a concise description.
.. index:: --output-exp (dlltool)
-:samp:`--output-exp {exportfile}`
- Generate an export file `exportfile`. The export file contains the
+:switch:`--output-exp {exportfile}`
+ Generate an export file ``exportfile``. The export file contains the
export table (list of symbols in the DLL) and is used to create the DLL.
.. index:: --output-lib (dlltool)
-:samp:`--output-lib {libfile}`
- Generate a static import library `libfile`.
+:switch:`--output-lib {libfile}`
+ Generate a static import library ``libfile``.
.. index:: -v (dlltool)
-:samp:`-v`
+:switch:`-v`
Verbose mode.
.. index:: --as (dlltool)
-:samp:`--as {assembler-name}`
- Use `assembler-name` as the assembler. The default is `as`.
+:switch:`--as {assembler-name}`
+ Use ``assembler-name`` as the assembler. The default is ``as``.
.. _GNAT_and_Windows_Resources:
@@ -1857,8 +1859,8 @@ resource:
END
END
-The value `0809` (langID) is for the U.K English language and
-`04E4` (charsetID), which is equal to `1252` decimal, for
+The value ``0809`` (langID) is for the U.K English language and
+``04E4`` (charsetID), which is equal to ``1252`` decimal, for
multilingual.
This section explains how to build, compile and use resources. Note that this
@@ -1876,8 +1878,8 @@ Building Resources
A resource file is an ASCII file. By convention resource files have an
:file:`.rc` extension.
The easiest way to build a resource file is to use Microsoft tools
-such as `imagedit.exe` to build bitmaps, icons and cursors and
-`dlgedit.exe` to build dialogs.
+such as ``imagedit.exe`` to build bitmaps, icons and cursors and
+``dlgedit.exe`` to build dialogs.
It is always possible to build an :file:`.rc` file yourself by writing a
resource script.
@@ -1897,22 +1899,22 @@ Compiling Resources
This section describes how to build a GNAT-compatible (COFF) object file
containing the resources. This is done using the Resource Compiler
-`windres` as follows:
+``windres`` as follows:
::
$ windres -i myres.rc -o myres.o
-By default `windres` will run *gcc* to preprocess the :file:`.rc`
+By default ``windres`` will run ``gcc`` to preprocess the :file:`.rc`
file. You can specify an alternate preprocessor (usually named
-:file:`cpp.exe`) using the `windres` *--preprocessor*
+:file:`cpp.exe`) using the ``windres`` :switch:`--preprocessor`
parameter. A list of all possible options may be obtained by entering
-the command `windres` *--help*.
+the command ``windres`` :switch:`--help`.
-It is also possible to use the Microsoft resource compiler `rc.exe`
+It is also possible to use the Microsoft resource compiler ``rc.exe``
to produce a :file:`.res` file (binary resource file). See the
corresponding Microsoft documentation for further details. In this case
-you need to use `windres` to translate the :file:`.res` file to a
+you need to use ``windres`` to translate the :file:`.res` file to a
GNAT-compatible object file as follows:
::
@@ -1929,7 +1931,7 @@ Using Resources
To include the resource file in your program just add the
GNAT-compatible object file for the resource(s) to the linker
-arguments. With *gnatmake* this is done by using the *-largs*
+arguments. With ``gnatmake`` this is done by using the :switch:`-largs`
option:
::
@@ -1951,7 +1953,7 @@ be developed following the general guidelines outlined above; below is the
cookbook-style sequence of steps to follow:
1. First develop and build the GNAT shared library using a library project
- (let's assume the project is `mylib.gpr`, producing the library `libmylib.dll`):
+ (let's assume the project is :file:`mylib.gpr`, producing the library :file:`libmylib.dll`):
::
@@ -2000,15 +2002,15 @@ Debugging a DLL is similar to debugging a standard program. But
we have to deal with two different executable parts: the DLL and the
program that uses it. We have the following four possibilities:
-* The program and the DLL are built with `GCC/GNAT`.
+* The program and the DLL are built with GCC/GNAT.
* The program is built with foreign tools and the DLL is built with
- `GCC/GNAT`.
-* The program is built with `GCC/GNAT` and the DLL is built with
+ GCC/GNAT.
+* The program is built with GCC/GNAT and the DLL is built with
foreign tools.
In this section we address only cases one and two above.
There is no point in trying to debug
-a DLL with `GNU/GDB`, if there is no GDB-compatible debugging
+a DLL with GNU/GDB, if there is no GDB-compatible debugging
information in it. To do so you must use a debugger compatible with the
tools suite used to build the DLL.
@@ -2017,17 +2019,17 @@ tools suite used to build the DLL.
Program and DLL Both Built with GCC/GNAT
""""""""""""""""""""""""""""""""""""""""
-This is the simplest case. Both the DLL and the program have `GDB`
+This is the simplest case. Both the DLL and the program have ``GDB``
compatible debugging information. It is then possible to break anywhere in
the process. Let's suppose here that the main procedure is named
-`ada_main` and that in the DLL there is an entry point named
-`ada_dll`.
+``ada_main`` and that in the DLL there is an entry point named
+``ada_dll``.
The DLL (:ref:`Introduction_to_Dynamic_Link_Libraries_DLLs`) and
program must have been built with the debugging information (see GNAT -g
switch). Here are the step-by-step instructions for debugging it:
-* Launch `GDB` on the main program.
+* Launch ``GDB`` on the main program.
::
@@ -2064,18 +2066,18 @@ Program Built with Foreign Tools and DLL Built with GCC/GNAT
In this case things are slightly more complex because it is not possible to
start the main program and then break at the beginning to load the DLL and the
associated DLL debugging information. It is not possible to break at the
-beginning of the program because there is no `GDB` debugging information,
+beginning of the program because there is no ``GDB`` debugging information,
and therefore there is no direct way of getting initial control. This
section addresses this issue by describing some methods that can be used
to break somewhere in the DLL to debug it.
-First suppose that the main procedure is named `main` (this is for
+First suppose that the main procedure is named ``main`` (this is for
example some C code built with Microsoft Visual C) and that there is a
-DLL named `test.dll` containing an Ada entry point named
-`ada_dll`.
+DLL named ``test.dll`` containing an Ada entry point named
+``ada_dll``.
The DLL (see :ref:`Introduction_to_Dynamic_Link_Libraries_DLLs`) must have
-been built with debugging information (see GNAT `-g` option).
+been built with debugging information (see the GNAT :switch:`-g` option).
.. rubric:: Debugging the DLL Directly
@@ -2141,7 +2143,7 @@ It is also possible to debug the DLL by attaching to a running process.
.. index:: DLL debugging, attach to process
-With `GDB` it is always possible to debug a running process by
+With ``GDB`` it is always possible to debug a running process by
attaching to it. It is possible to debug a DLL this way. The limitation
of this approach is that the DLL must run long enough to perform the
attach operation. It may be useful for instance to insert a time wasting
@@ -2194,8 +2196,8 @@ approach to debug a program as described in
.. _Setting_Stack_Size_from_gnatlink:
-Setting Stack Size from *gnatlink*
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Setting Stack Size from ``gnatlink``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is possible to specify the program stack size at link time. On modern
versions of Windows, starting with XP, this is mostly useful to set the size of
@@ -2208,10 +2210,10 @@ tasks, and pragma Storage_Size has no effect.
In particular, Stack Overflow checks are made against this
link-time specified size.
-This setting can be done with *gnatlink* using either of the following:
+This setting can be done with ``gnatlink`` using either of the following:
-* *-Xlinker* linker option
+* :switch:`-Xlinker` linker option
::
@@ -2221,26 +2223,26 @@ This setting can be done with *gnatlink* using either of the following:
This sets the stack reserve size to 0x10000 bytes and the stack commit
size to 0x1000 bytes.
-* *-Wl* linker option
+* :switch:`-Wl` linker option
::
$ gnatlink hello -Wl,--stack=0x1000000
This sets the stack reserve size to 0x1000000 bytes. Note that with
- *-Wl* option it is not possible to set the stack commit size
+ :switch:`-Wl` option it is not possible to set the stack commit size
because the comma is a separator for this option.
.. _Setting_Heap_Size_from_gnatlink:
-Setting Heap Size from *gnatlink*
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Setting Heap Size from ``gnatlink``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Under Windows systems, it is possible to specify the program heap size from
-*gnatlink* using either of the following:
+``gnatlink`` using either of the following:
-* *-Xlinker* linker option
+* :switch:`-Xlinker` linker option
::
@@ -2249,7 +2251,7 @@ Under Windows systems, it is possible to specify the program heap size from
This sets the heap reserve size to 0x10000 bytes and the heap commit
size to 0x1000 bytes.
-* *-Wl* linker option
+* :switch:`-Wl` linker option
::
@@ -2257,7 +2259,7 @@ Under Windows systems, it is possible to specify the program heap size from
This sets the heap reserve size to 0x1000000 bytes. Note that with
- *-Wl* option it is not possible to set the heap commit size
+ :switch:`-Wl` option it is not possible to set the heap commit size
because the comma is a separator for this option.
diff --git a/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst b/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst
index d4985cd..258494f 100644
--- a/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst
+++ b/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst
@@ -1,3 +1,5 @@
+.. role:: switch(samp)
+
.. |with| replace:: *with*
.. |withs| replace:: *with*\ s
.. |withed| replace:: *with*\ ed
@@ -56,20 +58,20 @@ representing foreign languages (see :ref:`Foreign_Language_Representation`
for support of non-USA character sets). The format effector characters
are represented using their standard ASCII encodings, as follows:
- =========== ======================= =========
+ =========== ======================= ===========
Character Effect Code
- ----------- ----------------------- ---------
- :kbd:`VT` Vertical tab `16#0B#`
- :kbd:`HT` Horizontal tab `16#09#`
- :kbd:`CR` Carriage return `16#0D#`
- :kbd:`LF` Line feed `16#0A#`
- :kbd:`FF` Form feed `16#0C#`
- =========== ======================= =========
+ ----------- ----------------------- -----------
+ :kbd:`VT` Vertical tab ``16#0B#``
+ :kbd:`HT` Horizontal tab ``16#09#``
+ :kbd:`CR` Carriage return ``16#0D#``
+ :kbd:`LF` Line feed ``16#0A#``
+ :kbd:`FF` Form feed ``16#0C#``
+ =========== ======================= ===========
Source files are in standard text file format. In addition, GNAT will
recognize a wide variety of stream formats, in which the end of
physical lines is marked by any of the following sequences:
-`LF`, `CR`, `CR-LF`, or `LF-CR`. This is useful
+``LF``, ``CR``, ``CR-LF``, or ``LF-CR``. This is useful
in accommodating files that are imported from other operating systems.
.. index:: pair: End of source file; Source file, end
@@ -77,7 +79,7 @@ in accommodating files that are imported from other operating systems.
.. index:: SUB (control character)
The end of a source file is normally represented by the physical end of
-file. However, the control character `16#1A#` (:kbd:`SUB`) is also
+file. However, the control character ``16#1A#`` (:kbd:`SUB`) is also
recognized as signalling the end of the source file. Again, this is
provided for compatibility with other operating systems where this
code is used to represent the end of file.
@@ -86,8 +88,8 @@ code is used to represent the end of file.
Each file contains a single Ada compilation unit, including any pragmas
associated with the unit. For example, this means you must place a
-package declaration (a package `spec`) and the corresponding body in
-separate files. An Ada `compilation` (which is a sequence of
+package declaration (a package *spec*) and the corresponding body in
+separate files. An Ada *compilation* (which is a sequence of
compilation units) is represented using a sequence of files. Similarly,
you will place each subunit or child unit in a separate file.
@@ -108,8 +110,8 @@ Latin-1
.. index:: Latin-1
The basic character set is Latin-1. This character set is defined by ISO
-standard 8859, part 1. The lower half (character codes `16#00#`
-... `16#7F#)` is identical to standard ASCII coding, but the upper
+standard 8859, part 1. The lower half (character codes ``16#00#``
+... ``16#7F#)`` is identical to standard ASCII coding, but the upper
half is used to represent additional characters. These include extended letters
used by European languages, such as French accents, the vowels with umlauts
used in German, and the extra letter A-ring used in Swedish.
@@ -117,7 +119,7 @@ used in German, and the extra letter A-ring used in Swedish.
.. index:: Ada.Characters.Latin_1
For a complete list of Latin-1 codes and their encodings, see the source
-file of library unit `Ada.Characters.Latin_1` in file
+file of library unit ``Ada.Characters.Latin_1`` in file
:file:`a-chlat1.ads`.
You may use any of these extended characters freely in character or
string literals. In addition, the extended characters that represent
@@ -218,18 +220,18 @@ possible encoding schemes:
ESC a b c d
- where `a`, `b`, `c`, `d` are the four hexadecimal
+ where ``a``, ``b``, ``c``, ``d`` are the four hexadecimal
characters (using uppercase letters) of the wide character code. For
example, ESC A345 is used to represent the wide character with code
- `16#A345#`.
+ ``16#A345#``.
This scheme is compatible with use of the full Wide_Character set.
*Upper-Half Coding*
.. index:: Upper-Half Coding
- The wide character with encoding `16#abcd#` where the upper bit is on
+ The wide character with encoding ``16#abcd#`` where the upper bit is on
(in other words, 'a' is in the range 8-F) is represented as two bytes,
- `16#ab#` and `16#cd#`. The second byte cannot be a format control
+ ``16#ab#`` and ``16#cd#``. The second byte cannot be a format control
character, but is not required to be in the upper half. This method can
be also used for shift-JIS or EUC, where the internal coding matches the
external coding.
@@ -238,8 +240,8 @@ possible encoding schemes:
.. index:: Shift JIS Coding
A wide character is represented by a two-character sequence,
- `16#ab#` and
- `16#cd#`, with the restrictions described for upper-half encoding as
+ ``16#ab#`` and
+ ``16#cd#``, with the restrictions described for upper-half encoding as
described above. The internal character code is the corresponding JIS
character according to the standard algorithm for Shift-JIS
conversion. Only characters defined in the JIS code set table can be
@@ -250,8 +252,8 @@ possible encoding schemes:
.. index:: EUC Coding
A wide character is represented by a two-character sequence
- `16#ab#` and
- `16#cd#`, with both characters being in the upper half. The internal
+ ``16#ab#`` and
+ ``16#cd#``, with both characters being in the upper half. The internal
character code is the corresponding JIS character according to the EUC
encoding algorithm. Only characters defined in the JIS code set table
can be used with this encoding method.
@@ -263,11 +265,11 @@ possible encoding schemes:
10646-1/Am.2. Depending on the character value, the representation
is a one, two, or three byte sequence::
- 16#0000#-16#007f#: 2#0`xxxxxxx`#
- 16#0080#-16#07ff#: 2#110`xxxxx`# 2#10`xxxxxx`#
- 16#0800#-16#ffff#: 2#1110`xxxx`# 2#10`xxxxxx`# 2#10`xxxxxx`#
+ 16#0000#-16#007f#: 2#0xxxxxxx#
+ 16#0080#-16#07ff#: 2#110xxxxx# 2#10xxxxxx#
+ 16#0800#-16#ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
- where the `xxx` bits correspond to the left-padded bits of the
+ where the ``xxx`` bits correspond to the left-padded bits of the
16-bit character value. Note that all lower half ASCII characters
are represented as ASCII bytes and all upper half characters and
other wide characters are represented as sequences of upper-half
@@ -282,12 +284,12 @@ possible encoding schemes:
[ " a b c d " ]
- where `a`, `b`, `c`, `d` are the four hexadecimal
+ where ``a``, ``b``, ``c``, ``d`` are the four hexadecimal
characters (using uppercase letters) of the wide character code. For
example, ['A345'] is used to represent the wide character with code
- `16#A345#`. It is also possible (though not required) to use the
+ ``16#A345#``. It is also possible (though not required) to use the
Brackets coding for upper half characters. For example, the code
- `16#A3#` can be represented as `['A3']`.
+ ``16#A3#`` can be represented as ``['A3']``.
This scheme is compatible with use of the full Wide_Character set,
and is also the method used for wide character encoding in some standard
@@ -323,7 +325,7 @@ possible encoding schemes:
10xxxxxx 10xxxxxx 10xxxxxx
- where the `xxx` bits correspond to the left-padded bits of the
+ where the ``xxx`` bits correspond to the left-padded bits of the
32-bit character value.
*Brackets Coding*
@@ -333,10 +335,10 @@ possible encoding schemes:
[ " a b c d e f " ]
[ " a b c d e f g h " ]
- where `a-h` are the six or eight hexadecimal
+ where ``a-h`` are the six or eight hexadecimal
characters (using uppercase letters) of the wide wide character code. For
example, ["1F4567"] is used to represent the wide wide character with code
- `16#001F_4567#`.
+ ``16#001F_4567#``.
This scheme is compatible with use of the full Wide_Wide_Character set,
and is also the method used for wide wide character encoding in some standard
@@ -365,12 +367,12 @@ lowercase for all letters.
An exception arises if the file name generated by the above rules starts
with one of the characters
-`a`, `g`, `i`, or `s`, and the second character is a
+``a``, ``g``, ``i``, or ``s``, and the second character is a
minus. In this case, the character tilde is used in place
of the minus. The reason for this special rule is to avoid clashes with
the standard names for child units of the packages System, Ada,
Interfaces, and GNAT, which use the prefixes
-`s-`, `a-`, `i-`, and `g-`,
+``s-``, ``a-``, ``i-``, and ``g-``,
respectively.
The file extension is :file:`.ads` for a spec and
@@ -408,8 +410,8 @@ utility to produce source files that follow the GNAT naming conventions.
(For details see :ref:`Renaming_Files_with_gnatchop`.)
Note: in the case of Windows or Mac OS operating systems, case is not
-significant. So for example on `Windows` if the canonical name is
-`main-sub.adb`, you can use the file name :file:`Main-Sub.adb` instead.
+significant. So for example on Windows if the canonical name is
+:file:`main-sub.adb`, you can use the file name :file:`Main-Sub.adb` instead.
However, case is significant for other operating systems, so for example,
if you want to use other than canonically cased file names on a Unix system,
you need to follow the procedures described in the next section.
@@ -461,17 +463,17 @@ GNAT allows completely arbitrary file names to be specified using the
source file name pragma. However, if the file name specified has an
extension other than :file:`.ads` or :file:`.adb` it is necessary to use
a special syntax when compiling the file. The name in this case must be
-preceded by the special sequence *-x* followed by a space and the name
-of the language, here `ada`, as in:
+preceded by the special sequence ``-x`` followed by a space and the name
+of the language, here ``ada``, as in:
.. code-block:: sh
$ gcc -c -x ada peculiar_file_name.sim
-`gnatmake` handles non-standard file names in the usual manner (the
+``gnatmake`` handles non-standard file names in the usual manner (the
non-standard file name for the main program is simply used as the
argument to gnatmake). Note that if the extension is also non-standard,
-then it must be included in the `gnatmake` command, it may not
+then it must be included in the ``gnatmake`` command, it may not
be omitted.
.. _Alternative_File_Naming_Schemes:
@@ -483,7 +485,7 @@ Alternative File Naming Schemes
.. index:: File names
-The previous section described the use of the `Source_File_Name`
+The previous section described the use of the ``Source_File_Name``
pragma to allow arbitrary names to be assigned to individual source files.
However, this approach requires one pragma for each file, and especially in
large systems can result in very long :file:`gnat.adc` files, and also create
@@ -494,7 +496,7 @@ a maintenance problem.
GNAT also provides a facility for specifying systematic file naming schemes
other than the standard default naming scheme previously described. An
alternative scheme for naming is specified by the use of
-`Source_File_Name` pragmas having the following format:
+``Source_File_Name`` pragmas having the following format:
.. code-block:: ada
@@ -516,29 +518,29 @@ alternative scheme for naming is specified by the use of
FILE_NAME_PATTERN ::= STRING_LITERAL
CASING_SPEC ::= Lowercase | Uppercase | Mixedcase
-The `FILE_NAME_PATTERN` string shows how the file name is constructed.
+The ``FILE_NAME_PATTERN`` string shows how the file name is constructed.
It contains a single asterisk character, and the unit name is substituted
systematically for this asterisk. The optional parameter
-`Casing` indicates
+``Casing`` indicates
whether the unit name is to be all upper-case letters, all lower-case letters,
or mixed-case. If no
-`Casing` parameter is used, then the default is all
+``Casing`` parameter is used, then the default is all
lower-case.
-The optional `Dot_Replacement` string is used to replace any periods
-that occur in subunit or child unit names. If no `Dot_Replacement`
+The optional ``Dot_Replacement`` string is used to replace any periods
+that occur in subunit or child unit names. If no ``Dot_Replacement``
argument is used then separating dots appear unchanged in the resulting
file name.
Although the above syntax indicates that the
-`Casing` argument must appear
-before the `Dot_Replacement` argument, but it
+``Casing`` argument must appear
+before the ``Dot_Replacement`` argument, but it
is also permissible to write these arguments in the opposite order.
As indicated, it is possible to specify different naming schemes for
bodies, specs, and subunits. Quite often the rule for subunits is the
same as the rule for bodies, in which case, there is no need to give
-a separate `Subunit_File_Name` rule, and in this case the
-`Body_File_name` rule is used for subunits as well.
+a separate ``Subunit_File_Name`` rule, and in this case the
+``Body_File_name`` rule is used for subunits as well.
The separate rule for subunits can also be used to implement the rather
unusual case of a compilation environment (e.g., a single directory) which
@@ -549,15 +551,15 @@ in the same environment.
The file name translation works in the following steps:
-* If there is a specific `Source_File_Name` pragma for the given unit,
+* If there is a specific ``Source_File_Name`` pragma for the given unit,
then this is always used, and any general pattern rules are ignored.
-* If there is a pattern type `Source_File_Name` pragma that applies to
+* If there is a pattern type ``Source_File_Name`` pragma that applies to
the unit, then the resulting file name will be used if the file exists. If
more than one pattern matches, the latest one will be tried first, and the
first attempt resulting in a reference to a file that exists will be used.
-* If no pattern type `Source_File_Name` pragma that applies to the unit
+* If no pattern type ``Source_File_Name`` pragma that applies to the unit
for which the corresponding file exists, then the standard GNAT default
naming rules are used.
@@ -613,8 +615,8 @@ the same double underscore separator for child units.
.. _Handling_Arbitrary_File_Naming_Conventions_with_gnatname:
-Handling Arbitrary File Naming Conventions with `gnatname`
-----------------------------------------------------------
+Handling Arbitrary File Naming Conventions with ``gnatname``
+------------------------------------------------------------
.. index:: File Naming Conventions
@@ -625,7 +627,7 @@ Arbitrary File Naming Conventions
The GNAT compiler must be able to know the source file name of a compilation
unit. When using the standard GNAT default file naming conventions
-(`.ads` for specs, `.adb` for bodies), the GNAT compiler
+(``.ads`` for specs, ``.adb`` for bodies), the GNAT compiler
does not need additional information.
When the source file names do not follow the standard GNAT default file naming
@@ -633,48 +635,48 @@ conventions, the GNAT compiler must be given additional information through
a configuration pragmas file (:ref:`Configuration_Pragmas`)
or a project file.
When the non-standard file naming conventions are well-defined,
-a small number of pragmas `Source_File_Name` specifying a naming pattern
+a small number of pragmas ``Source_File_Name`` specifying a naming pattern
(:ref:`Alternative_File_Naming_Schemes`) may be sufficient. However,
if the file naming conventions are irregular or arbitrary, a number
-of pragma `Source_File_Name` for individual compilation units
+of pragma ``Source_File_Name`` for individual compilation units
must be defined.
To help maintain the correspondence between compilation unit names and
source file names within the compiler,
-GNAT provides a tool `gnatname` to generate the required pragmas for a
+GNAT provides a tool ``gnatname`` to generate the required pragmas for a
set of files.
.. _Running_gnatname:
-Running `gnatname`
-^^^^^^^^^^^^^^^^^^
+Running ``gnatname``
+^^^^^^^^^^^^^^^^^^^^
-The usual form of the `gnatname` command is:
+The usual form of the ``gnatname`` command is:
.. code-block:: sh
- $ gnatname [`switches`] `naming_pattern` [`naming_patterns`]
- [--and [`switches`] `naming_pattern` [`naming_patterns`]]
+ $ gnatname [ switches ] naming_pattern [ naming_patterns ]
+ [--and [ switches ] naming_pattern [ naming_patterns ]]
All of the arguments are optional. If invoked without any argument,
-`gnatname` will display its usage.
+``gnatname`` will display its usage.
-When used with at least one naming pattern, `gnatname` will attempt to
+When used with at least one naming pattern, ``gnatname`` will attempt to
find all the compilation units in files that follow at least one of the
naming patterns. To find these compilation units,
-`gnatname` will use the GNAT compiler in syntax-check-only mode on all
+``gnatname`` will use the GNAT compiler in syntax-check-only mode on all
regular files.
-One or several Naming Patterns may be given as arguments to `gnatname`.
+One or several Naming Patterns may be given as arguments to ``gnatname``.
Each Naming Pattern is enclosed between double quotes (or single
quotes on Windows).
A Naming Pattern is a regular expression similar to the wildcard patterns
used in file names by the Unix shells or the DOS prompt.
-`gnatname` may be called with several sections of directories/patterns.
-Sections are separated by switch `--and`. In each section, there must be
+``gnatname`` may be called with several sections of directories/patterns.
+Sections are separated by the switch :switch:`--and`. In each section, there must be
at least one pattern. If no directory is specified in a section, the current
-directory (or the project directory is `-P` is used) is implied.
+directory (or the project directory if :switch:`-P` is used) is implied.
The options other that the directory switches and the patterns apply globally
even if they are in different sections.
@@ -688,94 +690,94 @@ For a more complete description of the syntax of Naming Patterns,
see the second kind of regular expressions described in :file:`g-regexp.ads`
(the 'Glob' regular expressions).
-When invoked with no switch `-P`, `gnatname` will create a
+When invoked without the switch :switch:`-P`, ``gnatname`` will create a
configuration pragmas file :file:`gnat.adc` in the current working directory,
-with pragmas `Source_File_Name` for each file that contains a valid Ada
+with pragmas ``Source_File_Name`` for each file that contains a valid Ada
unit.
.. _Switches_for_gnatname:
-Switches for `gnatname`
-^^^^^^^^^^^^^^^^^^^^^^^
+Switches for ``gnatname``
+^^^^^^^^^^^^^^^^^^^^^^^^^
-Switches for `gnatname` must precede any specified Naming Pattern.
+Switches for ``gnatname`` must precede any specified Naming Pattern.
-You may specify any of the following switches to `gnatname`:
+You may specify any of the following switches to ``gnatname``:
.. index:: --version (gnatname)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatname)
-:samp:`--help`
- If *--version* was not used, display usage, then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage, then exit disregarding
all other options.
-:samp:`--subdirs={dir}`
+:switch:`--subdirs={dir}`
Real object, library or exec directories are subdirectories <dir> of the
specified ones.
-:samp:`--no-backup`
+:switch:`--no-backup`
Do not create a backup copy of an existing project file.
-:samp:`--and`
+:switch:`--and`
Start another section of directories/patterns.
.. index:: -c (gnatname)
-:samp:`-c{filename}`
+:switch:`-c{filename}`
Create a configuration pragmas file :file:`filename` (instead of the default
:file:`gnat.adc`).
- There may be zero, one or more space between *-c* and
+ There may be zero, one or more space between :switch:`-c` and
:file:`filename`.
:file:`filename` may include directory information. :file:`filename` must be
- writable. There may be only one switch *-c*.
- When a switch *-c* is
- specified, no switch *-P* may be specified (see below).
+ writable. There may be only one switch :switch:`-c`.
+ When a switch :switch:`-c` is
+ specified, no switch :switch:`-P` may be specified (see below).
.. index:: -d (gnatname)
-:samp:`-d{dir}`
+:switch:`-d{dir}`
Look for source files in directory :file:`dir`. There may be zero, one or more
- spaces between *-d* and :file:`dir`.
- :file:`dir` may end with `/**`, that is it may be of the form
- `root_dir/**`. In this case, the directory `root_dir` and all of its
+ spaces between :switch:`-d` and :file:`dir`.
+ :file:`dir` may end with ``/**``, that is it may be of the form
+ ``root_dir/**``. In this case, the directory ``root_dir`` and all of its
subdirectories, recursively, have to be searched for sources.
- When a switch *-d*
+ When a switch :switch:`-d`
is specified, the current working directory will not be searched for source
- files, unless it is explicitly specified with a *-d*
- or *-D* switch.
- Several switches *-d* may be specified.
+ files, unless it is explicitly specified with a :switch:`-d`
+ or :switch:`-D` switch.
+ Several switches :switch:`-d` may be specified.
If :file:`dir` is a relative path, it is relative to the directory of
the configuration pragmas file specified with switch
- *-c*,
+ :switch:`-c`,
or to the directory of the project file specified with switch
- *-P* or,
- if neither switch *-c*
- nor switch *-P* are specified, it is relative to the
+ :switch:`-P` or,
+ if neither switch :switch:`-c`
+ nor switch :switch:`-P` are specified, it is relative to the
current working directory. The directory
- specified with switch *-d* must exist and be readable.
+ specified with switch :switch:`-d` must exist and be readable.
.. index:: -D (gnatname)
-:samp:`-D{filename}`
+:switch:`-D{filename}`
Look for source files in all directories listed in text file :file:`filename`.
- There may be zero, one or more spaces between *-D*
+ There may be zero, one or more spaces between :switch:`-D`
and :file:`filename`.
:file:`filename` must be an existing, readable text file.
Each nonempty line in :file:`filename` must be a directory.
- Specifying switch *-D* is equivalent to specifying as many
- switches *-d* as there are nonempty lines in
+ Specifying switch :switch:`-D` is equivalent to specifying as many
+ switches :switch:`-d` as there are nonempty lines in
:file:`file`.
-:samp:`-eL`
+:switch:`-eL`
Follow symbolic links when processing project files.
.. index:: -f (gnatname)
-:samp:`-f{pattern}`
+:switch:`-f{pattern}`
Foreign patterns. Using this switch, it is possible to add sources of languages
other than Ada to the list of sources of a project file.
It is only useful if a -P switch is used.
@@ -791,26 +793,26 @@ You may specify any of the following switches to `gnatname`:
.. index:: -h (gnatname)
-:samp:`-h`
+:switch:`-h`
Output usage (help) information. The output is written to :file:`stdout`.
.. index:: -P (gnatname)
-:samp:`-P{proj}`
+:switch:`-P{proj}`
Create or update project file :file:`proj`. There may be zero, one or more space
- between *-P* and :file:`proj`. :file:`proj` may include directory
+ between :switch:`-P` and :file:`proj`. :file:`proj` may include directory
information. :file:`proj` must be writable.
- There may be only one switch *-P*.
- When a switch *-P* is specified,
- no switch *-c* may be specified.
- On all platforms, except on VMS, when `gnatname` is invoked for an
+ There may be only one switch :switch:`-P`.
+ When a switch :switch:`-P` is specified,
+ no switch :switch:`-c` may be specified.
+ On all platforms, except on VMS, when ``gnatname`` is invoked for an
existing project file <proj>.gpr, a backup copy of the project file is created
in the project directory with file name <proj>.gpr.saved_x. 'x' is the first
non negative number that makes this backup copy a new file.
.. index:: -v (gnatname)
-:samp:`-v`
+:switch:`-v`
Verbose mode. Output detailed explanation of behavior to :file:`stdout`.
This includes name of the file written, the name of the directories to search
and, for each file in those directories whose name matches at least one of
@@ -819,14 +821,14 @@ You may specify any of the following switches to `gnatname`:
.. index:: -v -v (gnatname)
-:samp:`-v -v`
+:switch:`-v -v`
Very Verbose mode. In addition to the output produced in verbose mode,
for each file in the searched directories whose name matches none of
the Naming Patterns, an indication is given that there is no match.
.. index:: -x (gnatname)
-:samp:`-x{pattern}`
+:switch:`-x{pattern}`
Excluded patterns. Using this switch, it is possible to exclude some files
that would match the name patterns. For example,
@@ -840,8 +842,8 @@ You may specify any of the following switches to `gnatname`:
.. _Examples_of_gnatname_Usage:
-Examples of `gnatname` Usage
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Examples of ``gnatname`` Usage
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: sh
@@ -850,38 +852,38 @@ Examples of `gnatname` Usage
In this example, the directory :file:`/home/me` must already exist
and be writable. In addition, the directory
:file:`/home/me/sources` (specified by
-*-d sources*) must exist and be readable.
+:switch:`-d sources`) must exist and be readable.
-Note the optional spaces after *-c* and *-d*.
+Note the optional spaces after :switch:`-c` and :switch:`-d`.
.. code-block:: sh
$ gnatname -P/home/me/proj -x "*_nt_body.ada"
-dsources -dsources/plus -Dcommon_dirs.txt "body_*" "spec_*"
-Note that several switches *-d* may be used,
+Note that several switches :switch:`-d` may be used,
even in conjunction with one or several switches
-*-D*. Several Naming Patterns and one excluded pattern
+:switch:`-D`. Several Naming Patterns and one excluded pattern
are used in this example.
.. _File_Name_Krunching_with_gnatkr:
-File Name Krunching with `gnatkr`
----------------------------------
+File Name Krunching with ``gnatkr``
+-----------------------------------
.. index:: ! gnatkr
This section discusses the method used by the compiler to shorten
the default file names chosen for Ada units so that they do not
exceed the maximum length permitted. It also describes the
-`gnatkr` utility that can be used to determine the result of
+``gnatkr`` utility that can be used to determine the result of
applying this shortening.
.. _About_gnatkr:
-About `gnatkr`
-^^^^^^^^^^^^^^
+About ``gnatkr``
+^^^^^^^^^^^^^^^^
The default file naming rule in GNAT
is that the file name must be derived from
@@ -902,26 +904,26 @@ the unit name. The exact default rule is as follows:
:samp:`s-`, :samp:`a-`, :samp:`i-`, and :samp:`g-`,
respectively.
-The :samp:`-gnatk{nn}`
+The :switch:`-gnatk{nn}`
switch of the compiler activates a 'krunching'
circuit that limits file names to nn characters (where nn is a decimal
integer).
-The `gnatkr` utility can be used to determine the krunched name for
+The ``gnatkr`` utility can be used to determine the krunched name for
a given file, when krunched to a specified maximum length.
.. _Using_gnatkr:
-Using `gnatkr`
-^^^^^^^^^^^^^^
+Using ``gnatkr``
+^^^^^^^^^^^^^^^^
-The `gnatkr` command has the form:
+The ``gnatkr`` command has the form:
.. code-block:: sh
- $ gnatkr `name` [`length`]
+ $ gnatkr name [ length ]
-`name` is the uncrunched file name, derived from the name of the unit
+``name`` is the uncrunched file name, derived from the name of the unit
in the standard manner described in the previous section (i.e., in particular
all dots are replaced by hyphens). The file name may or may not have an
extension (defined as a suffix of the form period followed by arbitrary
@@ -929,9 +931,9 @@ characters other than period). If an extension is present then it will
be preserved in the output. For example, when krunching :file:`hellofile.ads`
to eight characters, the result will be hellofil.ads.
-Note: for compatibility with previous versions of `gnatkr` dots may
+Note: for compatibility with previous versions of ``gnatkr`` dots may
appear in the name instead of hyphens, but the last dot will always be
-taken as the start of an extension. So if `gnatkr` is given an argument
+taken as the start of an extension. So if ``gnatkr`` is given an argument
such as :file:`Hello.World.adb` it will be treated exactly as if the first
period had been a hyphen, and for example krunching to eight characters
gives the result :file:`hellworl.adb`.
@@ -939,7 +941,7 @@ gives the result :file:`hellworl.adb`.
Note that the result is always all lower case.
Characters of the other case are folded as required.
-`length` represents the length of the krunched name. The default
+``length`` represents the length of the krunched name. The default
when no argument is given is 8 characters. A length of zero stands for
unlimited, in other words do not chop except for system files where the
implied crunching length is always eight characters.
@@ -959,8 +961,8 @@ using lowercase
for all letters, except that a hyphen in the second character position is
replaced by a tilde if the first character is
:samp:`a`, :samp:`i`, :samp:`g`, or :samp:`s`.
-The extension is `.ads` for a
-spec and `.adb` for a body.
+The extension is ``.ads`` for a
+spec and ``.adb`` for a body.
Krunching does not affect the extension, but the file name is shortened to
the specified length by following these rules:
@@ -1027,13 +1029,13 @@ the specified length by following these rules:
Of course no file shortening algorithm can guarantee uniqueness over all
possible unit names, and if file name krunching is used then it is your
responsibility to ensure that no name clashes occur. The utility
-program `gnatkr` is supplied for conveniently determining the
+program ``gnatkr`` is supplied for conveniently determining the
krunched name of a file.
.. _Examples_of_gnatkr_Usage:
-Examples of `gnatkr` Usage
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+Examples of ``gnatkr`` Usage
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
@@ -1047,13 +1049,13 @@ Examples of `gnatkr` Usage
.. _Renaming_Files_with_gnatchop:
-Renaming Files with `gnatchop`
-------------------------------
+Renaming Files with ``gnatchop``
+--------------------------------
.. index:: ! gnatchop
This section discusses how to handle files with multiple units by using
-the `gnatchop` utility. This utility is also useful in renaming
+the ``gnatchop`` utility. This utility is also useful in renaming
files to meet the standard GNAT default file naming conventions.
.. _Handling_Files_with_Multiple_Units:
@@ -1065,21 +1067,21 @@ The basic compilation model of GNAT requires that a file submitted to the
compiler have only one unit and there be a strict correspondence
between the file name and the unit name.
-The `gnatchop` utility allows both of these rules to be relaxed,
+The ``gnatchop`` utility allows both of these rules to be relaxed,
allowing GNAT to process files which contain multiple compilation units
-and files with arbitrary file names. `gnatchop`
+and files with arbitrary file names. ``gnatchop``
reads the specified file and generates one or more output files,
containing one unit per file. The unit and the file name correspond,
as required by GNAT.
If you want to permanently restructure a set of 'foreign' files so that
they match the GNAT rules, and do the remaining development using the
-GNAT structure, you can simply use *gnatchop* once, generate the
+GNAT structure, you can simply use ``gnatchop`` once, generate the
new set of files and work with them from that point on.
Alternatively, if you want to keep your files in the 'foreign' format,
perhaps to maintain compatibility with some other Ada compilation
-system, you can set up a procedure where you use *gnatchop* each
+system, you can set up a procedure where you use ``gnatchop`` each
time you compile, regarding the source files that it writes as temporary
files that you throw away.
@@ -1093,7 +1095,7 @@ automatically in UTF-8 mode without needing to specify an explicit encoding.
Operating gnatchop in Compilation Mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-The basic function of `gnatchop` is to take a file with multiple units
+The basic function of ``gnatchop`` is to take a file with multiple units
and split it into separate files. The boundary between files is reasonably
clear, except for the issue of comments and pragmas. In default mode, the
rule is that any pragmas between units belong to the previous unit, except
@@ -1103,17 +1105,17 @@ almost always result in the right choice of
the split point without needing to mark it explicitly and most users will
find this default to be what they want. In this default mode it is incorrect to
submit a file containing only configuration pragmas, or one that ends in
-configuration pragmas, to `gnatchop`.
+configuration pragmas, to ``gnatchop``.
However, using a special option to activate 'compilation mode',
-`gnatchop`
+``gnatchop``
can perform another function, which is to provide exactly the semantics
required by the RM for handling of configuration pragmas in a compilation.
In the absence of configuration pragmas (at the main file level), this
option has no effect, but it causes such configuration pragmas to be handled
in a quite different manner.
-First, in compilation mode, if `gnatchop` is given a file that consists of
+First, in compilation mode, if ``gnatchop`` is given a file that consists of
only configuration pragmas, then this file is appended to the
:file:`gnat.adc` file in the current directory. This behavior provides
the required behavior described in the RM for the actions to be taken
@@ -1124,7 +1126,7 @@ environment. Using GNAT, the current directory, possibly containing a
of a compilation environment. For more information on the
:file:`gnat.adc` file, see :ref:`Handling_of_Configuration_Pragmas`.
-Second, in compilation mode, if `gnatchop`
+Second, in compilation mode, if ``gnatchop``
is given a file that starts with
configuration pragmas, and contains one or more units, then these
configuration pragmas are prepended to each of the chopped files. This
@@ -1140,21 +1142,21 @@ a unit. This provides the required RM behavior that forbids configuration
pragmas other than those preceding the first compilation unit of a
compilation.
-For most purposes, `gnatchop` will be used in default mode. The
+For most purposes, ``gnatchop`` will be used in default mode. The
compilation mode described above is used only if you need exactly
accurate behavior with respect to compilations, and you have files
that contain multiple units and configuration pragmas. In this
-circumstance the use of `gnatchop` with the compilation mode
+circumstance the use of ``gnatchop`` with the compilation mode
switch provides the required behavior, and is for example the mode
in which GNAT processes the ACVC tests.
.. _Command_Line_for_gnatchop:
-Command Line for `gnatchop`
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Command Line for ``gnatchop``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-The `gnatchop` command has the form:
+The ``gnatchop`` command has the form:
.. code-block:: sh
@@ -1166,10 +1168,10 @@ There are no restrictions on the form of this file name. The file itself
contains one or more Ada units, in normal GNAT format, concatenated
together. As shown, more than one file may be presented to be chopped.
-When run in default mode, `gnatchop` generates one output file in
+When run in default mode, ``gnatchop`` generates one output file in
the current directory for each unit in each of the files.
-`directory`, if specified, gives the name of the directory to which
+``directory``, if specified, gives the name of the directory to which
the output files will be written. If it is not specified, all files are
written to the current directory.
@@ -1224,106 +1226,106 @@ will not produce any new file and will result in the following warnings::
.. _Switches_for_gnatchop:
-Switches for `gnatchop`
-^^^^^^^^^^^^^^^^^^^^^^^
+Switches for ``gnatchop``
+^^^^^^^^^^^^^^^^^^^^^^^^^
-*gnatchop* recognizes the following switches:
+``gnatchop`` recognizes the following switches:
.. index:: --version (gnatchop)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatchop)
-:samp:`--help`
- If *--version* was not used, display usage, then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage, then exit disregarding
all other options.
.. index:: -c (gnatchop)
-:samp:`-c`
- Causes `gnatchop` to operate in compilation mode, in which
+:switch:`-c`
+ Causes ``gnatchop`` to operate in compilation mode, in which
configuration pragmas are handled according to strict RM rules. See
previous section for a full description of this mode.
-:samp:`-gnat{xxx}`
- This passes the given *-gnat`xxx*` switch to `gnat` which is
- used to parse the given file. Not all `xxx` options make sense,
- but for example, the use of *-gnati2* allows `gnatchop` to
+:switch:`-gnat{xxx}`
+ This passes the given :switch:`-gnat{xxx}` switch to ``gnat`` which is
+ used to parse the given file. Not all *xxx* options make sense,
+ but for example, the use of :switch:`-gnati2` allows ``gnatchop`` to
process a source file that uses Latin-2 coding for identifiers.
-:samp:`-h`
- Causes `gnatchop` to generate a brief help summary to the standard
+:switch:`-h`
+ Causes ``gnatchop`` to generate a brief help summary to the standard
output file showing usage information.
.. index:: -k (gnatchop)
-:samp:`-k{mm}`
- Limit generated file names to the specified number `mm`
+:switch:`-k{mm}`
+ Limit generated file names to the specified number ``mm``
of characters.
This is useful if the
resulting set of files is required to be interoperable with systems
which limit the length of file names.
- No space is allowed between the *-k* and the numeric value. The numeric
- value may be omitted in which case a default of *-k8*,
+ No space is allowed between the :switch:`-k` and the numeric value. The numeric
+ value may be omitted in which case a default of :switch:`-k8`,
suitable for use
- with DOS-like file systems, is used. If no *-k* switch
+ with DOS-like file systems, is used. If no :switch:`-k` switch
is present then
there is no limit on the length of file names.
.. index:: -p (gnatchop)
-:samp:`-p`
+:switch:`-p`
Causes the file modification time stamp of the input file to be
preserved and used for the time stamp of the output file(s). This may be
useful for preserving coherency of time stamps in an environment where
- `gnatchop` is used as part of a standard build process.
+ ``gnatchop`` is used as part of a standard build process.
.. index:: -q (gnatchop)
-:samp:`-q`
+:switch:`-q`
Causes output of informational messages indicating the set of generated
files to be suppressed. Warnings and error messages are unaffected.
.. index:: -r (gnatchop)
.. index:: Source_Reference pragmas
-:samp:`-r`
- Generate `Source_Reference` pragmas. Use this switch if the output
+:switch:`-r`
+ Generate ``Source_Reference`` pragmas. Use this switch if the output
files are regarded as temporary and development is to be done in terms
of the original unchopped file. This switch causes
- `Source_Reference` pragmas to be inserted into each of the
+ ``Source_Reference`` pragmas to be inserted into each of the
generated files to refers back to the original file name and line number.
The result is that all error messages refer back to the original
unchopped file.
In addition, the debugging information placed into the object file (when
- the *-g* switch of *gcc* or *gnatmake* is
+ the :switch:`-g` switch of ``gcc`` or ``gnatmake`` is
specified)
also refers back to this original file so that tools like profilers and
debuggers will give information in terms of the original unchopped file.
If the original file to be chopped itself contains
- a `Source_Reference`
+ a ``Source_Reference``
pragma referencing a third file, then gnatchop respects
- this pragma, and the generated `Source_Reference` pragmas
+ this pragma, and the generated ``Source_Reference`` pragmas
in the chopped file refer to the original file, with appropriate
- line numbers. This is particularly useful when `gnatchop`
- is used in conjunction with `gnatprep` to compile files that
+ line numbers. This is particularly useful when ``gnatchop``
+ is used in conjunction with ``gnatprep`` to compile files that
contain preprocessing statements and multiple units.
.. index:: -v (gnatchop)
-:samp:`-v`
- Causes `gnatchop` to operate in verbose mode. The version
+:switch:`-v`
+ Causes ``gnatchop`` to operate in verbose mode. The version
number and copyright notice are output, as well as exact copies of
the gnat1 commands spawned to obtain the chop control information.
.. index:: -w (gnatchop)
-:samp:`-w`
- Overwrite existing file names. Normally `gnatchop` regards it as a
+:switch:`-w`
+ Overwrite existing file names. Normally ``gnatchop`` regards it as a
fatal error if there is already a file with the same name as a
file it would otherwise output, in other words if the files to be
chopped contain duplicated units. This switch bypasses this
@@ -1332,15 +1334,15 @@ Switches for `gnatchop`
.. index:: --GCC= (gnatchop)
-:samp:`--GCC={xxxx}`
+:switch:`--GCC={xxxx}`
Specify the path of the GNAT parser to be used. When this switch is used,
no attempt is made to add the prefix to the GNAT parser executable.
.. _Examples_of_gnatchop_Usage:
-Examples of `gnatchop` Usage
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Examples of ``gnatchop`` Usage
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: sh
@@ -1358,11 +1360,11 @@ directory are modified).
Chops the source file :file:`archive`
into the current directory. One
-useful application of `gnatchop` is in sending sets of sources
+useful application of ``gnatchop`` is in sending sets of sources
around, for example in email messages. The required sources are simply
-concatenated (for example, using a Unix `cat`
+concatenated (for example, using a Unix ``cat``
command), and then
-*gnatchop* is used at the other end to reconstitute the original
+``gnatchop`` is used at the other end to reconstitute the original
file names.
.. code-block:: sh
@@ -1373,7 +1375,7 @@ Chops all units in files :file:`file1`, :file:`file2`, :file:`file3`, placing
the resulting files in the directory :file:`direc`. Note that if any units
occur more than once anywhere within this set of files, an error message
is generated, and no files are written. To override this check, use the
-*-w* switch,
+:switch:`-w` switch,
in which case the last occurrence in the last file will
be the one that is output, and earlier duplicate occurrences for a given
unit will be skipped.
@@ -1390,10 +1392,10 @@ Configuration Pragmas
Configuration pragmas include those pragmas described as
such in the Ada Reference Manual, as well as
implementation-dependent pragmas that are configuration pragmas.
-See the `Implementation_Defined_Pragmas` chapter in the
+See the ``Implementation_Defined_Pragmas`` chapter in the
:title:`GNAT_Reference_Manual` for details on these
additional GNAT-specific configuration pragmas.
-Most notably, the pragma `Source_File_Name`, which allows
+Most notably, the pragma ``Source_File_Name``, which allows
specifying non-default names for source files, is a configuration
pragma. The following is a complete list of configuration pragmas
recognized by GNAT::
@@ -1409,42 +1411,53 @@ recognized by GNAT::
Assertion_Policy
Assume_No_Invalid_Values
C_Pass_By_Copy
+ Check_Float_Overflow
Check_Name
Check_Policy
Compile_Time_Error
Compile_Time_Warning
Compiler_Unit
+ Compiler_Unit_Warning
Component_Alignment
Convention_Identifier
Debug_Policy
Detect_Blocking
+ Default_Scalar_Storage_Order
Default_Storage_Pool
+ Disable_Atomic_Synchronization
Discard_Names
Elaboration_Checks
Eliminate
+ Enable_Atomic_Synchronization
Extend_System
Extensions_Allowed
External_Name_Casing
Fast_Math
Favor_Top_Level
- Float_Representation
+ Ignore_Pragma
Implicit_Packing
Initialize_Scalars
Interrupt_State
License
Locking_Policy
- Long_Float
+ No_Component_Reordering
+ No_Heap_Finalization
No_Run_Time
No_Strict_Aliasing
Normalize_Scalars
Optimize_Alignment
+ Overflow_Mode
+ Overriding_Renamings
+ Partition_Elaboration_Policy
Persistent_BSS
Polling
+ Prefix_Exception_Messages
Priority_Specific_Dispatching
Profile
Profile_Warnings
Propagate_Exceptions
Queuing_Policy
+ Rational
Ravenscar
Rename_Pragma
Restricted_Run_Time
@@ -1452,6 +1465,7 @@ recognized by GNAT::
Restrictions_Warnings
Reviewable
Short_Circuit_And_Or
+ Short_Descriptors
Source_File_Name
Source_File_Name_Project
SPARK_Mode
@@ -1459,10 +1473,12 @@ recognized by GNAT::
Suppress
Suppress_Exception_Locations
Task_Dispatching_Policy
+ Unevaluated_Use_Of_Old
Universal_Data
Unsuppress
Use_VADS_Size
Validity_Checks
+ Warning_As_Error
Warnings
Wide_Character_Encoding
@@ -1476,7 +1492,7 @@ Configuration pragmas may either appear at the start of a compilation
unit, or they can appear in a configuration pragma file to apply to
all compilations performed in a given compilation environment.
-GNAT also provides the `gnatchop` utility to provide an automatic
+GNAT also provides the ``gnatchop`` utility to provide an automatic
way to handle configuration pragmas following the semantics for
compilations (that is, files with multiple units), described in the RM.
See :ref:`Operating_gnatchop_in_Compilation_Mode` for details.
@@ -1484,12 +1500,12 @@ However, for most purposes, it will be more convenient to edit the
:file:`gnat.adc` file that contains configuration pragmas directly,
as described in the following section.
-In the case of `Restrictions` pragmas appearing as configuration
+In the case of ``Restrictions`` pragmas appearing as configuration
pragmas in individual compilation units, the exact handling depends on
the type of restriction.
Restrictions that require partition-wide consistency (like
-`No_Tasking`) are
+``No_Tasking``) are
recognized wherever they appear
and can be freely inherited, e.g. from a |withed| unit to the |withing|
unit. This makes sense since the binder will in any case insist on seeing
@@ -1521,34 +1537,34 @@ directory at the time that a compile command is given. This current
directory is searched for a file whose name is :file:`gnat.adc`. If
this file is present, it is expected to contain one or more
configuration pragmas that will be applied to the current compilation.
-However, if the switch *-gnatA* is used, :file:`gnat.adc` is not
+However, if the switch :switch:`-gnatA` is used, :file:`gnat.adc` is not
considered. When taken into account, :file:`gnat.adc` is added to the
dependencies, so that if :file:`gnat.adc` is modified later, an invocation of
-*gnatmake* will recompile the source.
+``gnatmake`` will recompile the source.
Configuration pragmas may be entered into the :file:`gnat.adc` file
-either by running `gnatchop` on a source file that consists only of
+either by running ``gnatchop`` on a source file that consists only of
configuration pragmas, or more conveniently by direct editing of the
:file:`gnat.adc` file, which is a standard format source file.
Besides :file:`gnat.adc`, additional files containing configuration
pragmas may be applied to the current compilation using the switch
-:samp:`-gnatec={path}` where `path` must designate an existing file that
+:switch:`-gnatec={path}` where ``path`` must designate an existing file that
contains only configuration pragmas. These configuration pragmas are
in addition to those found in :file:`gnat.adc` (provided :file:`gnat.adc`
-is present and switch *-gnatA* is not used).
+is present and switch :switch:`-gnatA` is not used).
-It is allowable to specify several switches *-gnatec=*, all of which
+It is allowable to specify several switches :switch:`-gnatec=`, all of which
will be taken into account.
Files containing configuration pragmas specified with switches
-*-gnatec=* are added to the dependencies, unless they are
+:switch:`-gnatec=` are added to the dependencies, unless they are
temporary files. A file is considered temporary if its name ends in
:file:`.tmp` or :file:`.TMP`. Certain tools follow this naming
-convention because they pass information to *gcc* via
+convention because they pass information to ``gcc`` via
temporary files that are immediately deleted; it doesn't make sense to
depend on a file that no longer exists. Such tools include
-*gprbuild*, *gnatmake*, and *gnatcheck*.
+``gprbuild``, ``gnatmake``, and ``gnatcheck``.
If you are using project file, a separate mechanism is provided using
project attributes.
@@ -1612,7 +1628,7 @@ compilations will fail if there is an error in the spec.
GNAT provides an option for compiling such files purely for the
purposes of checking correctness; such compilations are not required as
part of the process of building a program. To compile a file in this
-checking mode, use the *-gnatc* switch.
+checking mode, use the :switch:`-gnatc` switch.
.. _Source_Dependencies:
@@ -1621,14 +1637,14 @@ Source Dependencies
A given object file clearly depends on the source file which is compiled
to produce it. Here we are using "depends" in the sense of a typical
-`make` utility; in other words, an object file depends on a source
+``make`` utility; in other words, an object file depends on a source
file if changes to the source file require the object file to be
recompiled.
In addition to this basic dependency, a given object may depend on
additional source files as follows:
-* If a file being compiled |withs| a unit `X`, the object file
- depends on the file containing the spec of unit `X`. This includes
+* If a file being compiled |withs| a unit ``X``, the object file
+ depends on the file containing the spec of unit ``X``. This includes
files that are |withed| implicitly either because they are parents
of |withed| child units or they are run-time units required by the
language constructs used in a particular unit.
@@ -1645,22 +1661,22 @@ additional source files as follows:
.. index:: -gnatn switch
* If a file being compiled contains a call to a subprogram for which
- pragma `Inline` applies and inlining is activated with the
- *-gnatn* switch, the object file depends on the file containing the
+ pragma ``Inline`` applies and inlining is activated with the
+ :switch:`-gnatn` switch, the object file depends on the file containing the
body of this subprogram as well as on the file containing the spec. Note
that for inlining to actually occur as a result of the use of this switch,
it is necessary to compile in optimizing mode.
.. index:: -gnatN switch
- The use of *-gnatN* activates inlining optimization
+ The use of :switch:`-gnatN` activates inlining optimization
that is performed by the front end of the compiler. This inlining does
- not require that the code generation be optimized. Like *-gnatn*,
+ not require that the code generation be optimized. Like :switch:`-gnatn`,
the use of this switch generates additional dependencies.
When using a gcc-based back end (in practice this means using any version
of GNAT other than for the JVM, .NET or GNAAMP platforms), then the use of
- *-gnatN* is deprecated, and the use of *-gnatn* is preferred.
+ :switch:`-gnatN` is deprecated, and the use of :switch:`-gnatn` is preferred.
Historically front end inlining was more extensive than the gcc back end
inlining, but that is no longer the case.
@@ -1674,10 +1690,10 @@ additional source files as follows:
* The previous two rules meant that for purposes of computing dependencies and
recompilation, a body and all its subunits are treated as an indivisible whole.
- These rules are applied transitively: if unit `A` |withs|
- unit `B`, whose elaboration calls an inlined procedure in package
- `C`, the object file for unit `A` will depend on the body of
- `C`, in file :file:`c.adb`.
+ These rules are applied transitively: if unit ``A`` |withs|
+ unit ``B``, whose elaboration calls an inlined procedure in package
+ ``C``, the object file for unit ``A`` will depend on the body of
+ ``C``, in file :file:`c.adb`.
The set of dependent files described by these rules includes all the
files on which the unit is semantically dependent, as dictated by the
@@ -1687,11 +1703,11 @@ additional source files as follows:
An object file must be recreated by recompiling the corresponding source
file if any of the source files on which it depends are modified. For
- example, if the `make` utility is used to control compilation,
+ example, if the ``make`` utility is used to control compilation,
the rule for an Ada object file must mention all the source files on
which the object file depends, according to the above definition.
The determination of the necessary
- recompilations is done automatically when one uses *gnatmake*.
+ recompilations is done automatically when one uses ``gnatmake``.
.. _The_Ada_Library_Information_Files:
@@ -1715,7 +1731,7 @@ The following information is contained in the :file:`ALI` file.
* Main program information (including priority and time slice settings,
as well as the wide character encoding used during compilation).
-* List of arguments used in the *gcc* command for the compilation
+* List of arguments used in the ``gcc`` command for the compilation
* Attributes of the unit, including configuration pragmas used, an indication
of whether the compilation was successful, exception model used etc.
@@ -1723,14 +1739,14 @@ The following information is contained in the :file:`ALI` file.
* A list of relevant restrictions applying to the unit (used for consistency)
checking.
-* Categorization information (e.g., use of pragma `Pure`).
+* Categorization information (e.g., use of pragma ``Pure``).
* Information on all |withed| units, including presence of
- Elaborate` or `Elaborate_All` pragmas.
+ ``Elaborate`` or ``Elaborate_All`` pragmas.
-* Information from any `Linker_Options` pragmas used in the unit
+* Information from any ``Linker_Options`` pragmas used in the unit
-* Information on the use of `Body_Version` or `Version`
+* Information on the use of ``Body_Version`` or ``Version``
attributes in the unit.
* Dependency information. This is a list of files, together with
@@ -1739,11 +1755,11 @@ The following information is contained in the :file:`ALI` file.
if any of these units are modified.
* Cross-reference data. Contains information on all entities referenced
- in the unit. Used by tools like `gnatxref` and `gnatfind` to
+ in the unit. Used by tools like ``gnatxref`` and ``gnatfind`` to
provide cross-reference information.
For a full detailed description of the format of the :file:`ALI` file,
-see the source of the body of unit `Lib.Writ`, contained in file
+see the source of the body of unit ``Lib.Writ``, contained in file
:file:`lib-writ.adb` in the GNAT compiler sources.
@@ -1776,7 +1792,7 @@ compilation unit that require them, followed by
a call to the main program. This Ada program is compiled to generate the
object file for the main program. The name of
the Ada file is :file:`b~xxx`.adb` (with the corresponding spec
-:file:`b~xxx`.ads`) where `xxx` is the name of the
+:file:`b~xxx`.ads`) where ``xxx`` is the name of the
main program unit.
Finally, the linker is used to build the resulting executable program,
@@ -1856,22 +1872,22 @@ which supports a special type of project called a *Library Project*
chapter of the *GPRbuild User's Guide*).
A project is considered a library project, when two project-level attributes
-are defined in it: `Library_Name` and `Library_Dir`. In order to
+are defined in it: ``Library_Name`` and ``Library_Dir``. In order to
control different aspects of library configuration, additional optional
project-level attributes can be specified:
-* *Library_Kind*
+* ``Library_Kind``
This attribute controls whether the library is to be static or dynamic
-* *Library_Version*
+* ``Library_Version``
This attribute specifies the library version; this value is used
during dynamic linking of shared libraries to determine if the currently
installed versions of the binaries are compatible.
-* *Library_Options*
+* ``Library_Options``
-* *Library_GCC*
+* ``Library_GCC``
These attributes specify additional low-level options to be used during
library generation, and redefine the actual application used to generate
library.
@@ -1910,7 +1926,7 @@ library: for example with a Makefile (:ref:`Using_the_GNU_make_Utility`) or
with a conventional script. For simple libraries, it is also possible to create
a dummy main program which depends upon all the packages that comprise the
interface of the library. This dummy main program can then be given to
-*gnatmake*, which will ensure that all necessary objects are built.
+``gnatmake``, which will ensure that all necessary objects are built.
After this task is accomplished, you should follow the standard procedure
of the underlying operating system to produce the static or shared library.
@@ -1954,7 +1970,7 @@ Here are the generic commands that will build an archive or a shared library.
Please note that the library must have a name of the form :file:`lib{xxx}.a`
or :file:`lib{xxx}.so` (or :file:`lib{xxx}.dll` on Windows) in order to
-be accessed by the directive :samp:`-l{xxx}` at link time.
+be accessed by the directive :switch:`-l{xxx}` at link time.
.. _Installing_a_library:
@@ -2003,10 +2019,10 @@ contain the location for the GNAT run-time objects (which can simply
be :file:`adalib`).
You can also specify a new default path to the run-time library at compilation
-time with the switch *--RTS=rts-path*. You can thus choose / change
+time with the switch :switch:`--RTS=rts-path`. You can thus choose / change
the run-time library you want your program to be compiled with. This switch is
-recognized by *gcc*, *gnatmake*, *gnatbind*,
-*gnatls*, *gnatfind* and *gnatxref*.
+recognized by ``gcc``, ``gnatmake``, ``gnatbind``,
+``gnatls``, ``gnatfind`` and ``gnatxref``.
It is possible to install a library before or after the standard GNAT
library, by reordering the lines in the configuration files. In general, a
@@ -2021,7 +2037,7 @@ Using a library
Once again, the project facility greatly simplifies the use of
libraries. In this context, using a library is just a matter of adding a
|with| clause in the user project. For instance, to make use of the
-library `My_Lib` shown in examples in earlier sections, you can
+library ``My_Lib`` shown in examples in earlier sections, you can
write:
.. code-block:: gpr
@@ -2046,7 +2062,7 @@ third-party library :file:`liba.a`:
for Library_Kind use "static";
end Liba;
-This is an alternative to the use of `pragma Linker_Options`. It is
+This is an alternative to the use of ``pragma Linker_Options``. It is
especially interesting in the context of systems with several interdependent
static libraries where finding a proper linker order is not easy and best be
left to the tools having visibility over project dependence information.
@@ -2082,7 +2098,7 @@ when the following conditions are met:
variable :envvar:`ADA_OBJECTS_PATH`, or by the administrator to the file
:file:`ada_object_path`
-* a pragma `Linker_Options` has been added to one of the sources.
+* a pragma ``Linker_Options`` has been added to one of the sources.
For example:
.. code-block:: ada
@@ -2126,7 +2142,7 @@ The main purpose of a SAL is to minimize the recompilation overhead of client
applications when a new version of the library is installed. Specifically,
if the interface sources have not changed, client applications do not need to
be recompiled. If, furthermore, a SAL is provided in the shared form and its
-version, controlled by `Library_Version` attribute, is not changed,
+version, controlled by ``Library_Version`` attribute, is not changed,
then the clients do not need to be relinked.
SALs also allow the library providers to minimize the amount of library source
@@ -2145,10 +2161,10 @@ GNAT's Project facility provides a simple way of building and installing
stand-alone libraries; see the *Stand-alone Library Projects* section
in the *GNAT Project Manager* chapter of the *GPRbuild User's Guide*.
To be a Stand-alone Library Project, in addition to the two attributes
-that make a project a Library Project (`Library_Name` and
-`Library_Dir`; see the *Library Projects* section in the
+that make a project a Library Project (``Library_Name`` and
+``Library_Dir``; see the *Library Projects* section in the
*GNAT Project Manager* chapter of the *GPRbuild User's Guide*),
-the attribute `Library_Interface` must be defined. For example:
+the attribute ``Library_Interface`` must be defined. For example:
.. code-block:: gpr
@@ -2156,7 +2172,7 @@ the attribute `Library_Interface` must be defined. For example:
for Library_Name use "dummy";
for Library_Interface use ("int1", "int1.child");
-Attribute `Library_Interface` has a non-empty string list value,
+Attribute ``Library_Interface`` has a non-empty string list value,
each string in the list designating a unit contained in an immediate source
of the project file.
@@ -2165,18 +2181,18 @@ a package whose name depends on the library name
(:file:`b~dummy.ads/b` in the example above).
This binder-generated package includes initialization and
finalization procedures whose
-names depend on the library name (`dummyinit` and `dummyfinal`
+names depend on the library name (``dummyinit`` and ``dummyfinal``
in the example
above). The object corresponding to this package is included in the library.
You must ensure timely (e.g., prior to any use of interfaces in the SAL)
calling of these procedures if a static SAL is built, or if a shared SAL
is built
-with the project-level attribute `Library_Auto_Init` set to
-`"false"`.
+with the project-level attribute ``Library_Auto_Init`` set to
+``"false"``.
For a Stand-Alone Library, only the :file:`ALI` files of the Interface Units
-(those that are listed in attribute `Library_Interface`) are copied to
+(those that are listed in attribute ``Library_Interface``) are copied to
the Library Directory. As a consequence, only the Interface Units may be
imported from Ada units outside of the library. If other units are imported,
the binding phase will fail.
@@ -2187,7 +2203,7 @@ ensuring that the library is linked only against static
libraries. So an encapsulated library only depends on system
libraries, all other code, including the GNAT runtime, is embedded. To
build an encapsulated library the attribute
-`Library_Standalone` must be set to `encapsulated`:
+``Library_Standalone`` must be set to ``encapsulated``:
.. code-block:: gpr
@@ -2197,11 +2213,11 @@ build an encapsulated library the attribute
for Library_Interface use ("int1", "int1.child");
for Library_Standalone use "encapsulated";
-The default value for this attribute is `standard` in which case
+The default value for this attribute is ``standard`` in which case
a stand-alone library is built.
-The attribute `Library_Src_Dir` may be specified for a
-Stand-Alone Library. `Library_Src_Dir` is a simple attribute that has a
+The attribute ``Library_Src_Dir`` may be specified for a
+Stand-Alone Library. ``Library_Src_Dir`` is a simple attribute that has a
single string value. Its value must be the path (absolute or relative to the
project directory) of an existing directory. This directory cannot be the
object directory or one of the source directories, but it can be the same as
@@ -2209,7 +2225,7 @@ the library directory. The sources of the Interface
Units of the library that are needed by an Ada client of the library will be
copied to the designated directory, called the Interface Copy directory.
These sources include the specs of the Interface Units, but they may also
-include bodies and subunits, when pragmas `Inline` or `Inline_Always`
+include bodies and subunits, when pragmas ``Inline`` or ``Inline_Always``
are used, or when there is a generic unit in the spec. Before the sources
are copied to the Interface Copy directory, an attempt is made to delete all
files in the Interface Copy directory.
@@ -2219,10 +2235,10 @@ occasions when it is necessary here are the steps that you need to perform:
* Compile all library sources.
-* Invoke the binder with the switch *-n* (No Ada main program),
+* Invoke the binder with the switch :switch:`-n` (No Ada main program),
with all the :file:`ALI` files of the interfaces, and
- with the switch *-L* to give specific names to the `init`
- and `final` procedures. For example:
+ with the switch :switch:`-L` to give specific names to the ``init``
+ and ``final`` procedures. For example:
.. code-block:: sh
@@ -2235,14 +2251,14 @@ occasions when it is necessary here are the steps that you need to perform:
$ gcc -c b~int2.adb
* Link the dynamic library with all the necessary object files,
- indicating to the linker the names of the `init` (and possibly
- `final`) procedures for automatic initialization (and finalization).
+ indicating to the linker the names of the ``init`` (and possibly
+ ``final``) procedures for automatic initialization (and finalization).
The built library should be placed in a directory different from
the object directory.
-* Copy the `ALI` files of the interface to the library directory,
+* Copy the ``ALI`` files of the interface to the library directory,
add in this copy an indication that it is an interface to a SAL
- (i.e., add a word *SL* on the line in the :file:`ALI` file that starts
+ (i.e., add a word ``SL`` on the line in the :file:`ALI` file that starts
with letter 'P') and make the modified copy of the :file:`ALI` file
read-only.
@@ -2258,8 +2274,8 @@ It is easy to adapt the SAL build procedure discussed above for use of a SAL in
a non-Ada context.
The only extra step required is to ensure that library interface subprograms
-are compatible with the main program, by means of `pragma Export`
-or `pragma Convention`.
+are compatible with the main program, by means of ``pragma Export``
+or ``pragma Convention``.
Here is an example of simple library interface for use with C main program:
@@ -2279,7 +2295,7 @@ On the foreign language side, you must provide a 'foreign' view of the
library interface; remember that it should contain elaboration routines in
addition to interface subprograms.
-The example below shows the content of `mylib_interface.h` (note
+The example below shows the content of :file:`mylib_interface.h` (note
that there is no rule for the naming of this file, any name can be used)
.. code-block:: c
@@ -2295,12 +2311,12 @@ that there is no rule for the naming of this file, any name can be used)
extern void do_something_else (void);
Libraries built as explained above can be used from any program, provided
-that the elaboration procedures (named `mylibinit` in the previous
+that the elaboration procedures (named ``mylibinit`` in the previous
example) are called before the library services are used. Any number of
libraries can be used simultaneously, as long as the elaboration
procedure of each library is called.
-Below is an example of a C program that uses the `mylib` library.
+Below is an example of a C program that uses the ``mylib`` library.
.. code-block:: c
@@ -2322,7 +2338,7 @@ Below is an example of a C program that uses the `mylib` library.
}
Note that invoking any library finalization procedure generated by
-`gnatbind` shuts down the Ada run-time environment.
+``gnatbind`` shuts down the Ada run-time environment.
Consequently, the
finalization of all Ada libraries must be performed at the end of the program.
No call to these libraries or to the Ada run-time library should be made
@@ -2342,15 +2358,15 @@ Restrictions in Stand-alone Libraries
The pragmas listed below should be used with caution inside libraries,
as they can create incompatibilities with other Ada libraries:
-* pragma `Locking_Policy`
-* pragma `Partition_Elaboration_Policy`
-* pragma `Queuing_Policy`
-* pragma `Task_Dispatching_Policy`
-* pragma `Unreserve_All_Interrupts`
+* pragma ``Locking_Policy``
+* pragma ``Partition_Elaboration_Policy``
+* pragma ``Queuing_Policy``
+* pragma ``Task_Dispatching_Policy``
+* pragma ``Unreserve_All_Interrupts``
When using a library that contains such pragmas, the user must make sure
that all libraries use the same pragmas with the same values. Otherwise,
-`Program_Error` will
+``Program_Error`` will
be raised during the elaboration of the conflicting
libraries. The usage of these pragmas and its consequences for the user
should therefore be well documented.
@@ -2360,9 +2376,9 @@ enabled or disabled in a consistent manner across all libraries.
Otherwise, Program_Error will be raised during the elaboration of the
conflicting libraries.
-If the `Version` or `Body_Version`
+If the ``Version`` or ``Body_Version``
attributes are used inside a library, then you need to
-perform a `gnatbind` step that specifies all :file:`ALI` files in all
+perform a ``gnatbind`` step that specifies all :file:`ALI` files in all
libraries, so that version identifiers can be properly computed.
In practice these attributes are rarely used, so this is unlikely
to be a consideration.
@@ -2379,8 +2395,8 @@ Rebuilding the GNAT Run-Time Library
It may be useful to recompile the GNAT library in various contexts, the
most important one being the use of partition-wide configuration pragmas
-such as `Normalize_Scalars`. A special Makefile called
-`Makefile.adalib` is provided to that effect and can be found in
+such as ``Normalize_Scalars``. A special Makefile called
+:file:`Makefile.adalib` is provided to that effect and can be found in
the directory containing the GNAT library. The location of this
directory depends on the way the GNAT environment has been installed and can
be determined by means of the command:
@@ -2455,10 +2471,10 @@ constants to control which code is executed.
...
end if;
-Not only will the code inside the `if` statement not be executed if
-the constant Boolean is `False`, but it will also be completely
+Not only will the code inside the ``if`` statement not be executed if
+the constant Boolean is ``False``, but it will also be completely
deleted from the program.
-However, the code is only deleted after the `if` statement
+However, the code is only deleted after the ``if`` statement
has been checked for syntactic and semantic correctness.
(In contrast, with preprocessors the code is deleted before the
compiler ever gets to see it, so it is not checked until the switch
@@ -2477,10 +2493,10 @@ something like:
...
end Config;
-The `Config` package exists in multiple forms for the various targets,
-with an appropriate script selecting the version of `Config` needed.
+The ``Config`` package exists in multiple forms for the various targets,
+with an appropriate script selecting the version of ``Config`` needed.
Then any other unit requiring conditional compilation can do a |with|
-of `Config` to make the constants visible.
+of ``Config`` to make the constants visible.
.. _Debugging_-_A_Special_Case:
@@ -2511,10 +2527,10 @@ or
Since this is a common case, there are special features to deal with
this in a convenient manner. For the case of tests, Ada 2005 has added
-a pragma `Assert` that can be used for such tests. This pragma is modeled
-on the `Assert` pragma that has always been available in GNAT, so this
+a pragma ``Assert`` that can be used for such tests. This pragma is modeled
+on the ``Assert`` pragma that has always been available in GNAT, so this
feature may be used with GNAT even if you are not using Ada 2005 features.
-The use of pragma `Assert` is described in the
+The use of pragma ``Assert`` is described in the
:title:`GNAT_Reference_Manual`, but as an
example, the last test could be written:
@@ -2529,62 +2545,62 @@ or simply
pragma Assert (Temperature <= 999.0);
In both cases, if assertions are active and the temperature is excessive,
-the exception `Assert_Failure` will be raised, with the given string in
+the exception ``Assert_Failure`` will be raised, with the given string in
the first case or a string indicating the location of the pragma in the second
case used as the exception message.
.. index:: pragma Assertion_Policy
-You can turn assertions on and off by using the `Assertion_Policy`
+You can turn assertions on and off by using the ``Assertion_Policy``
pragma.
.. index:: -gnata switch
This is an Ada 2005 pragma which is implemented in all modes by
-GNAT. Alternatively, you can use the *-gnata* switch
+GNAT. Alternatively, you can use the :switch:`-gnata` switch
to enable assertions from the command line, which applies to
all versions of Ada.
.. index:: pragma Debug
-For the example above with the `Put_Line`, the GNAT-specific pragma
-`Debug` can be used:
+For the example above with the ``Put_Line``, the GNAT-specific pragma
+``Debug`` can be used:
.. code-block:: ada
pragma Debug (Put_Line ("got to the first stage!"));
If debug pragmas are enabled, the argument, which must be of the form of
-a procedure call, is executed (in this case, `Put_Line` will be called).
+a procedure call, is executed (in this case, ``Put_Line`` will be called).
Only one call can be present, but of course a special debugging procedure
containing any code you like can be included in the program and then
-called in a pragma `Debug` argument as needed.
+called in a pragma ``Debug`` argument as needed.
-One advantage of pragma `Debug` over the `if Debugging then`
-construct is that pragma `Debug` can appear in declarative contexts,
+One advantage of pragma ``Debug`` over the ``if Debugging then``
+construct is that pragma ``Debug`` can appear in declarative contexts,
such as at the very beginning of a procedure, before local declarations have
been elaborated.
.. index:: pragma Debug_Policy
-Debug pragmas are enabled using either the *-gnata* switch that also
+Debug pragmas are enabled using either the :switch:`-gnata` switch that also
controls assertions, or with a separate Debug_Policy pragma.
The latter pragma is new in the Ada 2005 versions of GNAT (but it can be used
in Ada 95 and Ada 83 programs as well), and is analogous to
-pragma `Assertion_Policy` to control assertions.
+pragma ``Assertion_Policy`` to control assertions.
-`Assertion_Policy` and `Debug_Policy` are configuration pragmas,
+``Assertion_Policy`` and ``Debug_Policy`` are configuration pragmas,
and thus they can appear in :file:`gnat.adc` if you are not using a
project file, or in the file designated to contain configuration pragmas
in a project file.
They then apply to all subsequent compilations. In practice the use of
-the *-gnata* switch is often the most convenient method of controlling
+the :switch:`-gnata` switch is often the most convenient method of controlling
the status of these pragmas.
Note that a pragma is not a statement, so in contexts where a statement
sequence is required, you can't just write a pragma on its own. You have
-to add a `null` statement.
+to add a ``null`` statement.
.. code-block:: ada
@@ -2627,8 +2643,8 @@ Note that in this approach, both declarations are analyzed by the
compiler so this can only be used where both declarations are legal,
even though one of them will not be used.
-Another approach is to define integer constants, e.g., `Bits_Per_Word`,
-or Boolean constants, e.g., `Little_Endian`, and then write declarations
+Another approach is to define integer constants, e.g., ``Bits_Per_Word``,
+or Boolean constants, e.g., ``Little_Endian``, and then write declarations
that are parameterized by these constants. For example
.. code-block:: ada
@@ -2637,7 +2653,7 @@ that are parameterized by these constants. For example
Field1 at 0 range Boolean'Pos (Little_Endian) * 10 .. Bits_Per_Word;
end record;
-If `Bits_Per_Word` is set to 32, this generates either
+If ``Bits_Per_Word`` is set to 32, this generates either
.. code-block:: ada
@@ -2657,7 +2673,7 @@ for the little endian case. Since a powerful subset of Ada expression
notation is usable for creating static constants, clever use of this
feature can often solve quite difficult problems in conditionalizing
compilation (note incidentally that in Ada 95, the little endian
-constant was introduced as `System.Default_Bit_Order`, so you do not
+constant was introduced as ``System.Default_Bit_Order``, so you do not
need to define this one yourself).
.. _Use_of_Alternative_Implementations:
@@ -2693,10 +2709,10 @@ to compile with an Ada 95 compiler. Conceptually you want to say:
... not quite as neat Ada 95 code
end if;
-where `Ada_2005` is a Boolean constant.
+where ``Ada_2005`` is a Boolean constant.
-But this won't work when `Ada_2005` is set to `False`,
-since the `then` clause will be illegal for an Ada 95 compiler.
+But this won't work when ``Ada_2005`` is set to ``False``,
+since the ``then`` clause will be illegal for an Ada 95 compiler.
(Recall that although such unreachable code would eventually be deleted
by the compiler, it still needs to be legal. If it uses features
introduced in Ada 2005, it will be illegal in Ada 95.)
@@ -2707,9 +2723,9 @@ So instead we write
procedure Insert is separate;
-Then we have two files for the subunit `Insert`, with the two sets of
+Then we have two files for the subunit ``Insert``, with the two sets of
code.
-If the package containing this is called `File_Queries`, then we might
+If the package containing this is called ``File_Queries``, then we might
have two files
* :file:`file_queries-insert-2005.adb`
@@ -2755,11 +2771,11 @@ renaming it if necessary to :file:`s-asthan.adb` before the run-time build.
Another style for arranging alternative implementations is through Ada's
access-to-subprogram facility.
In case some functionality is to be conditionally included,
-you can declare an access-to-procedure variable `Ref` that is initialized
-to designate a 'do nothing' procedure, and then invoke `Ref.all`
+you can declare an access-to-procedure variable ``Ref`` that is initialized
+to designate a 'do nothing' procedure, and then invoke ``Ref.all``
when appropriate.
-In some library package, set `Ref` to `Proc'Access` for some
-procedure `Proc` that performs the relevant processing.
+In some library package, set ``Ref`` to ``Proc'Access`` for some
+procedure ``Proc`` that performs the relevant processing.
The initialization only occurs if the library package is included in the
program.
The same idea can also be implemented using tagged types and dispatching
@@ -2788,7 +2804,7 @@ with legacy code on other compilers, to enable easier transition).
The preprocessor may be used in two separate modes. It can be used quite
separately from the compiler, to generate a separate output source file
that is then fed to the compiler as a separate step. This is the
-`gnatprep` utility, whose use is fully described in
+``gnatprep`` utility, whose use is fully described in
:ref:`Preprocessing_with_gnatprep`.
The preprocessing language allows such constructs as
@@ -2801,27 +2817,27 @@ The preprocessing language allows such constructs as
completely different sequence of declarations
#end if;
-The values of the symbols `DEBUG` and `PRIORITY` can be
+The values of the symbols ``DEBUG`` and ``PRIORITY`` can be
defined either on the command line or in a separate file.
The other way of running the preprocessor is even closer to the C style and
often more convenient. In this approach the preprocessing is integrated into
the compilation process. The compiler is given the preprocessor input which
-includes `#if` lines etc, and then the compiler carries out the
+includes ``#if`` lines etc, and then the compiler carries out the
preprocessing internally and processes the resulting output.
For more details on this approach, see :ref:`Integrated_Preprocessing`.
.. _Preprocessing_with_gnatprep:
-Preprocessing with `gnatprep`
------------------------------
+Preprocessing with ``gnatprep``
+-------------------------------
.. index:: ! gnatprep
.. index:: Preprocessing (gnatprep)
-This section discusses how to use GNAT's `gnatprep` utility for simple
+This section discusses how to use GNAT's ``gnatprep`` utility for simple
preprocessing.
-Although designed for use with GNAT, `gnatprep` does not depend on any
+Although designed for use with GNAT, ``gnatprep`` does not depend on any
special GNAT features.
For further discussion of conditional compilation in general, see
:ref:`Conditional_Compilation`.
@@ -2838,14 +2854,14 @@ all characters need to be in the ASCII set (no accented letters).
.. _Using_gnatprep:
-Using `gnatprep`
-^^^^^^^^^^^^^^^^
+Using ``gnatprep``
+^^^^^^^^^^^^^^^^^^
-To call `gnatprep` use:
+To call ``gnatprep`` use:
.. code-block:: sh
- $ gnatprep [`switches`] `infile` `outfile` [`deffile`]
+ $ gnatprep [ switches ] infile outfile [ deffile ]
where
@@ -2859,48 +2875,48 @@ where
* *outfile*
is the full name of the output file, which is an Ada source
in standard Ada form. When used with GNAT, this file name will
- normally have an *ads* or *adb* suffix.
+ normally have an ``ads`` or ``adb`` suffix.
-* *deffile*
+* ``deffile``
is the full name of a text file containing definitions of
preprocessing symbols to be referenced by the preprocessor. This argument is
- optional, and can be replaced by the use of the *-D* switch.
+ optional, and can be replaced by the use of the :switch:`-D` switch.
.. _Switches_for_gnatprep:
-Switches for `gnatprep`
-^^^^^^^^^^^^^^^^^^^^^^^
+Switches for ``gnatprep``
+^^^^^^^^^^^^^^^^^^^^^^^^^
.. index:: --version (gnatprep)
-:samp:`--version`
+:switch:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gnatprep)
-:samp:`--help`
- If :option:`--version` was not used, display usage and then exit disregarding
+:switch:`--help`
+ If :switch:`--version` was not used, display usage and then exit disregarding
all other options.
.. index:: -b (gnatprep)
-:samp:`-b`
+:switch:`-b`
Causes both preprocessor lines and the lines deleted by
preprocessing to be replaced by blank lines in the output source file,
preserving line numbers in the output file.
.. index:: -c (gnatprep)
-:samp:`-c`
+:switch:`-c`
Causes both preprocessor lines and the lines deleted
by preprocessing to be retained in the output source as comments marked
- with the special string `"--! "`. This option will result in line numbers
+ with the special string ``"--! "``. This option will result in line numbers
being preserved in the output file.
.. index:: -C (gnatprep)
-:samp:`-C`
+:switch:`-C`
Causes comments to be scanned. Normally comments are ignored by gnatprep.
If this option is specified, then comments are scanned and any $symbol
substitutions performed as in program text. This is particularly useful
@@ -2911,55 +2927,55 @@ Switches for `gnatprep`
.. index:: -D (gnatprep)
-:samp:`-D{symbol}[={value}]`
+:switch:`-D{symbol}[={value}]`
Defines a new preprocessing symbol with the specified value. If no value is given
- on the command line, then symbol is considered to be `True`. This switch
+ on the command line, then symbol is considered to be ``True``. This switch
can be used in place of a definition file.
.. index:: -r (gnatprep)
-:samp:`-r`
- Causes a `Source_Reference` pragma to be generated that
+:switch:`-r`
+ Causes a ``Source_Reference`` pragma to be generated that
references the original input file, so that error messages will use
the file name of this original file. The use of this switch implies
that preprocessor lines are not to be removed from the file, so its
- use will force *-b* mode if *-c*
+ use will force ``-b`` mode if ``-c``
has not been specified explicitly.
Note that if the file to be preprocessed contains multiple units, then
- it will be necessary to `gnatchop` the output file from
- `gnatprep`. If a `Source_Reference` pragma is present
+ it will be necessary to ``gnatchop`` the output file from
+ ``gnatprep``. If a ``Source_Reference`` pragma is present
in the preprocessed file, it will be respected by
- `gnatchop -r`
+ ``gnatchop -r``
so that the final chopped files will correctly refer to the original
- input source file for `gnatprep`.
+ input source file for ``gnatprep``.
.. index:: -s (gnatprep)
-:samp:`-s`
+:switch:`-s`
Causes a sorted list of symbol names and values to be
listed on the standard output file.
.. index:: -T (gnatprep)
-:samp:`-T`
+:switch:`-T`
Use LF as line terminators when writing files. By default the line terminator
of the host (LF under unix, CR/LF under Windows) is used.
.. index:: -u (gnatprep)
-:samp:`-u`
+:switch:`-u`
Causes undefined symbols to be treated as having the value FALSE in the context
of a preprocessor test. In the absence of this option, an undefined symbol in
- a `#if` or `#elsif` test will be treated as an error.
+ a ``#if`` or ``#elsif`` test will be treated as an error.
.. index:: -v (gnatprep)
-:samp:`-v`
+:switch:`-v`
Verbose mode: generates more output about work done.
-Note: if neither *-b* nor *-c* is present,
+Note: if neither :switch:`-b` nor :switch:`-c` is present,
then preprocessor lines and
deleted lines are completely removed from the output, unless -r is
specified, in which case -b is assumed.
@@ -2974,7 +2990,7 @@ The definitions file contains lines of the form::
symbol := value
-where `symbol` is a preprocessing symbol, and `value` is one of the following:
+where ``symbol`` is a preprocessing symbol, and ``value`` is one of the following:
* Empty, corresponding to a null substitution,
* A string literal using normal Ada syntax, or
@@ -2987,8 +3003,8 @@ and comments may be added to the definitions lines.
.. _Form_of_Input_Text_for_gnatprep:
-Form of Input Text for `gnatprep`
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Form of Input Text for ``gnatprep``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The input text may contain preprocessor conditional inclusion lines,
as well as general symbol substitution sequences.
@@ -3044,7 +3060,7 @@ This can be expressed instead as one of the following forms:
For the first test (<expression> ::= <symbol>) the symbol must have
either the value true or false, that is to say the right-hand of the
symbol definition must be one of the (case-insensitive) literals
-`True` or `False`. If the value is true, then the
+``True`` or ``False``. If the value is true, then the
corresponding lines are included, and if the value is false, they are
excluded.
@@ -3054,35 +3070,35 @@ literal integer as defined in the Ada Reference Manual, such as 3, 16#FF# or
in the range 0 .. 2**31-1 are supported.
The test (<expression> ::= <symbol>'Defined) is true only if
-the symbol has been defined in the definition file or by a *-D*
+the symbol has been defined in the definition file or by a :switch:`-D`
switch on the command line. Otherwise, the test is false.
The equality tests are case insensitive, as are all the preprocessor lines.
If the symbol referenced is not defined in the symbol definitions file,
-then the effect depends on whether or not switch *-u*
+then the effect depends on whether or not switch :switch:`-u`
is specified. If so, then the symbol is treated as if it had the value
false and the test fails. If this switch is not specified, then
it is an error to reference an undefined symbol. It is also an error to
-reference a symbol that is defined with a value other than `True`
-or `False`.
+reference a symbol that is defined with a value other than ``True``
+or ``False``.
-The use of the `not` operator inverts the sense of this logical test.
-The `not` operator cannot be combined with the `or` or `and`
+The use of the ``not`` operator inverts the sense of this logical test.
+The ``not`` operator cannot be combined with the ``or`` or ``and``
operators, without parentheses. For example, "if not X or Y then" is not
allowed, but "if (not X) or Y then" and "if not (X or Y) then" are.
-The `then` keyword is optional as shown
+The ``then`` keyword is optional as shown
-The `#` must be the first non-blank character on a line, but
+The ``#`` must be the first non-blank character on a line, but
otherwise the format is free form. Spaces or tabs may appear between
-the `#` and the keyword. The keywords and the symbols are case
+the ``#`` and the keyword. The keywords and the symbols are case
insensitive as in normal Ada code. Comments may be used on a
preprocessor line, but other than that, no other tokens may appear on a
-preprocessor line. Any number of `elsif` clauses can be present,
-including none at all. The `else` is optional, as in Ada.
+preprocessor line. Any number of ``elsif`` clauses can be present,
+including none at all. The ``else`` is optional, as in Ada.
-The `#` marking the start of a preprocessor line must be the first
+The ``#`` marking the start of a preprocessor line must be the first
non-blank character on the line, i.e., it must be preceded only by
spaces or horizontal tabs.
@@ -3093,19 +3109,19 @@ the sequence::
anywhere within a source line, except in a comment or within a
string literal. The identifier
-following the `$` must match one of the symbols defined in the symbol
+following the ``$`` must match one of the symbols defined in the symbol
definition file, and the result is to substitute the value of the
-symbol in place of `$symbol` in the output file.
+symbol in place of ``$symbol`` in the output file.
Note that although the substitution of strings within a string literal
is not possible, it is possible to have a symbol whose defined value is
-a string literal. So instead of setting XYZ to `hello` and writing:
+a string literal. So instead of setting XYZ to ``hello`` and writing:
.. code-block:: c
Header : String := "$XYZ";
-you should set XYZ to `"hello"` and write:
+you should set XYZ to ``"hello"`` and write:
.. code-block:: c
@@ -3121,17 +3137,17 @@ Integrated Preprocessing
As noted above, a file to be preprocessed consists of Ada source code
in which preprocessing lines have been inserted. However,
-instead of using *gnatprep* to explicitly preprocess a file as a separate
+instead of using ``gnatprep`` to explicitly preprocess a file as a separate
step before compilation, you can carry out the preprocessing implicitly
as part of compilation. Such *integrated preprocessing*, which is the common
style with C, is performed when either or both of the following switches
are passed to the compiler:
- * :option:`-gnatep`, which specifies the *preprocessor data file*.
+ * :switch:`-gnatep`, which specifies the *preprocessor data file*.
This file dictates how the source files will be preprocessed (e.g., which
symbol definition files apply to which sources).
- * :option:`-gnateD`, which defines values for preprocessing symbols.
+ * :switch:`-gnateD`, which defines values for preprocessing symbols.
Integrated preprocessing applies only to Ada source files, it is
not available for configuration pragma files.
@@ -3139,17 +3155,17 @@ not available for configuration pragma files.
With integrated preprocessing, the output from the preprocessor is not,
by default, written to any external file. Instead it is passed
internally to the compiler. To preserve the result of
-preprocessing in a file, either run *gnatprep*
-in standalone mode or else supply the :option:`-gnateG` switch
+preprocessing in a file, either run ``gnatprep``
+in standalone mode or else supply the :switch:`-gnateG` switch
(described below) to the compiler.
-The *gnatmake* switch :option:`-s` should be used with integrated
+The ``gnatmake`` switch :switch:`-s` should be used with integrated
preprocessing; otherwise the use of a different preprocessor data file
without changing the sources will not cause recompilation.
-Note that the *gnatmake* switch :option:`-m` will almost
+Note that the ``gnatmake`` switch :switch:`-m` will almost
always trigger recompilation for sources that are preprocessed,
-because *gnatmake* cannot compute the checksum of the source after
+because ``gnatmake`` cannot compute the checksum of the source after
preprocessing.
The actual preprocessing function is described in detail in
@@ -3158,7 +3174,7 @@ that relate to integrated preprocessing.
.. index:: -gnatep (gcc)
-:samp:`-gnatep={preprocessor_data_file}`
+:switch:`-gnatep={preprocessor_data_file}`
This switch specifies the file name (without directory
information) of the preprocessor data file. Either place this file
in one of the source directories, or, when using project
@@ -3176,7 +3192,7 @@ that relate to integrated preprocessing.
A preprocessor data file is a text file that contains *preprocessor
control lines*. A preprocessor control line directs the preprocessing of
- either a particular source file, or, analogous to *others* in Ada,
+ either a particular source file, or, analogous to ``others`` in Ada,
all sources not specified elsewhere in the preprocessor data file.
A preprocessor control line
can optionally identify a *definition file* that assigns values to
@@ -3237,57 +3253,57 @@ that relate to integrated preprocessing.
compiler in one of the source directories. In some cases, when compiling
a source in a directory other than the current directory, if the definition
file is in the current directory, it may be necessary to add the current
- directory as a source directory through the :option:`-I` switch; otherwise
+ directory as a source directory through the :switch:`-I` switch; otherwise
the compiler would not find the definition file.
- Finally, switches similar to those of *gnatprep* may optionally appear:
+ Finally, switches similar to those of ``gnatprep`` may optionally appear:
- :samp:`-b`
+ :switch:`-b`
Causes both preprocessor lines and the lines deleted by
preprocessing to be replaced by blank lines, preserving the line number.
- This switch is always implied; however, if specified after :option:`-c`
- it cancels the effect of :option:`-c`.
+ This switch is always implied; however, if specified after :switch:`-c`
+ it cancels the effect of :switch:`-c`.
- :samp:`-c`
+ :switch:`-c`
Causes both preprocessor lines and the lines deleted
by preprocessing to be retained as comments marked
with the special string '`--!`'.
- :samp:`-D{symbol}={new_value}`
- Define or redefine *symbol* to have *new_value* as its value.
- The permitted form for *symbol* is either an Ada identifier, or any Ada reserved word
- aside from `if`,
- `else`, `elsif`, `end`, `and`, `or` and `then`.
- The permitted form for `new_value` is a literal string, an Ada identifier or any Ada reserved
+ :switch:`-D{symbol}={new_value}`
+ Define or redefine ``symbol`` to have ``new_value`` as its value.
+ The permitted form for ``symbol`` is either an Ada identifier, or any Ada reserved word
+ aside from ``if``,
+ ``else``, ``elsif``, ``end``, ``and``, ``or`` and ``then``.
+ The permitted form for ``new_value`` is a literal string, an Ada identifier or any Ada reserved
word. A symbol declared with this switch replaces a symbol with the
same name defined in a definition file.
- :samp:`-s`
+ :switch:`-s`
Causes a sorted list of symbol names and values to be
listed on the standard output file.
- :samp:`-u`
- Causes undefined symbols to be treated as having the value `FALSE`
+ :switch:`-u`
+ Causes undefined symbols to be treated as having the value ``FALSE``
in the context
of a preprocessor test. In the absence of this option, an undefined symbol in
- a `#if` or `#elsif` test will be treated as an error.
+ a ``#if`` or ``#elsif`` test will be treated as an error.
.. index:: -gnateD (gcc)
-:samp:`-gnateD{symbol}[={new_value}]`
- Define or redefine *symbol* to have *new_value* as its value. If no value
- is supplied, then the value of *symbol* is `True`.
- The form of *symbol* is an identifier, following normal Ada (case-insensitive)
- rules for its syntax, and *new_value* is either an arbitrary string between double
+:switch:`-gnateD{symbol}[={new_value}]`
+ Define or redefine ``symbol`` to have ``new_value`` as its value. If no value
+ is supplied, then the value of ``symbol`` is ``True``.
+ The form of ``symbol`` is an identifier, following normal Ada (case-insensitive)
+ rules for its syntax, and ``new_value`` is either an arbitrary string between double
quotes or any sequence (including an empty sequence) of characters from the
set (letters, digits, period, underline).
- Ada reserved words may be used as symbols, with the exceptions of `if`,
- `else`, `elsif`, `end`, `and`, `or` and `then`.
+ Ada reserved words may be used as symbols, with the exceptions of ``if``,
+ ``else``, ``elsif``, ``end``, ``and``, ``or`` and ``then``.
Examples:
@@ -3299,12 +3315,12 @@ that relate to integrated preprocessing.
A symbol declared with this switch on the command line replaces a
symbol with the same name either in a definition file or specified with a
- switch :option:`-D` in the preprocessor data file.
+ switch :switch:`-D` in the preprocessor data file.
- This switch is similar to switch :option:`-D` of `gnatprep`.
+ This switch is similar to switch :switch:`-D` of ``gnatprep``.
-:samp:`-gnateG`
+:switch:`-gnateG`
When integrated preprocessing is performed on source file :file:`filename.extension`,
create or overwrite :file:`filename.extension.prep` to contain
the result of the preprocessing.
@@ -3329,8 +3345,8 @@ Interfacing to C
Interfacing Ada with a foreign language such as C involves using
compiler directives to import and/or export entity definitions in each
-language -- using `extern` statements in C, for instance, and the
-`Import`, `Export`, and `Convention` pragmas in Ada.
+language -- using ``extern`` statements in C, for instance, and the
+``Import``, ``Export``, and ``Convention`` pragmas in Ada.
A full treatment of these topics is provided in Appendix B, section 1
of the Ada Reference Manual.
@@ -3515,7 +3531,7 @@ example's:
$ gnatmake -c unit2.adb
* Run the Ada binder on every generated ALI file. Make sure to use the
- :option:`-n` option to specify a foreign main program:
+ :switch:`-n` option to specify a foreign main program:
.. code-block:: sh
@@ -3531,9 +3547,9 @@ example's:
This procedure yields a binary executable called :file:`exec_file`.
Depending on the circumstances (for example when your non-Ada main object
-does not provide symbol `main`), you may also need to instruct the
+does not provide symbol ``main``), you may also need to instruct the
GNAT linker not to include the standard startup objects by passing the
-:option:`-nostartfiles` switch to `gnatlink`.
+:switch:`-nostartfiles` switch to ``gnatlink``.
.. _Calling_Conventions:
@@ -3555,7 +3571,7 @@ Convention identifiers are recognized by GNAT:
.. index:: Convention Ada
-*Ada*
+``Ada``
This indicates that the standard Ada calling sequence will be
used and all Ada data items may be passed without any limitations in the
case where GNAT is used to generate both the caller and callee. It is also
@@ -3589,7 +3605,7 @@ Convention identifiers are recognized by GNAT:
.. index:: Convention Assembler
-*Assembler*
+``Assembler``
Specifies assembler as the convention. In practice this has the
same effect as convention Ada (but is not equivalent in the sense of being
considered the same convention).
@@ -3598,7 +3614,7 @@ Convention identifiers are recognized by GNAT:
.. index:: Asm
-*Asm*
+``Asm``
Equivalent to Assembler.
.. index:: Interfacing to COBOL
@@ -3607,7 +3623,7 @@ Convention identifiers are recognized by GNAT:
.. index:: COBOL
-*COBOL*
+``COBOL``
Data will be passed according to the conventions described
in section B.4 of the Ada Reference Manual.
@@ -3617,7 +3633,7 @@ Convention identifiers are recognized by GNAT:
.. index:: Convention C
-*C*
+``C``
Data will be passed according to the conventions described
in section B.3 of the Ada Reference Manual.
@@ -3627,36 +3643,36 @@ Convention identifiers are recognized by GNAT:
.. index:: Interfacing to C varargs function
.. index:: varargs function interfaces
- In C, `varargs` allows a function to take a variable number of
+ In C, ``varargs`` allows a function to take a variable number of
arguments. There is no direct equivalent in this to Ada. One
approach that can be used is to create a C wrapper for each
different profile and then interface to this C wrapper. For
- example, to print an `int` value using `printf`,
- create a C function `printfi` that takes two arguments, a
- pointer to a string and an int, and calls `printf`.
- Then in the Ada program, use pragma `Import` to
- interface to `printfi`.
+ example, to print an ``int`` value using ``printf``,
+ create a C function ``printfi`` that takes two arguments, a
+ pointer to a string and an int, and calls ``printf``.
+ Then in the Ada program, use pragma ``Import`` to
+ interface to ``printfi``.
It may work on some platforms to directly interface to
- a `varargs` function by providing a specific Ada profile
+ a ``varargs`` function by providing a specific Ada profile
for a particular call. However, this does not work on
all platforms, since there is no guarantee that the
calling sequence for a two argument normal C function
- is the same as for calling a `varargs` C function with
+ is the same as for calling a ``varargs`` C function with
the same two arguments.
.. index:: Convention Default
.. index:: Default
-*Default*
+``Default``
Equivalent to C.
.. index:: Convention External
.. index:: External
-*External*
+``External``
Equivalent to C.
.. index:: C++
@@ -3665,7 +3681,7 @@ Convention identifiers are recognized by GNAT:
.. index:: Convention C++
-*C_Plus_Plus (or CPP)*
+``C_Plus_Plus`` (or ``CPP``)
This stands for C++. For most purposes this is identical to C.
See the separate description of the specialized GNAT pragmas relating to
C++ interfacing for further details.
@@ -3675,12 +3691,12 @@ Convention identifiers are recognized by GNAT:
.. index:: Convention Fortran
-*Fortran*
+``Fortran``
Data will be passed according to the conventions described
in section B.5 of the Ada Reference Manual.
-*Intrinsic*
+``Intrinsic``
This applies to an intrinsic operation, as defined in the Ada
Reference Manual. If a pragma Import (Intrinsic) applies to a subprogram,
this means that the body of the subprogram is provided by the compiler itself,
@@ -3723,7 +3739,7 @@ Convention identifiers are recognized by GNAT:
* General subprogram entities. This is used to bind an Ada subprogram
declaration to
a compiler builtin by name with back-ends where such interfaces are
- available. A typical example is the set of `__builtin` functions
+ available. A typical example is the set of ``__builtin`` functions
exposed by the GCC back-end, as in the following example:
@@ -3740,36 +3756,36 @@ Convention identifiers are recognized by GNAT:
.. index:: Stdcall
.. index:: Convention Stdcall
-*Stdcall*
+``Stdcall``
This is relevant only to Windows implementations of GNAT,
- and specifies that the `Stdcall` calling sequence will be used,
+ and specifies that the ``Stdcall`` calling sequence will be used,
as defined by the NT API. Nevertheless, to ease building
- cross-platform bindings this convention will be handled as a `C` calling
+ cross-platform bindings this convention will be handled as a ``C`` calling
convention on non-Windows platforms.
.. index:: DLL
.. index:: Convention DLL
-*DLL*
- This is equivalent to `Stdcall`.
+``DLL``
+ This is equivalent to ``Stdcall``.
.. index:: Win32
.. index:: Convention Win32
-*Win32*
- This is equivalent to `Stdcall`.
+``Win32``
+ This is equivalent to ``Stdcall``.
.. index:: Stubbed
.. index:: Convention Stubbed
-*Stubbed*
+``Stubbed``
This is a special convention that indicates that the compiler
- should provide a stub body that raises `Program_Error`.
+ should provide a stub body that raises ``Program_Error``.
-GNAT additionally provides a useful pragma `Convention_Identifier`
+GNAT additionally provides a useful pragma ``Convention_Identifier``
that can be used to parameterize conventions and allow additional synonyms
to be specified. For example if you have legacy code in which the convention
identifier Fortran77 was used for Fortran, you can use the configuration
@@ -3780,7 +3796,7 @@ pragma:
pragma Convention_Identifier (Fortran77, Fortran);
And from now on the identifier Fortran77 may be used as a convention
-identifier (for example in an `Import` pragma) with the same
+identifier (for example in an ``Import`` pragma) with the same
meaning as Fortran.
@@ -3803,20 +3819,20 @@ generating code that is compatible with the G++ Application Binary
Interface ---see http://www.codesourcery.com/archives/cxx-abi).
Interfacing can be done at 3 levels: simple data, subprograms, and
-classes. In the first two cases, GNAT offers a specific `Convention C_Plus_Plus`
-(or `CPP`) that behaves exactly like `Convention C`.
+classes. In the first two cases, GNAT offers a specific ``Convention C_Plus_Plus``
+(or ``CPP``) that behaves exactly like ``Convention C``.
Usually, C++ mangles the names of subprograms. To generate proper mangled
names automatically, see :ref:`Generating_Ada_Bindings_for_C_and_C++_headers`).
This problem can also be addressed manually in two ways:
* by modifying the C++ code in order to force a C convention using
- the `extern "C"` syntax.
+ the ``extern "C"`` syntax.
-* by figuring out the mangled name (using e.g. *nm*) and using it as the
+* by figuring out the mangled name (using e.g. ``nm``) and using it as the
Link_Name argument of the pragma import.
Interfacing at the class level can be achieved by using the GNAT specific
-pragmas such as `CPP_Constructor`. See the :title:`GNAT_Reference_Manual` for additional information.
+pragmas such as ``CPP_Constructor``. See the :title:`GNAT_Reference_Manual` for additional information.
.. _Linking_a_Mixed_C++_and_Ada_Program:
@@ -3833,10 +3849,10 @@ considered:
* Using GNAT and G++ (GNU C++ compiler) from the same GCC installation:
The C++ linker can simply be called by using the C++ specific driver
- called `g++`.
+ called ``g++``.
Note that if the C++ code uses inline functions, you will need to
- compile your C++ code with the `-fkeep-inline-functions` switch in
+ compile your C++ code with the :switch:`-fkeep-inline-functions` switch in
order to provide an existing function implementation that the Ada code can
link with.
@@ -3857,7 +3873,7 @@ considered:
improperly if set during invocation of the wrong compiler. It is also
very important that the linker uses the proper :file:`libgcc.a` GCC
library -- that is, the one from the C++ compiler installation. The
- implicit link command as suggested in the `gnatmake` command
+ implicit link command as suggested in the ``gnatmake`` command
from the former example can be replaced by an explicit link command with
the full-verbosity option in order to verify which library is used:
@@ -3886,20 +3902,20 @@ considered:
a few more parameters to the link command line, depending on the exception
mechanism used.
- If the `setjmp/longjmp` exception mechanism is used, only the paths
- to the libgcc libraries are required:
+ If the ``setjmp`` / ``longjmp`` exception mechanism is used, only the paths
+ to the ``libgcc`` libraries are required:
.. code-block:: sh
$ cat ./my_script
#!/bin/sh
- CC $* `gcc -print-file-name=libgcc.a` `gcc -print-file-name=libgcc_eh.a`
+ CC $* gcc -print-file-name=libgcc.a gcc -print-file-name=libgcc_eh.a
$ gnatlink ada_unit file1.o file2.o --LINK=./my_script
where CC is the name of the non-GNU C++ compiler.
- If the `zero cost` exception mechanism is used, and the platform
+ If the "zero cost" exception mechanism is used, and the platform
supports automatic registration of exception tables (e.g., Solaris),
paths to more objects are required:
@@ -3907,9 +3923,9 @@ considered:
$ cat ./my_script
#!/bin/sh
- CC `gcc -print-file-name=crtbegin.o` $* \\
- `gcc -print-file-name=libgcc.a` `gcc -print-file-name=libgcc_eh.a` \\
- `gcc -print-file-name=crtend.o`
+ CC gcc -print-file-name=crtbegin.o $* \\
+ gcc -print-file-name=libgcc.a gcc -print-file-name=libgcc_eh.a \\
+ gcc -print-file-name=crtend.o
$ gnatlink ada_unit file1.o file2.o --LINK=./my_script
@@ -4059,7 +4075,7 @@ Interfacing with C++ constructors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In order to interface with C++ constructors GNAT provides the
-`pragma CPP_Constructor` (see the :title:`GNAT_Reference_Manual`
+``pragma CPP_Constructor`` (see the :title:`GNAT_Reference_Manual`
for additional information).
In this section we present some common uses of C++ constructors
in mixed-languages programs in GNAT.
@@ -4117,8 +4133,8 @@ properly initialized.
Constructors can only appear in the following contexts:
-* On the right side of an initialization of an object of type `T`.
-* On the right side of an initialization of a record component of type `T`.
+* On the right side of an initialization of an object of type ``T``.
+* On the right side of an initialization of a record component of type ``T``.
* In an Ada 2005 limited aggregate.
* In an Ada 2005 nested limited aggregate.
* In an Ada 2005 limited aggregate that initializes an object built in
@@ -4139,8 +4155,8 @@ expression that initializes the object. For example:
The first two declarations are equivalent: in both cases the default C++
constructor is invoked (in the former case the call to the constructor is
implicit, and in the latter case the call is explicit in the object
-declaration). `Obj3` is initialized by the C++ non-default constructor
-that takes an integer argument, and `Obj4` is initialized by the
+declaration). ``Obj3`` is initialized by the C++ non-default constructor
+that takes an integer argument, and ``Obj4`` is initialized by the
non-default C++ constructor that takes two integers.
Let us derive the imported C++ class in the Ada side. For example:
@@ -4163,11 +4179,11 @@ an aggregate of type DT, or by means of an extension aggregate.
Obj6 : DT := Function_Returning_DT (50);
Obj7 : DT := (Constructor (30,40) with C_Value => 50);
-The declaration of `Obj5` invokes the default constructors: the
+The declaration of ``Obj5`` invokes the default constructors: the
C++ default constructor of the parent type takes care of the initialization
of the components inherited from Root, and GNAT takes care of the default
initialization of the additional Ada components of type DT (that is,
-`C_Value` is initialized to value 2009). The order of invocation of
+``C_Value`` is initialized to value 2009). The order of invocation of
the constructors is consistent with the order of elaboration required by
Ada and C++. That is, the constructor of the parent type is always called
before the constructor of the derived type.
@@ -4187,7 +4203,7 @@ from C++. For example:
Data2 : Root := Constructor (D, 30);
end record;
-The initialization of an object of type `Rec2` will call the
+The initialization of an object of type ``Rec2`` will call the
non-default C++ constructors specified for the imported components.
For example:
@@ -4206,15 +4222,15 @@ declarations. For example:
others => <>);
The above declaration uses an Ada 2005 limited aggregate to
-initialize `Obj9`, and the C++ constructor that has two integer
-arguments is invoked to initialize the `Data1` component instead
-of the constructor specified in the declaration of type `Rec1`. In
+initialize ``Obj9``, and the C++ constructor that has two integer
+arguments is invoked to initialize the ``Data1`` component instead
+of the constructor specified in the declaration of type ``Rec1``. In
Ada 2005 the box in the aggregate indicates that unspecified components
are initialized using the expression (if any) available in the component
-declaration. That is, in this case discriminant `D` is initialized
-to value `20`, `Value` is initialized to value 1000, and the
+declaration. That is, in this case discriminant ``D`` is initialized
+to value ``20``, ``Value`` is initialized to value 1000, and the
non-default C++ constructor that handles two integers takes care of
-initializing component `Data2` with values `20,30`.
+initializing component ``Data2`` with values ``20,30``.
In Ada 2005 we can use the extended return statement to build the Ada
equivalent to C++ non-default constructors. For example:
@@ -4251,8 +4267,8 @@ classifications. We first demonstrate a case in which the types and
constructors are defined on the C++ side and imported from the Ada
side, and latter the reverse case.
-The root of our derivation will be the `Animal` class, with a
-single private attribute (the `Age` of the animal), a constructor,
+The root of our derivation will be the ``Animal`` class, with a
+single private attribute (the ``Age`` of the animal), a constructor,
and two public primitives to set and get the value of this attribute.
.. code-block:: cpp
@@ -4268,8 +4284,8 @@ and two public primitives to set and get the value of this attribute.
Abstract interface types are defined in C++ by means of classes with pure
virtual functions and no data members. In our example we will use two
-interfaces that provide support for the common management of `Carnivore`
-and `Domestic` animals:
+interfaces that provide support for the common management of ``Carnivore``
+and ``Domestic`` animals:
.. code-block:: cpp
@@ -4283,7 +4299,7 @@ and `Domestic` animals:
virtual void Set_Owner (char* Name) = 0;
};
-Using these declarations, we can now say that a `Dog` is an animal that is
+Using these declarations, we can now say that a ``Dog`` is an animal that is
both Carnivore and Domestic, that is:
.. code-block:: cpp
@@ -4300,7 +4316,7 @@ both Carnivore and Domestic, that is:
};
In the following examples we will assume that the previous declarations are
-located in a file named `animals.h`. The following package demonstrates
+located in a file named :file:`animals.h`. The following package demonstrates
how to import these C++ declarations from the Ada side:
.. code-block:: ada
@@ -4356,9 +4372,9 @@ the primitives and components must be declared exactly in the same order in
the two languages.
Regarding the abstract interfaces, we must indicate to the GNAT compiler by
-means of a `pragma Convention (C_Plus_Plus)`, the convention used to pass
+means of a ``pragma Convention (C_Plus_Plus)``, the convention used to pass
the arguments to the called primitives will be the same as for C++. For the
-imported classes we use `pragma Import` with convention `C_Plus_Plus`
+imported classes we use ``pragma Import`` with convention ``C_Plus_Plus``
to indicate that they have been defined on the C++ side; this is required
because the dispatch table associated with these tagged types will be built
in the C++ side and therefore will not contain the predefined Ada primitives
@@ -4368,7 +4384,7 @@ As the reader can see there is no need to indicate the C++ mangled names
associated with each subprogram because it is assumed that all the calls to
these primitives will be dispatching calls. The only exception is the
constructor, which must be registered with the compiler by means of
-`pragma CPP_Constructor` and needs to provide its associated C++
+``pragma CPP_Constructor`` and needs to provide its associated C++
mangled name because the Ada compiler generates direct calls to it.
With the above packages we can now declare objects of type Dog on the Ada side
@@ -4440,14 +4456,14 @@ them to C++, using the same hierarchy of our previous example:
end Animals;
Compared with our previous example the only differences are the use of
-`pragma Convention` (instead of `pragma Import`), and the use of
-`pragma Export` to indicate to the GNAT compiler that the primitives will
+``pragma Convention`` (instead of ``pragma Import``), and the use of
+``pragma Export`` to indicate to the GNAT compiler that the primitives will
be available to C++. Thanks to the ABI compatibility, on the C++ side there is
nothing else to be done; as explained above, the only requirement is that all
the primitives and components are declared in exactly the same order.
For completeness, let us see a brief C++ main program that uses the
-declarations available in `animals.h` (presented in our first example) to
+declarations available in :file:`animals.h` (presented in our first example) to
import and use the declarations from the Ada side, properly initializing and
finalizing the Ada run-time system along the way:
@@ -4508,7 +4524,7 @@ Some of the known limitations include:
* some extensions (e.g. vector types) are not supported
* pointers to pointers or complex structures are mapped to System.Address
* identifiers with identical name (except casing) will generate compilation
- errors (e.g. `shm_get` vs `SHM_GET`).
+ errors (e.g. ``shm_get`` vs ``SHM_GET``).
The code generated is using the Ada 2005 syntax, which makes it
easier to interface with other languages than previous versions of Ada.
@@ -4518,8 +4534,8 @@ easier to interface with other languages than previous versions of Ada.
Running the Binding Generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-The binding generator is part of the *gcc* compiler and can be
-invoked via the *-fdump-ada-spec* switch, which will generate Ada
+The binding generator is part of the ``gcc`` compiler and can be
+invoked via the :switch:`-fdump-ada-spec` switch, which will generate Ada
spec files for the header files specified on the command line, and all
header files needed by these files transitively. For example:
@@ -4531,17 +4547,17 @@ header files needed by these files transitively. For example:
will generate, under GNU/Linux, the following files: :file:`time_h.ads`,
:file:`bits_time_h.ads`, :file:`stddef_h.ads`, :file:`bits_types_h.ads` which
correspond to the files :file:`/usr/include/time.h`,
-:file:`/usr/include/bits/time.h`, etc..., and will then compile in Ada 2005
-mode these Ada specs.
+:file:`/usr/include/bits/time.h`, etc..., and will then compile these Ada specs
+in Ada 2005 mode.
-The `-C` switch tells *gcc* to extract comments from headers,
+The :switch:`-C` switch tells ``gcc`` to extract comments from headers,
and will attempt to generate corresponding Ada comments.
If you want to generate a single Ada file and not the transitive closure, you
-can use instead the *-fdump-ada-spec-slim* switch.
+can use instead the :switch:`-fdump-ada-spec-slim` switch.
You can optionally specify a parent unit, of which all generated units will
-be children, using `-fada-spec-parent=<unit>`.
+be children, using :switch:`-fada-spec-parent={unit}`.
Note that we recommend when possible to use the *g++* driver to
generate bindings, even for most C headers, since this will in general
@@ -4549,7 +4565,7 @@ generate better Ada specs. For generating bindings for C++ headers, it is
mandatory to use the *g++* command, or *gcc -x c++* which
is equivalent in this case. If *g++* cannot work on your C headers
because of incompatibilities between C and C++, then you can fallback to
-*gcc* instead.
+``gcc`` instead.
For an example of better bindings generated from the C++ front-end,
the name of the parameters (when available) are actually ignored by the C
@@ -4559,7 +4575,7 @@ front-end. Consider the following C header:
extern void foo (int variable);
-with the C front-end, `variable` is ignored, and the above is handled as:
+with the C front-end, ``variable`` is ignored, and the above is handled as:
.. code-block:: c
@@ -4578,7 +4594,7 @@ with the C++ front-end, the name is available, and we generate:
procedure foo (variable : int);
In some cases, the generated bindings will be more complete or more meaningful
-when defining some macros, which you can do via the *-D* switch. This
+when defining some macros, which you can do via the :switch:`-D` switch. This
is for example the case with :file:`Xlib.h` under GNU/Linux:
.. code-block:: sh
@@ -4586,12 +4602,12 @@ is for example the case with :file:`Xlib.h` under GNU/Linux:
$ g++ -c -fdump-ada-spec -DXLIB_ILLEGAL_ACCESS -C /usr/include/X11/Xlib.h
The above will generate more complete bindings than a straight call without
-the *-DXLIB_ILLEGAL_ACCESS* switch.
+the :switch:`-DXLIB_ILLEGAL_ACCESS` switch.
In other cases, it is not possible to parse a header file in a stand-alone
manner, because other include files need to be included first. In this
case, the solution is to create a small header file including the needed
-`#include` and possible `#define` directives. For example, to
+``#include`` and possible ``#define`` directives. For example, to
generate Ada bindings for :file:`readline/readline.h`, you need to first
include :file:`stdio.h`, so you can create a file with the following two
lines in e.g. :file:`readline1.h`:
@@ -4620,7 +4636,7 @@ support for C headers. As a result, you will need to modify the resulting
bindings by hand more extensively when using C++ headers.
In this mode, C++ classes will be mapped to Ada tagged types, constructors
-will be mapped using the `CPP_Constructor` pragma, and when possible,
+will be mapped using the ``CPP_Constructor`` pragma, and when possible,
multiple inheritance of abstract classes will be mapped to Ada interfaces
(see the *Interfacing to C++* section in the :title:`GNAT Reference Manual`
for additional information on interfacing to C++).
@@ -4717,25 +4733,25 @@ Switches
.. index:: -fdump-ada-spec (gcc)
-:samp:`-fdump-ada-spec`
+:switch:`-fdump-ada-spec`
Generate Ada spec files for the given header files transitively (including
all header files that these headers depend upon).
.. index:: -fdump-ada-spec-slim (gcc)
-:samp:`-fdump-ada-spec-slim`
+:switch:`-fdump-ada-spec-slim`
Generate Ada spec files for the header files specified on the command line
only.
.. index:: -fada-spec-parent (gcc)
-:samp:`-fada-spec-parent={unit}`
- Specifies that all files generated by *-fdump-ada-spec** are
+:switch:`-fada-spec-parent={unit}`
+ Specifies that all files generated by :switch:`-fdump-ada-spec` are
to be child units of the specified parent unit.
.. index:: -C (gcc)
-:samp:`-C`
+:switch:`-C`
Extract comments from headers and generate Ada comments in the Ada spec files.
.. _Generating_C_Headers_for_Ada_Specifications:
@@ -4762,7 +4778,7 @@ Running the C Header Generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The C header generator is part of the GNAT compiler and can be invoked via
-the *-gnatceg* combination of switches, which will generate a :file:`.h`
+the :switch:`-gnatceg` combination of switches, which will generate a :file:`.h`
file corresponding to the given input file (Ada spec or body). Note that
only spec files are processed in any case, so giving a spec or a body file
as input is equivalent. For example:
@@ -4799,7 +4815,7 @@ For instance, given the following Ada files:
procedure Proc2 (R : in out Rec);
end Pack1;
-The above `gcc` command will generate the following :file:`pack1.h` file:
+The above ``gcc`` command will generate the following :file:`pack1.h` file:
.. code-block:: c
@@ -4821,7 +4837,7 @@ The above `gcc` command will generate the following :file:`pack1.h` file:
extern void pack1__proc2(pack1__rec *r);
#endif /* PACK1_ADS */
-You can then `include` :file:`pack1.h` from a C source file and use the types,
+You can then ``include`` :file:`pack1.h` from a C source file and use the types,
call subprograms, reference objects, and constants.
.. _GNAT_and_Other_Compilation_Models:
@@ -4842,7 +4858,7 @@ Comparison between GNAT and C/C++ Compilation Models
The GNAT model of compilation is close to the C and C++ models. You can
think of Ada specs as corresponding to header files in C. As in C, you
don't need to compile specs; they are compiled when they are used. The
-Ada |with| is similar in effect to the `#include` of a C
+Ada |with| is similar in effect to the ``#include`` of a C
header.
One notable difference is that, in Ada, you may compile specs separately
@@ -4864,7 +4880,7 @@ The other important function of the binder is to deal with elaboration
issues. There are also elaboration issues in C++ that are handled
automatically. This automatic handling has the advantage of being
simpler to use, but the C++ programmer has no control over elaboration.
-Where `gnatbind` might complain there was no valid order of
+Where ``gnatbind`` might complain there was no valid order of
elaboration, a C++ compiler would simply construct a program that
malfunctioned at run time.
@@ -4971,9 +4987,9 @@ we have the following package spec:
.. index:: pragma Export
-The variable `MN` has a full expanded Ada name of `QRS.MN`, so
-the corresponding link name is `qrs__mn`.
-Of course if a `pragma Export` is used this may be overridden:
+The variable ``MN`` has a full expanded Ada name of ``QRS.MN``, so
+the corresponding link name is ``qrs__mn``.
+Of course if a ``pragma Export`` is used this may be overridden:
.. code-block:: ada
@@ -4984,23 +5000,23 @@ Of course if a `pragma Export` is used this may be overridden:
pragma Export (Var2, C, Link_Name => "var2_link_name");
end Exports;
-In this case, the link name for `Var1` is whatever link name the
-C compiler would assign for the C function `var1_name`. This typically
-would be either `var1_name` or `_var1_name`, depending on operating
+In this case, the link name for ``Var1`` is whatever link name the
+C compiler would assign for the C function ``var1_name``. This typically
+would be either ``var1_name`` or ``_var1_name``, depending on operating
system conventions, but other possibilities exist. The link name for
-`Var2` is `var2_link_name`, and this is not operating system
+``Var2`` is ``var2_link_name``, and this is not operating system
dependent.
One exception occurs for library level procedures. A potential ambiguity
-arises between the required name `_main` for the C main program,
+arises between the required name ``_main`` for the C main program,
and the name we would otherwise assign to an Ada library level procedure
-called `Main` (which might well not be the main program).
+called ``Main`` (which might well not be the main program).
-To avoid this ambiguity, we attach the prefix `_ada_` to such
+To avoid this ambiguity, we attach the prefix ``_ada_`` to such
names. So if we have a library level procedure such as:
.. code-block:: ada
procedure Hello (S : String);
-the external name of this procedure will be `_ada_hello`.
+the external name of this procedure will be ``_ada_hello``.