bool complaint_issued;
static unsigned *indent_ptr = 0;
-\f
+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.
*
fprintf (stderr, "%s: ", prefix);
vfprintf (stderr, message, args);
+ warnings_print_categories (flags);
{
size_t l = strlen (message);
if (l < 2 || message[l-2] != ':' || message[l-1] != ' ')
error_message (loc, flags, _("warning"), message, args);
}
}
- else
+ else if (warnings_flag & flags)
{
- if (! (warnings_flag & flags))
- return;
set_warning_issued ();
error_message (loc, flags, _("warning"), message, args);
}