]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Pragma Ada_XX not propagated from library level spec to body
authorJavier Miranda <miranda@adacore.com>
Mon, 3 Mar 2025 11:34:35 +0000 (11:34 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 9 Jun 2025 06:32:07 +0000 (08:32 +0200)
Add documentation to pragmas Ada_83, Ada_95, Ada_05, Ada_12,
and Ada_2022: when placed before a library level package
specification they are not propagated to the corresponding
package body; they must be added explicitly to the package
body.

gcc/ada/ChangeLog:

* doc/gnat_rm/implementation_defined_pragmas.rst: Adding
documentation.
* doc/gnat_ugn/the_gnat_compilation_model.rst: ditto.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.

gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst
gcc/ada/gnat_rm.texi
gcc/ada/gnat_ugn.texi

index cae8c168562b61d13092e272beb5552348085af9..02013f1d9b124a3ba31eb16e7a170c40c3888a2e 100644 (file)
@@ -123,6 +123,11 @@ and generics may name types with unknown discriminants without using
 the ``(<>)`` notation.  In addition, some but not all of the additional
 restrictions of Ada 83 are enforced.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 Ada 83 mode is intended for two purposes.  Firstly, it allows existing
 Ada 83 code to be compiled and adapted to GNAT with less effort.
 Secondly, it aids in keeping code backwards compatible with Ada 83.
@@ -149,6 +154,11 @@ contexts.  This pragma is useful when writing a reusable component that
 itself uses Ada 95 features, but which is intended to be usable from
 either Ada 83 or Ada 95 programs.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 Pragma Ada_05
 =============
 
@@ -166,6 +176,11 @@ This pragma is useful when writing a reusable component that
 itself uses Ada 2005 features, but which is intended to be usable from
 either Ada 83 or Ada 95 programs.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 The one argument form (which is not a configuration pragma)
 is used for managing the transition from
 Ada 95 to Ada 2005 in the run-time library. If an entity is marked
@@ -209,6 +224,11 @@ contexts.  This pragma is useful when writing a reusable component that
 itself uses Ada 2012 features, but which is intended to be usable from
 Ada 83, Ada 95, or Ada 2005 programs.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 The one argument form, which is not a configuration pragma,
 is used for managing the transition from Ada
 2005 to Ada 2012 in the run-time library. If an entity is marked
@@ -252,6 +272,11 @@ contexts.  This pragma is useful when writing a reusable component that
 itself uses Ada 2022 features, but which is intended to be usable from
 Ada 83, Ada 95, Ada 2005 or Ada 2012 programs.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 The one argument form, which is not a configuration pragma,
 is used for managing the transition from Ada
 2012 to Ada 2022 in the run-time library. If an entity is marked
index 64a363132c710caacdef9ca5a3038909130f65a5..891886b53601130222ddbc604091f64da8848521 100644 (file)
@@ -1477,6 +1477,10 @@ You can place configuration pragmas either appear at the start of a compilation
 unit or in a configuration pragma file that applies to
 all compilations performed in a given compilation environment.
 
+Configuration pragmas placed before a library level package specification
+are not propagated to the corresponding package body (see RM 10.1.5(8));
+they must be added explicitly to the package body.
+
 GNAT includes the ``gnatchop`` utility to provide an automatic
 way to handle configuration pragmas that follows the semantics for
 compilations (that is, files with multiple units) described in the RM.
index 4d984713e0200627f96564792cf149bf6a977d95..f44260b4a331cd2ea6a49eaa73f8c3b5bc99cb32 100644 (file)
@@ -1581,6 +1581,11 @@ and generics may name types with unknown discriminants without using
 the @code{(<>)} notation.  In addition, some but not all of the additional
 restrictions of Ada 83 are enforced.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 Ada 83 mode is intended for two purposes.  Firstly, it allows existing
 Ada 83 code to be compiled and adapted to GNAT with less effort.
 Secondly, it aids in keeping code backwards compatible with Ada 83.
@@ -1608,6 +1613,11 @@ contexts.  This pragma is useful when writing a reusable component that
 itself uses Ada 95 features, but which is intended to be usable from
 either Ada 83 or Ada 95 programs.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 @node Pragma Ada_05,Pragma Ada_2005,Pragma Ada_95,Implementation Defined Pragmas
 @anchor{gnat_rm/implementation_defined_pragmas pragma-ada-05}@anchor{21}
 @section Pragma Ada_05
@@ -1626,6 +1636,11 @@ This pragma is useful when writing a reusable component that
 itself uses Ada 2005 features, but which is intended to be usable from
 either Ada 83 or Ada 95 programs.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 The one argument form (which is not a configuration pragma)
 is used for managing the transition from
 Ada 95 to Ada 2005 in the run-time library. If an entity is marked
@@ -1671,6 +1686,11 @@ contexts.  This pragma is useful when writing a reusable component that
 itself uses Ada 2012 features, but which is intended to be usable from
 Ada 83, Ada 95, or Ada 2005 programs.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 The one argument form, which is not a configuration pragma,
 is used for managing the transition from Ada
 2005 to Ada 2012 in the run-time library. If an entity is marked
@@ -1716,6 +1736,11 @@ contexts.  This pragma is useful when writing a reusable component that
 itself uses Ada 2022 features, but which is intended to be usable from
 Ada 83, Ada 95, Ada 2005 or Ada 2012 programs.
 
+Like all configuration pragmas, if the pragma is placed before a library
+level package specification it is not propagated to the corresponding
+package body (see RM 10.1.5(8)); it must be added explicitly to the
+package body.
+
 The one argument form, which is not a configuration pragma,
 is used for managing the transition from Ada
 2012 to Ada 2022 in the run-time library. If an entity is marked
index ca1d7bcc1abf2925498bb0c80df47603b5eef884..0a3cdb502233e847bdc6d6a27fddba697f876244 100644 (file)
@@ -2911,6 +2911,10 @@ You can place configuration pragmas either appear at the start of a compilation
 unit or in a configuration pragma file that applies to
 all compilations performed in a given compilation environment.
 
+Configuration pragmas placed before a library level package specification
+are not propagated to the corresponding package body (see RM 10.1.5(8));
+they must be added explicitly to the package body.
+
 GNAT includes the @code{gnatchop} utility to provide an automatic
 way to handle configuration pragmas that follows the semantics for
 compilations (that is, files with multiple units) described in the RM.
@@ -29833,8 +29837,8 @@ to permit their use in free software.
 
 @printindex ge
 
-@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{                              }
 @anchor{d2}@w{                              }
+@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{                              }
 
 @c %**end of body
 @bye