From: Mark Wielaard Date: Wed, 13 Apr 2011 11:44:38 +0000 (+0200) Subject: dwarflint: Add duplicate filtering also for C (non-stream based) wr_messages. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dcd9821c4aa4e44c8385d316929ff78f8c0c6af7;p=thirdparty%2Felfutils.git dwarflint: Add duplicate filtering also for C (non-stream based) wr_messages. wr_message () will ask for the id () filtering, so the "warning: " string is already printed, so remove the same string from wr_vwarning (). --- diff --git a/dwarflint/messages.cc b/dwarflint/messages.cc index 2c0810eeb..995220c3f 100644 --- a/dwarflint/messages.cc +++ b/dwarflint/messages.cc @@ -258,7 +258,7 @@ wr_verror (const struct where *wh, const char *format, va_list ap) static void wr_vwarning (const struct where *wh, const char *format, va_list ap) { - printf ("warning: %s", where_fmt (wh, NULL)); + printf ("%s", where_fmt (wh, NULL)); vprintf (format, ap); where_fmt_chain (wh, "warning"); ++error_count; @@ -279,7 +279,11 @@ wr_message (unsigned long category, const struct where *wh, { va_list ap; va_start (ap, format); - if (message_accept (&warning_criteria, category)) + // Clumsy duplicate filtering. Use format as key. + bool whether = false; + message_category cat = (message_category) category; + wr_message (cat).id (format, whether); + if (whether && message_accept (&warning_criteria, category)) { if (message_accept (&error_criteria, category)) wr_verror (wh, format, ap);