]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
switch-c.adb, [...]: Implement new switch -gnatw.g.
authorRobert Dewar <dewar@adacore.com>
Wed, 15 Jul 2009 09:38:34 +0000 (09:38 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 15 Jul 2009 09:38:34 +0000 (11:38 +0200)
2009-07-15  Robert Dewar  <dewar@adacore.com>

* switch-c.adb, sem_ch10.adb, sem_warn.adb, sem_warn.ads: Implement
new switch -gnatw.g.
(Set_GNAT_Mode_Warnings): New procedure.

* lib-xref.adb: Minor reformatting

From-SVN: r149666

gcc/ada/ChangeLog
gcc/ada/lib-xref.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_warn.adb
gcc/ada/sem_warn.ads
gcc/ada/switch-c.adb

index ddcd42c92ac15e6c5511c69cbc1e436fc199efe7..c50487b537751b6bee715275b9fc87304061ec8f 100644 (file)
@@ -1,3 +1,11 @@
+2009-07-15  Robert Dewar  <dewar@adacore.com>
+
+       * switch-c.adb, sem_ch10.adb, sem_warn.adb, sem_warn.ads: Implement
+       new switch -gnatw.g.
+       (Set_GNAT_Mode_Warnings): New procedure.
+
+       * lib-xref.adb: Minor reformatting
+
 2009-07-15  Robert Dewar  <dewar@adacore.com>
 
        * exp_aggr.adb, tbuild.ads, tbuild.adb: Minor reformatting
index 0e45e2e2bf60c61ecbc39ef4a6628f50334c3e3e..2f0c9ae44ee6fcdf78b060dc4bec1e1fcaa5ace8 100644 (file)
@@ -1464,7 +1464,6 @@ package body Lib.Xref is
 
             if Name_Len /= Curlen then
                return True;
-
             else
                return Name_Buffer (1 .. Curlen) /= Curnam (1 .. Curlen);
             end if;
@@ -1543,7 +1542,7 @@ package body Lib.Xref is
                --  Used for {} or <> or () for type reference
 
                procedure Check_Type_Reference
-                 (Ent : Entity_Id;
+                 (Ent            : Entity_Id;
                   List_Interface : Boolean);
                --  Find whether there is a meaningful type reference for
                --  Ent, and display it accordingly. If List_Interface is
@@ -1565,7 +1564,7 @@ package body Lib.Xref is
                --------------------------
 
                procedure Check_Type_Reference
-                 (Ent : Entity_Id;
+                 (Ent            : Entity_Id;
                   List_Interface : Boolean)
                is
                begin
index 970d3679224a48ce230593c5c59e471922127b0d..a21cd5be34f969d1cc004a857d6c6ca6164cd478 100644 (file)
@@ -2328,7 +2328,6 @@ package body Sem_Ch10 is
            and then Current_Sem_Unit = Main_Unit
            and then not Intunit
            and then not Implicit_With (N)
-           and then not GNAT_Mode
          then
             declare
                U_Kind : constant Kind_Of_Unit :=
index e483d051504408f268c7d14bc6d1168059eb0e0c..610baee29905a140339886a253b0c6b656c9492a 100644 (file)
@@ -2997,6 +2997,9 @@ package body Sem_Warn is
             Warn_On_Unrepped_Components         := True;
             Warn_On_Warnings_Off                := True;
 
+         when 'g' =>
+            Set_GNAT_Mode_Warnings;
+
          when 'm' =>
             Warn_On_Suspicious_Modulus_Value    := True;
 
@@ -3041,6 +3044,45 @@ package body Sem_Warn is
       return True;
    end Set_Dot_Warning_Switch;
 
+   ----------------------------
+   -- Set_GNAT_Mode_Warnings --
+   ----------------------------
+
+   procedure Set_GNAT_Mode_Warnings is
+   begin
+      Address_Clause_Overlay_Warnings     := True;
+      Check_Unreferenced                  := True;
+      Check_Unreferenced_Formals          := True;
+      Check_Withs                         := True;
+      Constant_Condition_Warnings         := True;
+      Elab_Warnings                       := False;
+      Implementation_Unit_Warnings        := False;
+      Ineffective_Inline_Warnings         := True;
+      Warn_On_Ada_2005_Compatibility      := True;
+      Warn_On_All_Unread_Out_Parameters   := False;
+      Warn_On_Assertion_Failure           := True;
+      Warn_On_Assumed_Low_Bound           := True;
+      Warn_On_Bad_Fixed_Value             := True;
+      Warn_On_Biased_Representation       := True;
+      Warn_On_Constant                    := True;
+      Warn_On_Deleted_Code                := False;
+      Warn_On_Dereference                 := False;
+      Warn_On_Export_Import               := True;
+      Warn_On_Hiding                      := False;
+      Warn_On_Modified_Unread             := True;
+      Warn_On_No_Value_Assigned           := True;
+      Warn_On_Non_Local_Exception         := False;
+      Warn_On_Object_Renames_Function     := False;
+      Warn_On_Obsolescent_Feature         := True;
+      Warn_On_Questionable_Missing_Parens := True;
+      Warn_On_Redundant_Constructs        := True;
+      Warn_On_Object_Renames_Function     := True;
+      Warn_On_Unchecked_Conversion        := True;
+      Warn_On_Unrecognized_Pragma         := True;
+      Warn_On_Unrepped_Components         := False;
+      Warn_On_Warnings_Off                := False;
+   end Set_GNAT_Mode_Warnings;
+
    ------------------------
    -- Set_Warning_Switch --
    ------------------------
index 3acb6873915f3ac0e31a01fb100509a5c3de8ccf..1e0f96814bdc8a5fa6dc6555e6139a770468c59f 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1999-2008, Free Software Foundation, Inc.         --
+--          Copyright (C) 1999-2009, 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- --
@@ -77,6 +77,10 @@ package Sem_Warn is
    --  the command line or .C in a string literal in pragma Warnings. Returns
    --  True for valid warning character C, False for invalid character.
 
+   procedure Set_GNAT_Mode_Warnings;
+   --  This is called in -gnatg mode to set the warnings for gnat mode. It is
+   --  also used to set the proper warning statuses for -gnatw.g.
+
    ------------------------------------------
    -- Routines to Handle Unused References --
    ------------------------------------------
index f0acc45c7669478daf22926a1f06cb98830fde4e..b391ce3913faf661b6a640f3ff85788df431b7b9 100644 (file)
@@ -508,28 +508,9 @@ package body Switch.C is
                Ada_Version := Ada_05;
                Ada_Version_Explicit := Ada_Version;
 
-               --  Set default warnings for -gnatg
-
-               Check_Unreferenced              := True;
-               Check_Unreferenced_Formals      := True;
-               Check_Withs                     := True;
-               Constant_Condition_Warnings     := True;
-               Implementation_Unit_Warnings    := True;
-               Ineffective_Inline_Warnings     := True;
-               Warn_On_Assertion_Failure       := True;
-               Warn_On_Assumed_Low_Bound       := True;
-               Warn_On_Bad_Fixed_Value         := True;
-               Warn_On_Constant                := True;
-               Warn_On_Export_Import           := True;
-               Warn_On_Modified_Unread         := True;
-               Warn_On_No_Value_Assigned       := True;
-               Warn_On_Non_Local_Exception     := False;
-               Warn_On_Obsolescent_Feature     := True;
-               Warn_On_Redundant_Constructs    := True;
-               Warn_On_Object_Renames_Function := True;
-               Warn_On_Unchecked_Conversion    := True;
-               Warn_On_Unrecognized_Pragma     := True;
+               --  Set default warnings and style checks for -gnatg
 
+               Set_GNAT_Mode_Warnings;
                Set_GNAT_Style_Check_Options;
 
             --  Processing for G switch