aboutgitcodebugslistschat
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-09-21 14:49:39 +1000
committerStefano Brivio <sbrivio@redhat.com>2023-09-27 17:26:06 +0200
commitc1d2a070f282a95316e8f045e8959856518ab2f0 (patch)
tree2a1f68cfa6e58f304dd3bbbfbf2c94408a5d8c52 /Makefile
parent5b6c68c2e4995b94110b62e9e8346fb372451e31 (diff)
downloadpasst-c1d2a070f282a95316e8f045e8959856518ab2f0.tar
passt-c1d2a070f282a95316e8f045e8959856518ab2f0.tar.gz
passt-c1d2a070f282a95316e8f045e8959856518ab2f0.tar.bz2
passt-c1d2a070f282a95316e8f045e8959856518ab2f0.tar.lz
passt-c1d2a070f282a95316e8f045e8959856518ab2f0.tar.xz
passt-c1d2a070f282a95316e8f045e8959856518ab2f0.tar.zst
passt-c1d2a070f282a95316e8f045e8959856518ab2f0.zip
util: Consolidate and improve workarounds for clang-tidy issue 58992
We have several workarounds for a clang-tidy bug where the checker doesn't recognize that a number of system calls write to - and therefore initialise - a socket address. We can't neatly use a suppression, because the bogus warning shows up some time after the actual system call, when we access a field of the socket address which clang-tidy erroneously thinks is uninitialised. Consolidate these workarounds into one place by using macros to implement wrappers around affected system calls which add a memset() of the sockaddr to silence clang-tidy. This removes the need for the individual memset() workarounds at the callers - and the somewhat longwinded explanatory comments. We can then use a #define to not include the hack in "real" builds, but only consider it for clang-tidy. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4435bd6..c28556f 100644
--- a/Makefile
+++ b/Makefile
@@ -276,7 +276,7 @@ clang-tidy: $(SRCS) $(HEADERS)
-concurrency-mt-unsafe,\
-readability-identifier-length \
-config='{CheckOptions: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: "false"}]}' \
- --warnings-as-errors=* $(SRCS) -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS))
+ --warnings-as-errors=* $(SRCS) -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) -DCLANG_TIDY_58992
SYSTEM_INCLUDES := /usr/include $(wildcard /usr/include/$(TARGET))
ifeq ($(shell $(CC) -v 2>&1 | grep -c "gcc version"),1)