public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-4744] contrib: make warnings unique in filter-clang-warnings.py
Date: Fri, 16 Dec 2022 12:07:59 +0000 (GMT)	[thread overview]
Message-ID: <20221216120759.C0A1E38537AF@sourceware.org> (raw)

https://gcc.gnu.org/g:d386d399205e68e02b357dfcd96b9a4b91e4f295

commit r13-4744-gd386d399205e68e02b357dfcd96b9a4b91e4f295
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Dec 16 13:07:27 2022 +0100

    contrib: make warnings unique in filter-clang-warnings.py
    
    contrib/ChangeLog:
    
            * filter-clang-warnings.py: Print each warning only one time.

Diff:
---
 contrib/filter-clang-warnings.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/filter-clang-warnings.py b/contrib/filter-clang-warnings.py
index c426bce5eb5..0973d74d8d9 100755
--- a/contrib/filter-clang-warnings.py
+++ b/contrib/filter-clang-warnings.py
@@ -72,7 +72,7 @@ args = parser.parse_args()
 
 lines = [line.strip() for line in open(args.log)]
 total = 0
-messages = []
+messages = set()
 for line in lines:
     token = ': warning: '
     i = line.find(token)
@@ -81,7 +81,7 @@ for line in lines:
         message = line[i + len(token):]
         if not skip_warning(location, message):
             total += 1
-            messages.append(line)
+            messages.add(line)
 
 for line in sorted(messages):
     print(line)

                 reply	other threads:[~2022-12-16 12:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221216120759.C0A1E38537AF@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).