]> git.saurik.com Git - bison.git/commitdiff
introduce -Wdeprecated
authorAkim Demaille <akim@lrde.epita.fr>
Mon, 20 Aug 2012 07:29:05 +0000 (09:29 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Mon, 3 Sep 2012 14:23:15 +0000 (16:23 +0200)
GCC seems to be using "deprecated" consistently over "obsoleted", so
use -Wdeprecated rather than -Wobsolete.

* src/complain.h (warnings): Add Wdeprecated.
* src/complain.c (warnings_print_categories): Adjust.
* src/getargs.c: Likewise.
* doc/bison.texi: Document it.

* src/scan-code.l: Use this category for the trailing ';' support.
* tests/actions.at: Adjust expected output.

NEWS
doc/bison.texi
src/complain.c
src/complain.h
src/getargs.c
src/scan-code.l
tests/actions.at

diff --git a/NEWS b/NEWS
index 0368c0e1930410580a2385dab89594a46fbec2ee..74afbfacab1c1ceabea40264a079fda97fe9aa54 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,12 @@ GNU Bison NEWS
 
 ** Warnings
 
+*** Deprecated constructs
+
+  A new warning category, 'deprecated', is used to flag obsolete constructs
+  whose support will be discontinued.  It is enabled by default.  These
+  warnings used to be reported as 'other' warnings.
+
 *** Warning categories are now displayed
 
   For instance:
index 0a0ae01ccdc57114ae14d6720b5f153ffa7b85ed..1297a361324e40baea26f8d5dd297488a6b0ab10 100644 (file)
@@ -9247,6 +9247,10 @@ unexpected number of conflicts is an error, and an expected number of
 conflicts is not reported, so @option{-W} and @option{--warning} then have
 no effect on the conflict report.
 
+@item deprecated
+Deprecated constructs whose support will be removed in future versions of
+Bison.
+
 @item other
 All warnings not categorized above.  These warnings are enabled by default.
 
index 7d905de5055aaa94debb5f998efdef1e7d258221..d79a250250d6c41f5932e4a64c70fa4368a20412 100644 (file)
@@ -29,7 +29,8 @@
 #include "files.h"
 #include "getargs.h"
 
-warnings warnings_flag = Wconflicts_sr | Wconflicts_rr | Wother;
+warnings warnings_flag =
+  Wconflicts_sr | Wconflicts_rr | Wdeprecated  | Wother;
 
 bool complaint_issued;
 static unsigned *indent_ptr = 0;
@@ -45,6 +46,7 @@ warnings_print_categories (warnings warn_flags)
           "yacc",
           "conflicts-sr",
           "conflicts-rr",
+          "deprecated",
           "other"
         };
 
index 276164cf912f43e4fc89389168d2cab1484c7e5e..44be293d585d53154cd12b9f4e3ae23509e00e1e 100644 (file)
@@ -32,7 +32,8 @@ typedef enum
     Wyacc             = 1 << 1,  /**< POSIXME.  */
     Wconflicts_sr     = 1 << 2,  /**< S/R conflicts.  */
     Wconflicts_rr     = 1 << 3,  /**< R/R conflicts.  */
-    Wother            = 1 << 4,  /**< All other warnings.  */
+    Wdeprecated       = 1 << 4,  /**< Obsolete constructs.  */
+    Wother            = 1 << 5,  /**< All other warnings.  */
 
     Werror            = 1 << 10, /**< Warnings are treated as errors.  */
     complaint         = 1 << 11, /**< All complaints.  */
index 5a74f4b801e1195802eb5a154e5194a5482f3659..d8a527d6103c341859d415a81b221f66d14dfc46 100644 (file)
@@ -218,6 +218,7 @@ static const char * const warnings_args[] =
   "yacc            - incompatibilities with POSIX Yacc",
   "conflicts-sr    - S/R conflicts",
   "conflicts-rr    - R/R conflicts",
+  "deprecated      - obsolete constructs",
   "other           - all other warnings",
   "all             - all of the above",
   "error           - warnings are errors",
@@ -231,6 +232,7 @@ static const int warnings_types[] =
   Wyacc,
   Wconflicts_sr,
   Wconflicts_rr,
+  Wdeprecated,
   Wother,
   Wall,
   Werror
index 96cab6d150a002df9e3f2c3fc40713d74ebfd6a0..522c5b9ce3c758286268216f52274f541e79f05d 100644 (file)
@@ -225,9 +225,9 @@ ref      -?[0-9]+|{id}|"["{id}"]"|"$"
     if (outer_brace && !yacc_flag && language_prio == default_prio
         && skeleton_prio == default_prio && need_semicolon && ! in_cpp)
       {
-        complain_at (*loc, Wother,
+        complain_at (*loc, Wdeprecated,
                      _("a ';' might be needed at the end of action code"));
-        complain_at (*loc, Wother,
+        complain_at (*loc, Wdeprecated,
                      _("future versions of Bison will not add the ';'"));
         obstack_1grow (&obstack_for_string, ';');
       }
index c1af5eaa2ab47b33095720f1b8cd8ac23e36cf4e..4b0019b84f112ad4ea4b763df29bf429d973cc41 100644 (file)
@@ -1438,42 +1438,42 @@ string;"}
 AT_BISON_OPTION_POPDEFS
 
 AT_BISON_CHECK([[-o input.c input.y]], [0], [],
-[[input.y:8.48: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:8.48: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:9.48: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:9.48: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:10.48: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:10.48: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:11.48: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:11.48: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:12.48: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:12.48: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:13.48: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:13.48: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:20.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:20.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:21.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:21.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:22.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:22.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:23.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:23.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:24.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:24.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:25.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:25.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:31.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:31.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:32.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:32.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:33.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:33.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:34.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:34.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:35.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:35.1: warning: future versions of Bison will not add the ';' [-Wother]
-input.y:36.1: warning: a ';' might be needed at the end of action code [-Wother]
-input.y:36.1: warning: future versions of Bison will not add the ';' [-Wother]
+[[input.y:8.48: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:8.48: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:9.48: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:9.48: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:10.48: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:10.48: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:11.48: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:11.48: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:12.48: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:12.48: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:13.48: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:13.48: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:20.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:20.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:21.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:21.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:22.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:22.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:23.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:23.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:24.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:24.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:25.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:25.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:31.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:31.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:32.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:32.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:33.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:33.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:34.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:34.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:35.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:35.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
+input.y:36.1: warning: a ';' might be needed at the end of action code [-Wdeprecated]
+input.y:36.1: warning: future versions of Bison will not add the ';' [-Wdeprecated]
 ]])
 
 AT_MATCHES_CHECK([input.c], [[/\* TEST:N:2 \*/ \}$]],       [[3]])