diff options
author | Robert Dewar <dewar@adacore.com> | 2009-07-15 09:38:34 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@adacore.com> | 2009-07-15 09:38:34 +0000 |
commit | ffa9848076fdd5a32f020e797b00858018b6d54b (patch) | |
tree | 439c660991c7ccaba025ac153ec4d00b702988ff | |
parent | 7ba4bb31db30f0d30034ec543e5d578a1d76b3cc (diff) |
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
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@149666 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/lib-xref.adb | 5 | ||||
-rw-r--r-- | gcc/ada/sem_ch10.adb | 1 | ||||
-rw-r--r-- | gcc/ada/sem_warn.adb | 42 | ||||
-rw-r--r-- | gcc/ada/sem_warn.ads | 6 | ||||
-rw-r--r-- | gcc/ada/switch-c.adb | 23 |
6 files changed, 59 insertions, 26 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ddcd42c92ac..c50487b5377 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,13 @@ 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 Minor code reorganization diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index 0e45e2e2bf6..2f0c9ae44ee 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -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 diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 970d3679224..a21cd5be34f 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -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 := diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index e483d051504..610baee2990 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -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 -- ------------------------ diff --git a/gcc/ada/sem_warn.ads b/gcc/ada/sem_warn.ads index 3acb6873915..1e0f96814bd 100644 --- a/gcc/ada/sem_warn.ads +++ b/gcc/ada/sem_warn.ads @@ -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 -- ------------------------------------------ diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index f0acc45c766..b391ce3913f 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -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 |