]> git.saurik.com Git - bison.git/blobdiff - src/reader.c
diagnostics: %empty enables -Wempty-rule
[bison.git] / src / reader.c
index 0422d2046ed4b33a486ed1f2f813c6e3d1bc5286..c83fc52afd6e0f3c51d03e10fe9df9c6132bddbe 100644 (file)
@@ -451,6 +451,10 @@ grammar_current_rule_prec_set (symbol *precsym, location loc)
 void
 grammar_current_rule_empty_set (location loc)
 {
+  /* If %empty is used and -Wno-empty-rule is not, then enable
+     -Wempty-rule.  */
+  if (warning_is_unset (Wempty_rule))
+    warning_argmatch ("empty-rule", 0, 0);
   if (current_rule->percent_empty_loc.start.file)
     complain (&loc, complaint, _("only one %s allowed per rule"), "%empty");
   else