aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/warnsw.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-09-10 17:30:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-09-10 17:30:44 +0200
commit14c34330495ec168199e0f9694cc39f74c3dbe56 (patch)
treec407e434e21d39e7056a3ea5562985aec95f5fde /gcc/ada/warnsw.adb
parentfb620b37dec4b0c1e9855a59a0c4dfa28fb58d01 (diff)
downloadgcc-14c34330495ec168199e0f9694cc39f74c3dbe56.zip
gcc-14c34330495ec168199e0f9694cc39f74c3dbe56.tar.gz
gcc-14c34330495ec168199e0f9694cc39f74c3dbe56.tar.bz2
[multiple changes]
2013-09-10 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb: sem_ch3.adb: (Replace_Anonymoous_Access_To_Protected_Subprogram): If the return type is itself an access to function, recurse to emit another anonymous type. gcc-interface/decl.c (gnat_to_gnu_entity): In ASIS mode (type_annotate_only) do not check whether access types have a set size. 2013-09-10 Robert Dewar <dewar@adacore.com> * err_vars.ads (Warning_Doc_Switch): Ignored in VMS mode. * errout.adb (Warning_Doc_Switch): Ignored in VMS mode. * errout.ads (Warning_Doc_Switch): Ignored in VMS mode. * inline.ads (Warnings): New component in Pending_Body_Info. * sem_ch12.adb (Pending_Body_Info): Save and restore warnings at instantiation point. * warnsw.adb (Save_Warnings): New function (Restore_Warnings): New procedure Remove special handling of Warning_Doc_Switch, cleaner to handle the VMS case in errout, than to introduce undocumented oddities here. * warnsw.ads (Warning_Record) : New type. (Save_Warnings): New function. (Restore_Warnings): New procedure. From-SVN: r202467
Diffstat (limited to 'gcc/ada/warnsw.adb')
-rw-r--r--gcc/ada/warnsw.adb204
1 files changed, 190 insertions, 14 deletions
diff --git a/gcc/ada/warnsw.adb b/gcc/ada/warnsw.adb
index c194b31..36360f9 100644
--- a/gcc/ada/warnsw.adb
+++ b/gcc/ada/warnsw.adb
@@ -25,9 +25,197 @@
with Err_Vars; use Err_Vars;
with Opt; use Opt;
-with Targparm; use Targparm;
+
package body Warnsw is
+ ----------------------
+ -- Restore_Warnings --
+ ----------------------
+
+ procedure Restore_Warnings (W : Warning_Record) is
+ begin
+ Address_Clause_Overlay_Warnings :=
+ W.Address_Clause_Overlay_Warnings;
+ Check_Unreferenced :=
+ W.Check_Unreferenced;
+ Check_Unreferenced_Formals :=
+ W.Check_Unreferenced_Formals;
+ Check_Withs :=
+ W.Check_Withs;
+ Constant_Condition_Warnings :=
+ W.Constant_Condition_Warnings;
+ Elab_Warnings :=
+ W.Elab_Warnings;
+ Implementation_Unit_Warnings :=
+ W.Implementation_Unit_Warnings;
+ Ineffective_Inline_Warnings :=
+ W.Ineffective_Inline_Warnings;
+ List_Inherited_Aspects :=
+ W.List_Inherited_Aspects;
+ Warning_Doc_Switch :=
+ W.Warning_Doc_Switch;
+ Warn_On_Ada_2005_Compatibility :=
+ W.Warn_On_Ada_2005_Compatibility;
+ Warn_On_Ada_2012_Compatibility :=
+ W.Warn_On_Ada_2012_Compatibility;
+ Warn_On_All_Unread_Out_Parameters :=
+ W.Warn_On_All_Unread_Out_Parameters;
+ Warn_On_Assertion_Failure :=
+ W.Warn_On_Assertion_Failure;
+ Warn_On_Assumed_Low_Bound :=
+ W.Warn_On_Assumed_Low_Bound;
+ Warn_On_Atomic_Synchronization :=
+ W.Warn_On_Atomic_Synchronization;
+ Warn_On_Bad_Fixed_Value :=
+ W.Warn_On_Bad_Fixed_Value;
+ Warn_On_Biased_Representation :=
+ W.Warn_On_Biased_Representation;
+ Warn_On_Constant :=
+ W.Warn_On_Constant;
+ Warn_On_Deleted_Code :=
+ W.Warn_On_Deleted_Code;
+ Warn_On_Dereference :=
+ W.Warn_On_Dereference;
+ Warn_On_Export_Import :=
+ W.Warn_On_Export_Import;
+ Warn_On_Hiding :=
+ W.Warn_On_Hiding;
+ Warn_On_Modified_Unread :=
+ W.Warn_On_Modified_Unread;
+ Warn_On_No_Value_Assigned :=
+ W.Warn_On_No_Value_Assigned;
+ Warn_On_Non_Local_Exception :=
+ W.Warn_On_Non_Local_Exception;
+ Warn_On_Object_Renames_Function :=
+ W.Warn_On_Object_Renames_Function;
+ Warn_On_Obsolescent_Feature :=
+ W.Warn_On_Obsolescent_Feature;
+ Warn_On_Overlap :=
+ W.Warn_On_Overlap;
+ Warn_On_Overridden_Size :=
+ W.Warn_On_Overridden_Size;
+ Warn_On_Parameter_Order :=
+ W.Warn_On_Parameter_Order;
+ Warn_On_Questionable_Missing_Parens :=
+ W.Warn_On_Questionable_Missing_Parens;
+ Warn_On_Record_Holes :=
+ W.Warn_On_Record_Holes;
+ Warn_On_Redundant_Constructs :=
+ W.Warn_On_Redundant_Constructs;
+ Warn_On_Reverse_Bit_Order :=
+ W.Warn_On_Reverse_Bit_Order;
+ Warn_On_Standard_Redefinition :=
+ W.Warn_On_Standard_Redefinition;
+ Warn_On_Suspicious_Contract :=
+ W.Warn_On_Suspicious_Contract;
+ Warn_On_Unchecked_Conversion :=
+ W.Warn_On_Unchecked_Conversion;
+ Warn_On_Unordered_Enumeration_Type :=
+ W.Warn_On_Unordered_Enumeration_Type;
+ Warn_On_Unrecognized_Pragma :=
+ W.Warn_On_Unrecognized_Pragma;
+ Warn_On_Unrepped_Components :=
+ W.Warn_On_Unrepped_Components;
+ Warn_On_Warnings_Off :=
+ W.Warn_On_Warnings_Off;
+ end Restore_Warnings;
+
+ -------------------
+ -- Save_Warnings --
+ -------------------
+
+ function Save_Warnings return Warning_Record is
+ W : Warning_Record;
+
+ begin
+ W.Address_Clause_Overlay_Warnings :=
+ Address_Clause_Overlay_Warnings;
+ W.Check_Unreferenced :=
+ Check_Unreferenced;
+ W.Check_Unreferenced_Formals :=
+ Check_Unreferenced_Formals;
+ W.Check_Withs :=
+ Check_Withs;
+ W.Constant_Condition_Warnings :=
+ Constant_Condition_Warnings;
+ W.Elab_Warnings :=
+ Elab_Warnings;
+ W.Implementation_Unit_Warnings :=
+ Implementation_Unit_Warnings;
+ W.Ineffective_Inline_Warnings :=
+ Ineffective_Inline_Warnings;
+ W.List_Inherited_Aspects :=
+ List_Inherited_Aspects;
+ W.Warning_Doc_Switch :=
+ Warning_Doc_Switch;
+ W.Warn_On_Ada_2005_Compatibility :=
+ Warn_On_Ada_2005_Compatibility;
+ W.Warn_On_Ada_2012_Compatibility :=
+ Warn_On_Ada_2012_Compatibility;
+ W.Warn_On_All_Unread_Out_Parameters :=
+ Warn_On_All_Unread_Out_Parameters;
+ W.Warn_On_Assertion_Failure :=
+ Warn_On_Assertion_Failure;
+ W.Warn_On_Assumed_Low_Bound :=
+ Warn_On_Assumed_Low_Bound;
+ W.Warn_On_Atomic_Synchronization :=
+ Warn_On_Atomic_Synchronization;
+ W.Warn_On_Bad_Fixed_Value :=
+ Warn_On_Bad_Fixed_Value;
+ W.Warn_On_Biased_Representation :=
+ Warn_On_Biased_Representation;
+ W.Warn_On_Constant :=
+ Warn_On_Constant;
+ W.Warn_On_Deleted_Code :=
+ Warn_On_Deleted_Code;
+ W.Warn_On_Dereference :=
+ Warn_On_Dereference;
+ W.Warn_On_Export_Import :=
+ Warn_On_Export_Import;
+ W.Warn_On_Hiding :=
+ Warn_On_Hiding;
+ W.Warn_On_Modified_Unread :=
+ Warn_On_Modified_Unread;
+ W.Warn_On_No_Value_Assigned :=
+ Warn_On_No_Value_Assigned;
+ W.Warn_On_Non_Local_Exception :=
+ Warn_On_Non_Local_Exception;
+ W.Warn_On_Object_Renames_Function :=
+ Warn_On_Object_Renames_Function;
+ W.Warn_On_Obsolescent_Feature :=
+ Warn_On_Obsolescent_Feature;
+ W.Warn_On_Overlap :=
+ Warn_On_Overlap;
+ W.Warn_On_Overridden_Size :=
+ Warn_On_Overridden_Size;
+ W.Warn_On_Parameter_Order :=
+ Warn_On_Parameter_Order;
+ W.Warn_On_Questionable_Missing_Parens :=
+ Warn_On_Questionable_Missing_Parens;
+ W.Warn_On_Record_Holes :=
+ Warn_On_Record_Holes;
+ W.Warn_On_Redundant_Constructs :=
+ Warn_On_Redundant_Constructs;
+ W.Warn_On_Reverse_Bit_Order :=
+ Warn_On_Reverse_Bit_Order;
+ W.Warn_On_Standard_Redefinition :=
+ Warn_On_Standard_Redefinition;
+ W.Warn_On_Suspicious_Contract :=
+ Warn_On_Suspicious_Contract;
+ W.Warn_On_Unchecked_Conversion :=
+ Warn_On_Unchecked_Conversion;
+ W.Warn_On_Unordered_Enumeration_Type :=
+ Warn_On_Unordered_Enumeration_Type;
+ W.Warn_On_Unrecognized_Pragma :=
+ Warn_On_Unrecognized_Pragma;
+ W.Warn_On_Unrepped_Components :=
+ Warn_On_Unrepped_Components;
+ W.Warn_On_Warnings_Off :=
+ Warn_On_Warnings_Off;
+
+ return W;
+ end Save_Warnings;
+
----------------------------
-- Set_Dot_Warning_Switch --
----------------------------
@@ -54,17 +242,9 @@ package body Warnsw is
Warn_On_Unrepped_Components := False;
when 'd' =>
- if OpenVMS_On_Target then
- return False;
- end if;
-
Warning_Doc_Switch := True;
when 'D' =>
- if OpenVMS_On_Target then
- return False;
- end if;
-
Warning_Doc_Switch := False;
when 'e' =>
@@ -77,11 +257,7 @@ package body Warnsw is
Implementation_Unit_Warnings := True;
Ineffective_Inline_Warnings := True;
List_Inherited_Aspects := True;
-
- if not OpenVMS_On_Target then
- Warning_Doc_Switch := True;
- end if;
-
+ Warning_Doc_Switch := True;
Warn_On_Ada_2005_Compatibility := True;
Warn_On_Ada_2012_Compatibility := True;
Warn_On_All_Unread_Out_Parameters := True;