diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-02-09 13:01:11 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-13 08:04:29 +0000 |
commit | cb50998584eda9bbd3377d3dca6a8d264d6c4891 (patch) | |
tree | e871f1069b53f814929873605f0f52d0ae3055b6 /gcc/ada/doc | |
parent | 84f20139792e97f9fb6e10918e271c3277d0f178 (diff) | |
download | gcc-cb50998584eda9bbd3377d3dca6a8d264d6c4891.zip gcc-cb50998584eda9bbd3377d3dca6a8d264d6c4891.tar.gz gcc-cb50998584eda9bbd3377d3dca6a8d264d6c4891.tar.bz2 |
[Ada] Remove obsolete uses of Unchecked_Deallocation from Ada 83
In Ada 83 the Unchecked_Deallocation was a top-level unit; since Ada 95
it is an obsolete renaming of Ada.Unchecked_Deallocation. GNAT doesn't
yet warn about uses of these obsolete renamings, but it still seems
better to avoid them.
Cleanup before adding a new instance of Unchecked_Deallocation.
Offending occurrences found with grep.
gcc/ada/
* butil.adb, sem.adb, sinput.adb, types.ads, xref_lib.adb:
Replace uses of Unchecked_Deallocation with
Ada.Unchecked_Deallocation.
* doc/gnat_ugn/gnat_and_program_execution.rst: Likewise for the
documentation; fix casing of GNAT.IO.
* gnat_ugn.texi: Regenerate.
Diffstat (limited to 'gcc/ada/doc')
-rw-r--r-- | gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst | 14 |
1 files changed, 7 insertions, 7 deletions
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 6104152..bf0fec9 100644 --- a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst +++ b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst @@ -3590,9 +3590,9 @@ properly allocated memory location. Here is a complete example of use of .. code-block:: ada - with Gnat.Io; use Gnat.Io; - with Unchecked_Deallocation; - with Unchecked_Conversion; + with GNAT.IO; use GNAT.IO; + with Ada.Unchecked_Deallocation; + with Ada.Unchecked_Conversion; with GNAT.Debug_Pools; with System.Storage_Elements; with Ada.Exceptions; use Ada.Exceptions; @@ -3604,8 +3604,8 @@ properly allocated memory location. Here is a complete example of use of P : GNAT.Debug_Pools.Debug_Pool; for T'Storage_Pool use P; - procedure Free is new Unchecked_Deallocation (Integer, T); - function UC is new Unchecked_Conversion (U, T); + procedure Free is new Ada.Unchecked_Deallocation (Integer, T); + function UC is new Ada.Unchecked_Conversion (U, T); A, B : aliased T; procedure Info is new GNAT.Debug_Pools.Print_Info(Put_Line); @@ -3864,12 +3864,12 @@ execution of this erroneous program: .. code-block:: ada - with Unchecked_Deallocation; + with Ada.Unchecked_Deallocation; procedure Test_Gm is type T is array (1..1000) of Integer; type Ptr is access T; - procedure Free is new Unchecked_Deallocation (T, Ptr); + procedure Free is new Ada.Unchecked_Deallocation (T, Ptr); A : Ptr; procedure My_Alloc is |