From a9148e9bae071dc1225188b224d3ed3d40aadf2a Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Thu, 19 Dec 2024 14:02:48 +0900 Subject: [PATCH] suppresses warnings that have already been emitted Warnings generated in headers can be seen thousands of times, particularly for function templates (but only one instance of the warning is actually helpful). This commit suppresses subsequent occurrences to keep the list of useful warnings readable. --- scripts/warnings-handling.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/warnings-handling.py b/scripts/warnings-handling.py index 32467ee3..836f9968 100644 --- a/scripts/warnings-handling.py +++ b/scripts/warnings-handling.py @@ -23,15 +23,17 @@ def warnings_count(filename, verbose): warnings = 0 suppressed = 0 total = 0 + seen_warnings = [] for line in open(filename): total += 1 match = rx.search(line) if match: if is_suppressed(line): suppressed += 1 - else: + elif line not in seen_warnings: print("***> {}".format(line.rstrip())) warnings += 1 + seen_warnings.append(line) continue if verbose: print(line.rstrip())