-Wempty-rule: diagnose empty rules without %empty

* src/complain.h, src/complain.c (warning_empty_rule, Wempty_rule):
New warning category.
(warnings_args, warnings_types): Adjust.
* src/reader.c (grammar_rule_check): Check the empty rules are
flagged by %empty.
* tests/actions.at (Implicitly empty rule): New.
* tests/existing.at: Add expected warnings.
This commit is contained in:
Akim Demaille
2013-02-09 18:26:38 +01:00
parent 684083f065
commit f68a49ed49
6 changed files with 107 additions and 5 deletions

View File

@@ -63,6 +63,7 @@ static const char * const warnings_args[] =
"conflicts-sr",
"conflicts-rr",
"deprecated",
"empty-rule",
"precedence",
"other",
"all",
@@ -78,6 +79,7 @@ static const int warnings_types[] =
Wconflicts_sr,
Wconflicts_rr,
Wdeprecated,
Wempty_rule,
Wprecedence,
Wother,
Wall,