OSDN Git Service

2005-03-29 Robert Dewar <dewar@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / a-direio.adb
index 310e24f..0c01d1a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2003 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2004 Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -38,6 +38,7 @@
 
 with Interfaces.C_Streams; use Interfaces.C_Streams;
 with System;               use System;
+with System.CRTL;
 with System.File_Control_Block;
 with System.File_IO;
 with System.Direct_IO;
@@ -65,6 +66,8 @@ package body Ada.Direct_IO is
    function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode);
    function To_DIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode);
 
+   use type System.CRTL.size_t;
+
    -----------
    -- Close --
    -----------
@@ -180,9 +183,15 @@ package body Ada.Direct_IO is
       --  For a non-constrained variant record type, we read into an
       --  intermediate buffer, since we may have the case of discriminated
       --  records where a discriminant check is required, and we may need
-      --  to assign only part of the record buffer originally written
+      --  to assign only part of the record buffer originally written.
+
+      --  Note: we have to turn warnings on/off because this use of
+      --  the Constrained attribute is an obsolescent feature.
 
+      pragma Warnings (Off);
       if not Element_Type'Constrained then
+         pragma Warnings (On);
+
          declare
             Buf : Element_Type;
 
@@ -202,7 +211,13 @@ package body Ada.Direct_IO is
    begin
       --  Same processing for unconstrained case as above
 
+      --  Note: we have to turn warnings on/off because this use of
+      --  the Constrained attribute is an obsolescent feature.
+
+      pragma Warnings (Off);
       if not Element_Type'Constrained then
+         pragma Warnings (On);
+
          declare
             Buf : Element_Type;