Krolyxon
Commit 5c67454

Branches

Refs →

nsxiv5c67454

[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.
Author
NRK
Date
2023-05-13 23:28 +0600
Parent
d7e149d
Commit
5c6745436fcaca6e92b1a36a4add5aa15d17e164

+1 −0

1 file changed

  1. M etc/woodpecker/clang-tidy-checks +1 −0
M etc/woodpecker/clang-tidy-checks View
@@ -9,6 +9,7 @@ misc-*,android-cloexec-*,llvm-include-order
99 -bugprone-implicit-widening-of-multiplication-result,-bugprone-integer-division
1010 -android-cloexec-fopen,-android-cloexec-pipe,-cert-err33-c
1111 -bugprone-assignment-in-if-condition
12+-bugprone-suspicious-realloc-usage
1213
1314 # false positive warnings
1415 -clang-analyzer-valist.Uninitialized