Commit 029b67ba by Yannick Moy Committed by Arnaud Charlet

usage.adb, [...]: Disable by default warnings on suspicious contracts, and…

usage.adb, [...]: Disable by default warnings on suspicious contracts, and enable them with -gnatwa.

2011-09-02  Yannick Moy  <moy@adacore.com>

	* usage.adb, warnsw.adb, sem_ch6.adb, opt.ads: Disable by default
	warnings on suspicious contracts, and enable them with -gnatwa.

From-SVN: r178452
parent dc36a7e3
2011-09-02 Yannick Moy <moy@adacore.com>
* usage.adb, warnsw.adb, sem_ch6.adb, opt.ads: Disable by default
warnings on suspicious contracts, and enable them with -gnatwa.
2011-09-02 Robert Dewar <dewar@adacore.com> 2011-09-02 Robert Dewar <dewar@adacore.com>
* exp_util.adb, exp_ch9.adb, sem_attr.adb, sem_ch6.adb: Minor * exp_util.adb, exp_ch9.adb, sem_attr.adb, sem_ch6.adb: Minor
......
...@@ -1550,11 +1550,11 @@ package Opt is ...@@ -1550,11 +1550,11 @@ package Opt is
-- clauses that are affected by non-standard bit-order. The default is -- clauses that are affected by non-standard bit-order. The default is
-- that this warning is enabled. -- that this warning is enabled.
Warn_On_Suspicious_Contract : Boolean := True; Warn_On_Suspicious_Contract : Boolean := False;
-- GNAT -- GNAT
-- Set to True to generate warnings for suspicious contracts expressed as -- Set to True to generate warnings for suspicious contracts expressed as
-- pragmas or aspects precondition and postcondition. The default is that -- pragmas or aspects precondition and postcondition. The default is that
-- this warning is enabled. -- this warning is disabled.
Warn_On_Suspicious_Modulus_Value : Boolean := True; Warn_On_Suspicious_Modulus_Value : Boolean := True;
-- GNAT -- GNAT
......
...@@ -5460,12 +5460,14 @@ package body Sem_Ch6 is ...@@ -5460,12 +5460,14 @@ package body Sem_Ch6 is
procedure Check_Subprogram_Contract (Spec_Id : Entity_Id) is procedure Check_Subprogram_Contract (Spec_Id : Entity_Id) is
-- Code is currently commented out as, in some cases, it causes crashes
-- because Direct_Primitive_Operations is not available for a private
-- type. This may cause more warnings to be issued than necessary. See
-- below for the intended use of this variable. ???
-- Inherited : constant Subprogram_List := -- Inherited : constant Subprogram_List :=
-- Inherited_Subprograms (Spec_Id); -- Inherited_Subprograms (Spec_Id);
-- -- List of subprograms inherited by this subprogram -- -- List of subprograms inherited by this subprogram
-- Code is currently commented out as, in some cases, it causes crashes
-- because Direct_Primitive_Operations is not available for a private
-- type???
Last_Postcondition : Node_Id := Empty; Last_Postcondition : Node_Id := Empty;
-- Last postcondition on the subprogram, or else Empty if either no -- Last postcondition on the subprogram, or else Empty if either no
......
...@@ -484,8 +484,8 @@ begin ...@@ -484,8 +484,8 @@ begin
Write_Line (" .S* turn off warnings for overridden size clause"); Write_Line (" .S* turn off warnings for overridden size clause");
Write_Line (" t turn on warnings for tracking deleted code"); Write_Line (" t turn on warnings for tracking deleted code");
Write_Line (" T* turn off warnings for tracking deleted code"); Write_Line (" T* turn off warnings for tracking deleted code");
Write_Line (" .t* turn on warnings for suspicious contract"); Write_Line (" .t+ turn on warnings for suspicious contract");
Write_Line (" .T turn off warnings for suspicious contract"); Write_Line (" .T* turn off warnings for suspicious contract");
Write_Line (" u+ turn on warnings for unused entity"); Write_Line (" u+ turn on warnings for unused entity");
Write_Line (" U* turn off warnings for unused entity"); Write_Line (" U* turn off warnings for unused entity");
Write_Line (" .u turn on warnings for unordered enumeration"); Write_Line (" .u turn on warnings for unordered enumeration");
......
...@@ -86,6 +86,7 @@ package body Warnsw is ...@@ -86,6 +86,7 @@ package body Warnsw is
Warn_On_Record_Holes := True; Warn_On_Record_Holes := True;
Warn_On_Redundant_Constructs := True; Warn_On_Redundant_Constructs := True;
Warn_On_Reverse_Bit_Order := True; Warn_On_Reverse_Bit_Order := True;
Warn_On_Suspicious_Contract := True;
Warn_On_Unchecked_Conversion := True; Warn_On_Unchecked_Conversion := True;
Warn_On_Unordered_Enumeration_Type := True; Warn_On_Unordered_Enumeration_Type := True;
Warn_On_Unrecognized_Pragma := True; Warn_On_Unrecognized_Pragma := True;
...@@ -256,6 +257,7 @@ package body Warnsw is ...@@ -256,6 +257,7 @@ package body Warnsw is
Warn_On_Questionable_Missing_Parens := True; Warn_On_Questionable_Missing_Parens := True;
Warn_On_Redundant_Constructs := True; Warn_On_Redundant_Constructs := True;
Warn_On_Reverse_Bit_Order := True; Warn_On_Reverse_Bit_Order := True;
Warn_On_Suspicious_Contract := True;
Warn_On_Unchecked_Conversion := True; Warn_On_Unchecked_Conversion := True;
Warn_On_Unrecognized_Pragma := True; Warn_On_Unrecognized_Pragma := True;
Warn_On_Unrepped_Components := True; Warn_On_Unrepped_Components := True;
...@@ -294,6 +296,7 @@ package body Warnsw is ...@@ -294,6 +296,7 @@ package body Warnsw is
Warn_On_Questionable_Missing_Parens := False; Warn_On_Questionable_Missing_Parens := False;
Warn_On_Redundant_Constructs := False; Warn_On_Redundant_Constructs := False;
Warn_On_Reverse_Bit_Order := False; Warn_On_Reverse_Bit_Order := False;
Warn_On_Suspicious_Contract := False;
Warn_On_Unchecked_Conversion := False; Warn_On_Unchecked_Conversion := False;
Warn_On_Unordered_Enumeration_Type := False; Warn_On_Unordered_Enumeration_Type := False;
Warn_On_Unrecognized_Pragma := False; Warn_On_Unrecognized_Pragma := False;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment