usage.adb, [...]: Disable by default warnings on suspicious contracts, and enable...
authorYannick Moy <moy@adacore.com>
Fri, 2 Sep 2011 09:29:53 +0000 (09:29 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 2 Sep 2011 09:29:53 +0000 (11:29 +0200)
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

gcc/ada/ChangeLog
gcc/ada/opt.ads
gcc/ada/sem_ch6.adb
gcc/ada/usage.adb
gcc/ada/warnsw.adb

index e5539734efc8cb80300818f22e9d152d4c2c1a96..b2165b8b7422cb47d777a917276d41ad468dac12 100644 (file)
@@ -1,3 +1,8 @@
+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
index 9e4ee4a7f11d75fc8808685057f90816360570c6..b84e4ec1adb19df39c7d9e64a66e0eb7a90a6285 100644 (file)
@@ -1550,11 +1550,11 @@ package Opt is
    --  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
index 9133046523b0237e0fc1f0b24055e5cf7169bf9c..5919405060003326980f988621a24bf36fb11c79 100644 (file)
@@ -5460,12 +5460,14 @@ package body Sem_Ch6 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_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
index 1d79f66a0a7da44e27baeefa12024a3775eb9e07..146b0c043f3c348f7d8ca9ce36110e116774acc9 100644 (file)
@@ -484,8 +484,8 @@ begin
    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");
index 96a8e8f5df6fc4b1e4e81a661ed64ac62ab7c0ef..711b9438dbd6222a1b4cbfd94dbd864a13754f6f 100644 (file)
@@ -86,6 +86,7 @@ package body Warnsw is
             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;
@@ -256,6 +257,7 @@ package body Warnsw is
             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;
@@ -294,6 +296,7 @@ package body Warnsw is
             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;