mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
diagnostics: %empty enables -Wempty-rule
* src/complain.h, src/complain.c (warning_is_unset): New. * src/reader.c (grammar_current_rule_empty_set): If enabled -Wempty-rule, if not disabled. * tests/actions.at (Implicitly empty rule): Check this feature. Also check that -Wno-empty-rule does disable this warning.
This commit is contained in:
@@ -196,6 +196,15 @@ warning_severity (warnings flags)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
warning_is_unset (warnings flags)
|
||||
{
|
||||
size_t b;
|
||||
for (b = 0; b < warnings_size; ++b)
|
||||
if (flags & 1 << b && warnings_flag[b] != severity_unset)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Display a "[-Wyacc]" like message on \a f. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user