[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 12 Jun 2012 10:33:06 +0000 (12:33 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 12 Jun 2012 10:33:06 +0000 (12:33 +0200)
2012-06-12  Robert Dewar  <dewar@adacore.com>

* a-direct.adb: Minor reformatting.

2012-06-12  Robert Dewar  <dewar@adacore.com>

* gnat_ugn.texi: Add missing documentation for -gnatw.v and
-gnatw.V.

2012-06-12  Thomas Quinot  <quinot@adacore.com>

* sem_ch7.adb, sem_prag.adb, sem_ch12.adb, sem_ch4.adb,
sem_ch13.adb: Minor rewording of error messages for unchecked unions.

From-SVN: r188441

gcc/ada/ChangeLog
gcc/ada/a-direct.adb
gcc/ada/gnat_ugn.texi
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch7.adb
gcc/ada/sem_prag.adb

index d65c794dd1b711358c4f696b53ddbd09f56af6ef..4f6782225e9a6e8d70a62a74da0ccd82221780fc 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-12  Robert Dewar  <dewar@adacore.com>
+
+       * a-direct.adb: Minor reformatting.
+
+2012-06-12  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_ugn.texi: Add missing documentation for -gnatw.v and
+       -gnatw.V.
+
+2012-06-12  Thomas Quinot  <quinot@adacore.com>
+
+       * sem_ch7.adb, sem_prag.adb, sem_ch12.adb, sem_ch4.adb,
+       sem_ch13.adb: Minor rewording of error messages for unchecked unions.
+
 2012-06-12  Robert Dewar  <dewar@adacore.com>
 
        * lib-xref.ads: Minor reformatting.
index 61de3237cd99be22f615eb86206ed560be65cea8..cac87afcbfe5f210b3e0eb696bd087d48aedf0bc 100644 (file)
@@ -56,6 +56,7 @@ package body Ada.Directories is
    --  opendir routine.
 
    No_Dir : constant Dir_Type_Value := Dir_Type_Value (Null_Address);
+   --  Null directory value
 
    Dir_Separator : constant Character;
    pragma Import (C, Dir_Separator, "__gnat_dir_separator");
@@ -232,13 +233,14 @@ package body Ada.Directories is
             elsif Norm = "/"
               or else
                 (Windows
-                 and then
-                   (Norm = "\"
-                    or else
-                      (Norm'Length = 3
-                        and then Norm (Norm'Last - 1 .. Norm'Last) = ":\"
-                        and then (Norm (Norm'First) in 'a' .. 'z'
-                                   or else Norm (Norm'First) in 'A' .. 'Z'))))
+                  and then
+                    (Norm = "\"
+                      or else
+                        (Norm'Length = 3
+                          and then Norm (Norm'Last - 1 .. Norm'Last) = ":\"
+                          and then (Norm (Norm'First) in 'a' .. 'z'
+                                     or else
+                                       Norm (Norm'First) in 'A' .. 'Z'))))
             then
                raise Use_Error with
                  "directory """ & Name & """ has no containing directory";
@@ -349,16 +351,12 @@ package body Ada.Directories is
 
                if V1 = 0 then
                   Mode := Overwrite;
-
                elsif Formstr (V1 .. V2) = "copy" then
                   Mode := Copy;
-
                elsif Formstr (V1 .. V2) = "overwrite" then
                   Mode := Overwrite;
-
                elsif Formstr (V1 .. V2) = "append" then
                   Mode := Append;
-
                else
                   raise Use_Error with "invalid Form";
                end if;
@@ -367,16 +365,12 @@ package body Ada.Directories is
 
                if V1 = 0 then
                   Preserve := None;
-
                elsif Formstr (V1 .. V2) = "timestamps" then
                   Preserve := Time_Stamps;
-
                elsif Formstr (V1 .. V2) = "all_attributes" then
                   Preserve := Full;
-
                elsif Formstr (V1 .. V2) = "no_attributes" then
                   Preserve := None;
-
                else
                   raise Use_Error with "invalid Form";
                end if;
@@ -535,10 +529,11 @@ package body Ada.Directories is
       elsif not Is_Directory (Directory) then
          raise Name_Error with '"' & Directory & """ not a directory";
 
+      --  Do the deletion, checking for error
+
       else
          declare
             C_Dir_Name : constant String := Directory & ASCII.NUL;
-
          begin
             if rmdir (C_Dir_Name) /= 0 then
                raise Use_Error with
@@ -597,8 +592,8 @@ package body Ada.Directories is
 
       else
          Set_Directory (Directory);
-         Start_Search (Search, Directory => ".", Pattern => "");
 
+         Start_Search (Search, Directory => ".", Pattern => "");
          while More_Entries (Search) loop
             Get_Next_Entry (Search, Dir_Ent);
 
@@ -849,8 +844,8 @@ package body Ada.Directories is
          --  Use System.OS_Lib.Normalize_Pathname
 
          declare
-            --  We need to resolve links because of A.16(47), since we must not
-            --  return alternative names for files.
+            --  We need to resolve links because of (RM A.16(47)), which says
+            --  we must not return alternative names for files.
 
             Value : constant String := Normalize_Pathname (Name);
             subtype Result is String (1 .. Value'Length);
@@ -920,6 +915,8 @@ package body Ada.Directories is
       if not File_Exists (Name) then
          raise Name_Error with "file """ & Name & """ does not exist";
 
+      --  If OK, return appropriate kind
+
       elsif Is_Regular_File (Name) then
          return Ordinary_File;
 
@@ -1059,9 +1056,9 @@ package body Ada.Directories is
            "new name """ & New_Name
            & """ designates a file that already exists";
 
-      else
-         --  Do actual rename using System.OS_Lib.Rename_File
+      --  Do actual rename using System.OS_Lib.Rename_File
 
+      else
          Rename_File (Old_Name, New_Name, Success);
 
          if not Success then
@@ -1100,7 +1097,6 @@ package body Ada.Directories is
 
    begin
       Start_Search (Srch, Directory, Pattern, Filter);
-
       while More_Entries (Srch) loop
          Get_Next_Entry (Srch, Directory_Entry);
          Process (Directory_Entry);
index 825c8a4df7aba085cf4b71b93dce56e0ae62f507..3f02f7573d6f8d9b92f16f731c6c38b33cfc24f6 100644 (file)
@@ -5806,6 +5806,24 @@ then the following code:
 will suppress warnings on subsequent statements that access components
 of variable Tab.
 
+@item -gnatw.v
+@emph{Activate info messages for non-default bit order.}
+@cindex @option{-gnatw.v} (@command{gcc})
+@cindex bit order warnings
+This switch activates messages (labeled "info", they are not warnings,
+just informational messages) about the effects of non-default bit-order
+on records to which a component clause is applied. The effect of specifying
+non-default bit ordering is a bit subtle (and changed with Ada 2005), so
+these messages, which are given by default, are useful in understanding the
+exact consequences of using this feature. These messages
+can also be turned on using @option{-gnatwa}
+
+@item -gnatw.V
+@emph{Suppress info messages for non-default bit order.}
+@cindex @option{-gnatw.V} (@command{gcc})
+This switch suppresses information messages for the effects of specifying
+non-default bit order on record components with component clauses.
+
 @item -gnatww
 @emph{Activate warnings on wrong low bound assumption.}
 @cindex @option{-gnatww} (@command{gcc})
index 6f398006d581403e83d5e45a2f0086926f298108..d38d2e277ddd2c880026050901d363e2dfd2134e 100644 (file)
@@ -11442,7 +11442,7 @@ package body Sem_Ch12 is
             then
                null;
             else
-               Error_Msg_N ("Unchecked_Union cannot be the actual for a" &
+               Error_Msg_N ("unchecked union cannot be the actual for a" &
                  " discriminated formal type", Act_T);
 
             end if;
index 9acce0f163c4c98d904b0828230e93f8645b5160..80781ab7bd74a71773ac443c883d15bb5b5183f4 100644 (file)
@@ -4481,7 +4481,7 @@ package body Sem_Ch13 is
                     and then Is_Unchecked_Union (Rectype)
                   then
                      Error_Msg_N
-                       ("cannot reference discriminant of Unchecked_Union",
+                       ("cannot reference discriminant of unchecked union",
                         Component_Name (CC));
 
                   elsif Present (Component_Clause (Comp)) then
index c1e386ecbe0451d938c26212656e7e492653827b..f1f7c608ea30080cc69bda71d00b8ef2a050821b 100644 (file)
@@ -3891,7 +3891,7 @@ package body Sem_Ch4 is
                if Ekind (Comp) = E_Discriminant then
                   if Is_Unchecked_Union (Base_Type (Prefix_Type)) then
                      Error_Msg_N
-                       ("cannot reference discriminant of Unchecked_Union",
+                       ("cannot reference discriminant of unchecked union",
                         Sel);
                   end if;
 
index e30bb0c458e56eb6b5f28170b5085536ba2020a7..2774c2a790287461f8ed58d90f7486ff2b974c3c 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2012, 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- --
@@ -897,10 +897,8 @@ package body Sem_Ch7 is
       --  is a public child of Parent as defined in 10.1.1
 
       procedure Inspect_Unchecked_Union_Completion (Decls : List_Id);
-      --  Detects all incomplete or private type declarations having a known
-      --  discriminant part that are completed by an Unchecked_Union. Emits
-      --  the error message "Unchecked_Union may not complete discriminated
-      --  partial view".
+      --  Reject completion of an incomplete or private type declarations
+      --  having a known discriminant part by an unchecked union.
 
       procedure Install_Parent_Private_Declarations (Inst_Id : Entity_Id);
       --  Given the package entity of a generic package instantiation or
@@ -1091,7 +1089,7 @@ package body Sem_Ch7 is
             then
                Error_Msg_N
                  ("completion of discriminated partial view "
-                  & "cannot be an Unchecked_Union",
+                  & "cannot be an unchecked union",
                  Full_View (Defining_Identifier (Decl)));
             end if;
 
@@ -1397,7 +1395,7 @@ package body Sem_Ch7 is
 
       --  Ada 2005 (AI-216): The completion of an incomplete or private type
       --  declaration having a known_discriminant_part shall not be an
-      --  Unchecked_Union type.
+      --  unchecked union type.
 
       if Present (Vis_Decls) then
          Inspect_Unchecked_Union_Completion (Vis_Decls);
index 2b038fa51c9d7e4963d4d3308135d51097b5665c..d041ca3a5f0260ea75c080c712c74a6949e29e9d 100644 (file)
@@ -1408,15 +1408,15 @@ package body Sem_Prag is
            and then Is_Generic_Type (Typ)
          then
             Error_Msg_N
-              ("component of Unchecked_Union cannot be of generic type", Comp);
+              ("component of unchecked union cannot be of generic type", Comp);
 
          elsif Needs_Finalization (Typ) then
             Error_Msg_N
-              ("component of Unchecked_Union cannot be controlled", Comp);
+              ("component of unchecked union cannot be controlled", Comp);
 
          elsif Has_Task (Typ) then
             Error_Msg_N
-              ("component of Unchecked_Union cannot have tasks", Comp);
+              ("component of unchecked union cannot have tasks", Comp);
          end if;
       end Check_Component;
 
@@ -14164,16 +14164,16 @@ package body Sem_Prag is
             --  the relevant type declaration at an appropriate point.
 
             if not Is_Record_Type (Typ) then
-               Error_Msg_N ("Unchecked_Union must be record type", Typ);
+               Error_Msg_N ("unchecked union must be record type", Typ);
                return;
 
             elsif Is_Tagged_Type (Typ) then
-               Error_Msg_N ("Unchecked_Union must not be tagged", Typ);
+               Error_Msg_N ("unchecked union must not be tagged", Typ);
                return;
 
             elsif not Has_Discriminants (Typ) then
                Error_Msg_N
-                ("Unchecked_Union must have one discriminant", Typ);
+                ("unchecked union must have one discriminant", Typ);
                return;
 
             --  Note: in previous versions of GNAT we used to check for limited
@@ -14187,7 +14187,7 @@ package body Sem_Prag is
                while Present (Discr) loop
                   if No (Discriminant_Default_Value (Discr)) then
                      Error_Msg_N
-                       ("Unchecked_Union discriminant must have default value",
+                       ("unchecked union discriminant must have default value",
                         Discr);
                   end if;
 
@@ -14201,7 +14201,7 @@ package body Sem_Prag is
 
                if No (Clist) or else No (Variant_Part (Clist)) then
                   Error_Msg_N
-                    ("Unchecked_Union must have variant part", Tdef);
+                    ("unchecked union must have variant part", Tdef);
                   return;
                end if;