- fflush (stdout);
- fprintf (stderr, "%s: %s", infile ? infile : program_name, _("warning: "));
-
-#ifdef VA_START
- VA_START (args, message);
- vfprintf (stderr, message, args);
- va_end (args);
-#else
- fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif
-
- ++warn_message_count;
- putc ('\n', stderr);
- fflush (stderr);
+static inline void
+complains (const location *loc, warnings flags, const char *message,
+ va_list args)
+{
+ if (flags & complaint)
+ {
+ error_message (loc, complaint, NULL, message, args);
+ complaint_issued = true;
+ }
+ else if (flags & fatal)
+ {
+ error_message (loc, fatal, _("fatal error"), message, args);
+ exit (EXIT_FAILURE);
+ }
+ else if (flags & Wyacc)
+ {
+ if (yacc_flag)
+ {
+ error_message (loc, flags, NULL, message, args);
+ complaint_issued = true;
+ }
+ else if (warnings_flag & Wyacc)
+ {
+ set_warning_issued ();
+ error_message (loc, flags, _("warning"), message, args);
+ }
+ }
+ else if (warnings_flag & flags)
+ {
+ set_warning_issued ();
+ error_message (loc, flags, _("warning"), message, args);
+ }