From dcd9821c4aa4e44c8385d316929ff78f8c0c6af7 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 13 Apr 2011 13:44:38 +0200 Subject: [PATCH] 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 (). --- dwarflint/messages.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.47.2