]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
contrib: simplify filter-clang-warnings.py
authorMartin Liska <mliska@suse.cz>
Wed, 21 Dec 2022 08:10:07 +0000 (09:10 +0100)
committerMartin Liska <mliska@suse.cz>
Wed, 21 Dec 2022 08:10:34 +0000 (09:10 +0100)
contrib/ChangeLog:

* filter-clang-warnings.py: Simplify.

contrib/filter-clang-warnings.py

index 56dce5af36804446d33dadf6293281436ccde0e3..06410cf244459a96acd1352d6fd68fe892342e27 100755 (executable)
@@ -71,7 +71,6 @@ parser.add_argument('log', help='Log file with clang warnings')
 args = parser.parse_args()
 
 lines = [line.strip() for line in open(args.log)]
-total = 0
 messages = set()
 for line in lines:
     token = ': warning: '
@@ -82,9 +81,9 @@ for line in lines:
         if '/libffi/' in location or location.startswith('Makefile'):
             continue
         if not skip_warning(location, message):
-            total += 1
             messages.add(line)
 
 for line in sorted(messages):
     print(line)
-print('\nTotal warnings: %d' % total)
+
+print('\nTotal warnings: %d' % len(messages))