]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
s-direio.adb (Reset): Replace pragma Unmodified by Warnings (Off)...
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 31 Jul 2008 10:26:43 +0000 (12:26 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 31 Jul 2008 10:26:43 +0000 (12:26 +0200)
* s-direio.adb (Reset): Replace pragma Unmodified by Warnings (Off),
so that we can compile this file successfully with -gnatc.

From-SVN: r138382

gcc/ada/s-direio.adb

index c764a1c658e02ad00c29b63085c47744b992e825..8a6dd435e7cb5a1803f81d6400f5f7ef896c4279 100644 (file)
@@ -251,9 +251,12 @@ package body System.Direct_IO is
    -----------
 
    procedure Reset (File : in out File_Type; Mode : FCB.File_Mode) is
-      pragma Unmodified (File);
+      pragma Warnings (Off, File);
       --  File is actually modified via Unrestricted_Access below, but
       --  GNAT will generate a warning anyway.
+      --  Note that we do not use pragma Unmodified here, since in -gnatc
+      --  mode, GNAT will complain that File is modified for
+      --  "File.Index := 1;"
 
    begin
       FIO.Reset (AP (File)'Unrestricted_Access, Mode);
@@ -262,9 +265,8 @@ package body System.Direct_IO is
    end Reset;
 
    procedure Reset (File : in out File_Type) is
-      pragma Unmodified (File);
-      --  File is actually modified via Unrestricted_Access below, but
-      --  GNAT will generate a warning anyway.
+      pragma Warnings (Off, File);
+      --  See above (other Reset procedure) for explanations on this pragma
 
    begin
       FIO.Reset (AP (File)'Unrestricted_Access);