+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>
* exp_util.adb, exp_ch9.adb, sem_attr.adb, sem_ch6.adb: Minor
-- clauses that are affected by non-standard bit-order. The default is
-- that this warning is enabled.
- Warn_On_Suspicious_Contract : Boolean := True;
+ Warn_On_Suspicious_Contract : Boolean := False;
-- GNAT
-- Set to True to generate warnings for suspicious contracts expressed as
-- 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;
-- GNAT
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_Subprograms (Spec_Id);
-- -- 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 on the subprogram, or else Empty if either no
Write_Line (" .S* turn off warnings for overridden size clause");
Write_Line (" t turn on 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 off warnings for suspicious contract");
+ Write_Line (" .t+ turn on 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 off warnings for unused entity");
Write_Line (" .u turn on warnings for unordered enumeration");
Warn_On_Record_Holes := True;
Warn_On_Redundant_Constructs := True;
Warn_On_Reverse_Bit_Order := True;
+ Warn_On_Suspicious_Contract := True;
Warn_On_Unchecked_Conversion := True;
Warn_On_Unordered_Enumeration_Type := True;
Warn_On_Unrecognized_Pragma := True;
Warn_On_Questionable_Missing_Parens := True;
Warn_On_Redundant_Constructs := True;
Warn_On_Reverse_Bit_Order := True;
+ Warn_On_Suspicious_Contract := True;
Warn_On_Unchecked_Conversion := True;
Warn_On_Unrecognized_Pragma := True;
Warn_On_Unrepped_Components := True;
Warn_On_Questionable_Missing_Parens := False;
Warn_On_Redundant_Constructs := False;
Warn_On_Reverse_Bit_Order := False;
+ Warn_On_Suspicious_Contract := False;
Warn_On_Unchecked_Conversion := False;
Warn_On_Unordered_Enumeration_Type := False;
Warn_On_Unrecognized_Pragma := False;