mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
warnings: be ready to print warnings categories
A function to print warnings categories, like -Wyacc, -Wother, etc. * src/complain.h, src/complain.c (print_warning_categories): New function. * src/output.c (ARRAY_CARDINALITY): Move it to file 'src/system.h'. * src/complain.h (enum warnings): New value, 'silent', "complain" must not display the warning type.
This commit is contained in:
committed by
Akim Demaille
parent
3e153163c7
commit
b640317060
@@ -34,7 +34,32 @@ warnings warnings_flag = Wconflicts_sr | Wconflicts_rr | Wother;
|
||||
bool complaint_issued;
|
||||
static unsigned *indent_ptr = 0;
|
||||
|
||||
|
||||
void
|
||||
warnings_print_categories (warnings warn_flags)
|
||||
{
|
||||
if (! (warn_flags & silent))
|
||||
{
|
||||
char const *warn_names[] =
|
||||
{
|
||||
"midrule-values",
|
||||
"yacc",
|
||||
"conflicts-sr",
|
||||
"conflicts-rr",
|
||||
"other"
|
||||
};
|
||||
|
||||
bool any = false;
|
||||
int i;
|
||||
for (i = 0; i < ARRAY_CARDINALITY (warn_names); ++i)
|
||||
if (warn_flags & 1 << i)
|
||||
{
|
||||
fprintf (stderr, "%s-W%s", any ? ", " : " [", warn_names[i]);
|
||||
any = true;
|
||||
}
|
||||
if (any)
|
||||
fprintf (stderr, "]");
|
||||
}
|
||||
}
|
||||
|
||||
/** Report an error message.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user