]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2017-04-28 Javier Miranda <miranda@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Apr 2017 13:47:23 +0000 (13:47 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Apr 2017 13:47:23 +0000 (13:47 +0000)
* atree.ads (Info_Messages): Removed.
(Warning_Info_Messages): New counter.
(Report_Info_Messages): New counter.
* err_vars.ads Update documentation.
* errout.adb (Delete_Warning_And_Continuations): Update
Info_Message occurrences.
(Error_Msg_Internal): Update Info_Message occurrences.
(Delete_Warning): Update Info_Message occurrences.
(Write_Error_Summary): Update Info_Message occurrences.
(Output_Messages): Update Info_Message occurrences.
(To_Be_Removed): Update Info_Message occurrences.
(Reset_Warnings): Update Info_Message occurrences.
* errutil.adb (Error_Msg): Update Info_Message occurrences.
(Finalize): Update Info_Message occurrences.
(Initialize): Update Info_Message occurrences.
* erroutc.adb (Delete_Msg): Update Info_Message occurrences.
(Compilation_Errors): Update Info_Message_Occurences.

2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>

        * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
        * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
        * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
        * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
        * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
        * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
        Y_Size.
        * sem_eval.adb (Why_Not_Static): Initialize Typ.
        * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247390 138bc75d-0d04-0410-961f-82ee72b054a4

14 files changed:
gcc/ada/ChangeLog
gcc/ada/atree.ads
gcc/ada/err_vars.ads
gcc/ada/errout.adb
gcc/ada/erroutc.adb
gcc/ada/errutil.adb
gcc/ada/exp_ch3.adb
gcc/ada/freeze.adb
gcc/ada/sem_aggr.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_eval.adb
gcc/ada/sem_prag.adb

index a52d9b460cf10ca81f4b1518d1c17fc5dc43bd2b..1ad8fbf53b4b9637064f13102c16dee17b07f4fc 100644 (file)
@@ -1,3 +1,35 @@
+2017-04-28  Javier Miranda  <miranda@adacore.com>
+
+       * atree.ads (Info_Messages): Removed.
+       (Warning_Info_Messages): New counter.
+       (Report_Info_Messages): New counter.
+       * err_vars.ads Update documentation.
+       * errout.adb (Delete_Warning_And_Continuations): Update
+       Info_Message occurrences.
+       (Error_Msg_Internal): Update Info_Message occurrences.
+       (Delete_Warning): Update Info_Message occurrences.
+       (Write_Error_Summary): Update Info_Message occurrences.
+       (Output_Messages): Update Info_Message occurrences.
+       (To_Be_Removed): Update Info_Message occurrences.
+       (Reset_Warnings): Update Info_Message occurrences.
+       * errutil.adb (Error_Msg): Update Info_Message occurrences.
+       (Finalize): Update Info_Message occurrences.
+       (Initialize): Update Info_Message occurrences.
+       * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
+       (Compilation_Errors): Update Info_Message_Occurences.
+
+2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+        * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
+        * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
+        * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
+        * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
+        * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
+        * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
+        Y_Size.
+        * sem_eval.adb (Why_Not_Static): Initialize Typ.
+        * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
+
 2017-04-28  Bob Duff  <duff@adacore.com>
 
        * sem_util.ads, sem_util.adb (Might_Raise): New function
index 92eabe43f8cf278817e0e29392e903d1a5ec06e7..5ed81e6853134e1d0e5792f85ed6678e205a9afc 100644 (file)
@@ -320,9 +320,15 @@ package Atree is
    --  compilation. Initialized for -gnatVa use, see comment above. This
    --  count includes the count of style and info messages.
 
-   Info_Messages : Nat := 0;
-   --  Number of info messages generated. Info messages are neved treated as
-   --  errors (whether from use of the pragma, or the compiler switch -gnatwe).
+   Warning_Info_Messages : Nat := 0;
+   --  Number of info messages generated as warnings. Info messages are never
+   --  treated as errors (whether from use of the pragma, or the compiler
+   --  switch -gnatwe).
+
+   Report_Info_Messages : Nat := 0;
+   --  Number of info messages generated as reports. Info messages are never
+   --  treated as errors (whether from use of the pragma, or the compiler
+   --  switch -gnatwe). Used under Spark_Mode to report proved checks.
 
    Check_Messages : Nat := 0;
    --  Number of check messages generated. Check messages are neither warnings
index 0024687d895ded30658d2e9deb68c05ab42fe82a..96c748998a87b5184e4e85cc7114584bc20d774a 100644 (file)
@@ -39,10 +39,11 @@ package Err_Vars is
    --  from invalid values in such cases.
 
    --  Note on error counts (Serious_Errors_Detected, Total_Errors_Detected,
-   --  Warnings_Detected, Info_Messages). These counts might more logically
-   --  appear in this unit, but we place them instead in atree.ads, because of
-   --  licensing issues. We need to be able to access these counts from units
-   --  that have the more general licensing conditions.
+   --  Warnings_Detected, Warning_Info_Messages, Report_Info_Messages). These
+   --  counts might more logically appear in this unit, but we place them
+   --  instead in atree.ads, because of licensing issues. We need to be able
+   --  to access these counts from units that have the more general licensing
+   --  conditions.
 
    ----------------------------------
    -- Error Message Mode Variables --
index 0ff4b4e9e347beae848b347b6c22bc837f35cb8f..204bd3221dc1ef963053da3d8453e58e5517078e 100644 (file)
@@ -277,7 +277,7 @@ package body Errout is
                Warnings_Detected := Warnings_Detected - 1;
 
                if M.Info then
-                  Info_Messages := Info_Messages - 1;
+                  Warning_Info_Messages := Warning_Info_Messages - 1;
                end if;
 
                if M.Warn_Err then
@@ -1186,12 +1186,14 @@ package body Errout is
       --  Bump appropriate statistics counts
 
       if Errors.Table (Cur_Msg).Info then
-         Info_Messages := Info_Messages + 1;
 
          --  Could be (usually is) both "info" and "warning"
 
          if Errors.Table (Cur_Msg).Warn then
+            Warning_Info_Messages := Warning_Info_Messages + 1;
             Warnings_Detected := Warnings_Detected + 1;
+         else
+            Report_Info_Messages := Report_Info_Messages + 1;
          end if;
 
       elsif Errors.Table (Cur_Msg).Warn
@@ -1420,7 +1422,7 @@ package body Errout is
             Warnings_Detected := Warnings_Detected - 1;
 
             if Errors.Table (E).Info then
-               Info_Messages := Info_Messages - 1;
+               Warning_Info_Messages := Warning_Info_Messages - 1;
             end if;
 
             if Errors.Table (E).Warn_Err then
@@ -1785,12 +1787,12 @@ package body Errout is
             Write_Str (" errors");
          end if;
 
-         if Warnings_Detected - Info_Messages /= 0 then
+         if Warnings_Detected - Warning_Info_Messages /= 0 then
             Write_Str (", ");
             Write_Int (Warnings_Detected);
             Write_Str (" warning");
 
-            if Warnings_Detected - Info_Messages /= 1 then
+            if Warnings_Detected - Warning_Info_Messages /= 1 then
                Write_Char ('s');
             end if;
 
@@ -1810,12 +1812,12 @@ package body Errout is
             end if;
          end if;
 
-         if Info_Messages /= 0 then
+         if Warning_Info_Messages + Report_Info_Messages /= 0 then
             Write_Str (", ");
-            Write_Int (Info_Messages);
+            Write_Int (Warning_Info_Messages + Report_Info_Messages);
             Write_Str (" info message");
 
-            if Info_Messages > 1 then
+            if Warning_Info_Messages + Report_Info_Messages > 1 then
                Write_Char ('s');
             end if;
          end if;
@@ -2119,13 +2121,13 @@ package body Errout is
 
       Write_Max_Errors;
 
-      --  Even though info messages are a subclass of warnings, they must not
-      --  be treated as errors when -gnatwe is in effect.
+      --  Even though Warning_Info_Messages are a subclass of warnings, they
+      --  must not be treated as errors when -gnatwe is in effect.
 
       if Warning_Mode = Treat_As_Error then
          Total_Errors_Detected :=
-           Total_Errors_Detected + Warnings_Detected - Info_Messages;
-         Warnings_Detected := Info_Messages;
+           Total_Errors_Detected + Warnings_Detected - Warning_Info_Messages;
+         Warnings_Detected := Warning_Info_Messages;
       end if;
    end Output_Messages;
 
@@ -2299,7 +2301,7 @@ package body Errout is
                Warnings_Detected := Warnings_Detected - 1;
 
                if Errors.Table (E).Info then
-                  Info_Messages := Info_Messages - 1;
+                  Warning_Info_Messages := Warning_Info_Messages - 1;
                end if;
 
                return True;
@@ -2400,7 +2402,7 @@ package body Errout is
    begin
       Warnings_Treated_As_Errors := 0;
       Warnings_Detected := 0;
-      Info_Messages := 0;
+      Warning_Info_Messages := 0;
       Warnings_As_Errors_Count := 0;
    end Reset_Warnings;
 
index b4fc53af77c02c5799515f05c7554a1f26dff7d9..464c64efc15399de3247dc29b36559fa57f8dbde 100644 (file)
@@ -140,10 +140,12 @@ package body Erroutc is
             --  Adjust error message count
 
             if Errors.Table (D).Info then
-               Info_Messages := Info_Messages - 1;
 
                if Errors.Table (D).Warn then
+                  Warning_Info_Messages := Warning_Info_Messages - 1;
                   Warnings_Detected := Warnings_Detected - 1;
+               else
+                  Report_Info_Messages := Report_Info_Messages - 1;
                end if;
 
             elsif Errors.Table (D).Warn or else Errors.Table (D).Style then
@@ -244,7 +246,7 @@ package body Erroutc is
    begin
       return
         Total_Errors_Detected /= 0
-          or else (Warnings_Detected - Info_Messages /= 0
+          or else (Warnings_Detected - Warning_Info_Messages /= 0
                     and then Warning_Mode = Treat_As_Error)
           or else Warnings_Treated_As_Errors /= 0;
    end Compilation_Errors;
index 057ce768220a461e486d178ca087392a70657f3d..498833abf41f389169aa7763107cd54bbfd56bad 100644 (file)
@@ -305,12 +305,14 @@ package body Errutil is
       --  Bump appropriate statistics counts
 
       if Errors.Table (Cur_Msg).Info then
-         Info_Messages := Info_Messages + 1;
 
          --  Could be (usually is) both "info" and "warning"
 
          if Errors.Table (Cur_Msg).Warn then
+            Warning_Info_Messages := Warning_Info_Messages + 1;
             Warnings_Detected := Warnings_Detected + 1;
+         else
+            Report_Info_Messages := Report_Info_Messages + 1;
          end if;
 
       elsif Errors.Table (Cur_Msg).Warn
@@ -548,19 +550,19 @@ package body Errutil is
             Write_Str (" errors");
          end if;
 
-         if Warnings_Detected - Info_Messages  /= 0 then
+         if Warnings_Detected - Warning_Info_Messages /= 0 then
             Write_Str (", ");
-            Write_Int (Warnings_Detected - Info_Messages);
+            Write_Int (Warnings_Detected - Warning_Info_Messages);
             Write_Str (" warning");
 
-            if Warnings_Detected - Info_Messages /= 1 then
+            if Warnings_Detected - Warning_Info_Messages /= 1 then
                Write_Char ('s');
             end if;
 
             if Warning_Mode = Treat_As_Error then
                Write_Str (" (treated as error");
 
-               if Warnings_Detected - Info_Messages /= 1 then
+               if Warnings_Detected - Warning_Info_Messages /= 1 then
                   Write_Char ('s');
                end if;
 
@@ -586,13 +588,13 @@ package body Errutil is
          end if;
       end if;
 
-      --  Even though info messages are a subclass of warnings, they must not
-      --  be treated as errors when -gnatwe is in effect.
+      --  Even though Warning_Info_Messages are a subclass of warnings, they
+      --  must not be treated as errors when -gnatwe is in effect.
 
       if Warning_Mode = Treat_As_Error then
          Total_Errors_Detected :=
-           Total_Errors_Detected + Warnings_Detected - Info_Messages;
-         Warnings_Detected := Info_Messages;
+           Total_Errors_Detected + Warnings_Detected - Warning_Info_Messages;
+         Warnings_Detected := Warning_Info_Messages;
       end if;
 
       --  Prevent displaying the same messages again in the future
@@ -612,7 +614,8 @@ package body Errutil is
       Serious_Errors_Detected := 0;
       Total_Errors_Detected := 0;
       Warnings_Detected := 0;
-      Info_Messages := 0;
+      Warning_Info_Messages := 0;
+      Report_Info_Messages := 0;
       Cur_Msg := No_Error_Msg;
 
       --  Initialize warnings table, if all warnings are suppressed, supply
index 8520de4e6b7735e4183a40efbb11cdf559760e05..c12752388667cab52e38a19b04e8a20555d71ad9 100644 (file)
@@ -2875,6 +2875,7 @@ package body Exp_Ch3 is
                   declare
                      Exp   : Node_Id;
                      Nam   : Name_Id;
+                     pragma Warnings (Off, Nam);
                      Ritem : Node_Id;
 
                   begin
index 8ce16cd2ed9b6cb3de84813e4fd424e6c2e11bba..5abbe39c1bd42a86bce4ca8f51aff11b3d2e41b5 100644 (file)
@@ -1174,6 +1174,7 @@ package body Freeze is
       Component_Aliased : Boolean;
 
       Comp_Byte_Aligned : Boolean;
+      pragma Warnings (Off, Comp_Byte_Aligned);
       --  Set for the record case, True if Comp starts on a byte boundary
       --  (in which case it is allowed to have different storage order).
 
index d18383525c3619a9ecb8900d77127e76fcabd5ef..1249fa03fed62ddbe48bd3862c437708951ad208 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2016, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2017, 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- --
@@ -3205,7 +3205,7 @@ package body Sem_Aggr is
       --
       --  This variable is updated as a side effect of function Get_Value.
 
-      Box_Node       : Node_Id;
+      Box_Node       : Node_Id := Empty;
       Is_Box_Present : Boolean := False;
       Others_Box     : Integer := 0;
       --  Ada 2005 (AI-287): Variables used in case of default initialization
index 7e4dba5382e268c301f63548a3348c2ba05932b4..ecb6ab29b89a6209ff4b19a4aeadc37319540c35 100644 (file)
@@ -4322,7 +4322,7 @@ package body Sem_Attr is
 
          Context   : constant Node_Id := Parent (N);
          Attr      : Node_Id;
-         Encl_Loop : Node_Id;
+         Encl_Loop : Node_Id   := Empty;
          Encl_Prag : Node_Id   := Empty;
          Loop_Id   : Entity_Id := Empty;
          Scop      : Entity_Id;
index 093a2bdf81ca8e582c4dd24eb5d873e8b10a473d..2b1e1ba5583bff20a60e4625bf2d1d4c86546a9a 100644 (file)
@@ -5652,6 +5652,7 @@ package body Sem_Ch12 is
 
       Decl    : Node_Id;
       Expr    : Node_Id;
+      pragma Warnings (Off, Expr);
       F1, F2  : Entity_Id;
       Func    : Entity_Id;
       Op_Name : Name_Id;
index 2b92afd8a770cf4bb678af27fe1bd7707b92da67..e78894c867d0c4a2d07019b375f93b892e2d164d 100644 (file)
@@ -13334,10 +13334,10 @@ package body Sem_Ch13 is
             Expr : Node_Id;
 
             X_Alignment : Uint;
-            Y_Alignment : Uint;
+            Y_Alignment : Uint := Uint_0;
 
             X_Size : Uint;
-            Y_Size : Uint;
+            Y_Size : Uint := Uint_0;
 
             X_Offs : Uint;
 
index 41941ba50b04214053d23703941dd7329f179365..c9f296a9eb7d86f99e92502ebdba62b795ea79fe 100644 (file)
@@ -6457,8 +6457,8 @@ package body Sem_Eval is
    --------------------
 
    procedure Why_Not_Static (Expr : Node_Id) is
-      N   : constant Node_Id   := Original_Node (Expr);
-      Typ : Entity_Id;
+      N   : constant Node_Id := Original_Node (Expr);
+      Typ : Entity_Id        := Empty;
       E   : Entity_Id;
       Alt : Node_Id;
       Exp : Node_Id;
index 6d0ecb67c7d6f84f5dbc1c429c274cb48a38c50e..1c3acec41039653c57fc86b47def4e1cf396d0f3 100644 (file)
@@ -12667,6 +12667,7 @@ package body Sem_Prag is
             Eloc  : Source_Ptr;
             Expr  : Node_Id;
             Str   : Node_Id;
+            pragma Warnings (Off, Str);
 
          begin
             --  Pragma Check is Ghost when it applies to a Ghost entity. Set