]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Add duplicate filtering also for C (non-stream based) wr_messages.
authorMark Wielaard <mjw@redhat.com>
Wed, 13 Apr 2011 11:44:38 +0000 (13:44 +0200)
committerMark Wielaard <mjw@redhat.com>
Wed, 13 Apr 2011 11:46:38 +0000 (13:46 +0200)
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

index 2c0810eeb84726c43323b278a7815a6dfa33f44a..995220c3ff8c08bbe085df1db63dd45af7f8d64f 100644 (file)
@@ -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);