[Ada] Fix illegal Ada in s-dwalin.adb
authorRomain Beguet <beguet@adacore.com>
Mon, 25 Apr 2022 13:57:25 +0000 (15:57 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 30 May 2022 08:29:03 +0000 (08:29 +0000)
Both the `System.Mmap` and `System.Object_Reader` packages are defining
entities named `Offset` and they are both `use`d at the top of
s-dwalin.adb.

Therefore, the references to `Offset` throughout this file are
ambiguous, and GNAT is supposed to complain. Since it does not for the
moment, we fix the ambiguity by declaring a subtype `Offset` at the top
of the file simply renames `System.Object_Reader.Offset`.

gcc/ada/

* libgnat/s-dwalin.adb: Add a subtype declaration to fix the
ambiguity.

gcc/ada/libgnat/s-dwalin.adb

index 5a0a2f6..e1e55f3 100644 (file)
@@ -44,6 +44,8 @@ with System.Storage_Elements;  use System.Storage_Elements;
 
 package body System.Dwarf_Lines is
 
+   subtype Offset is Object_Reader.Offset;
+
    function Get_Load_Displacement (C : Dwarf_Context) return Storage_Offset;
    --  Return the displacement between the load address present in the binary
    --  and the run-time address at which it is loaded (i.e. non-zero for PIE).