mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 13:53:03 +00:00
introduce -Wdeprecated
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.
This commit is contained in:
@@ -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"
|
||||
};
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, ';');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user