From 5c6745436fcaca6e92b1a36a4add5aa15d17e164 Mon Sep 17 00:00:00 2001 From: NRK Date: Sat, 13 May 2023 23:28:27 +0600 Subject: [ci]: silence false positive warning clang-tidy currently flags the following: util.c:57:8: error: 'ptr' may be set to null if 'realloc' fails, which may result in a leak of the original buffer [bugprone-suspicious-realloc-usage,-warnings-as-errors] ptr = realloc(ptr, size); the analysis here is correct, but if realloc fails, we simply exit so there's no real "leak". moreover this check is not very useful for nsxiv's codebase because we do not use naked realloc(), instead we use the erealloc wrapper that exits on failure. so just disable the warning entirely instead of changing the source code to silence the false positive. --- etc/woodpecker/clang-tidy-checks | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/woodpecker/clang-tidy-checks b/etc/woodpecker/clang-tidy-checks index 0cc2693..edf0ba6 100644 --- a/etc/woodpecker/clang-tidy-checks +++ b/etc/woodpecker/clang-tidy-checks @@ -9,6 +9,7 @@ misc-*,android-cloexec-*,llvm-include-order -bugprone-implicit-widening-of-multiplication-result,-bugprone-integer-division -android-cloexec-fopen,-android-cloexec-pipe,-cert-err33-c -bugprone-assignment-in-if-condition +-bugprone-suspicious-realloc-usage # false positive warnings -clang-analyzer-valist.Uninitialized -- cgit v1.2.3-54-g00ecf