aboutgitcodebugslistschat
path: root/Makefile
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-21 12:06:58 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-21 12:16:16 +0200
commit685b50c3ce33ccf8441b3ac6f5152389bd772b35 (patch)
tree1bbcb2443b5d36a5e64dc08a806f42b331c604a4 /Makefile
parent627e18fa8ad000ed92405cff3a88c36fd5f3027e (diff)
downloadpasst-685b50c3ce33ccf8441b3ac6f5152389bd772b35.tar
passt-685b50c3ce33ccf8441b3ac6f5152389bd772b35.tar.gz
passt-685b50c3ce33ccf8441b3ac6f5152389bd772b35.tar.bz2
passt-685b50c3ce33ccf8441b3ac6f5152389bd772b35.tar.lz
passt-685b50c3ce33ccf8441b3ac6f5152389bd772b35.tar.xz
passt-685b50c3ce33ccf8441b3ac6f5152389bd772b35.tar.zst
passt-685b50c3ce33ccf8441b3ac6f5152389bd772b35.zip
Makefile: cppcheck target: Suppress unmatchedSuppression, pass CFLAGS
Some of those warnings don't trigger even on systems with very similar toolchains, suppress unmatchedSuppression warnings, they're basically useless. While at it, pass CFLAGS to cppcheck. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 16 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 32cc1d5..c73a786 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ CFLAGS += -DRLIMIT_STACK_VAL=$(shell ulimit -s)
CFLAGS += -DPAGE_SIZE=$(shell getconf PAGE_SIZE)
CFLAGS += -DNETNS_RUN_DIR=\"/run/netns\"
CFLAGS += -DPASST_AUDIT_ARCH=AUDIT_ARCH_$(shell uname -m | tr [a-z] [A-Z])
+CFLAGS += -DARCH=\"$(shell uname -m)\"
# On gcc 11.2, with -O2 and -flto, tcp_hash() and siphash_20b(), if inlined,
# seem to be hitting something similar to:
@@ -59,7 +60,7 @@ passt4netns: passt
ln -s passt passt4netns
qrap: qrap.c passt.h
- $(CC) $(CFLAGS) -DARCH=\"$(shell uname -m)\" \
+ $(CC) $(CFLAGS) \
qrap.c -o qrap
.PHONY: clean
@@ -176,20 +177,32 @@ cppcheck: $(wildcard *.c) $(wildcard *.h)
cppcheck --std=c99 --error-exitcode=1 --enable=all --force \
--inconclusive --library=posix \
-I/usr/include $(EXTRA_INCLUDES_OPT) \
+ \
+ --suppress=syntaxError:/usr/include/stdlib.h \
--suppress=missingIncludeSystem \
--suppress="*:$(EXTRA_INCLUDES)/avx512fintrin.h" \
--suppress="*:$(EXTRA_INCLUDES)/xmmintrin.h" \
--suppress="*:$(EXTRA_INCLUDES)/emmintrin.h" \
--suppress="*:$(EXTRA_INCLUDES)/avxintrin.h" \
--suppress="*:$(EXTRA_INCLUDES)/bmiintrin.h" \
+ \
--suppress=objectIndex:tcp.c --suppress=objectIndex:udp.c \
--suppress=va_list_usedBeforeStarted:util.c \
- --suppress=unusedFunction:igmp.c \
- --suppress=unusedFunction:siphash.c \
+ --suppress=unusedFunction \
--suppress=knownConditionTrueFalse:conf.c \
--suppress=strtokCalled:conf.c --suppress=strtokCalled:qrap.c \
--suppress=getpwnamCalled:passt.c \
--suppress=localtimeCalled:pcap.c \
--suppress=unusedStructMember:pcap.c \
--suppress=funcArgNamesDifferent:util.h \
+ \
+ --suppress=unmatchedSuppression:conf.c \
+ --suppress=unmatchedSuppression:passt.c \
+ --suppress=unmatchedSuppression:pcap.c \
+ --suppress=unmatchedSuppression:qrap.c \
+ --suppress=unmatchedSuppression:tcp.c \
+ --suppress=unmatchedSuppression:udp.c \
+ --suppress=unmatchedSuppression:util.c \
+ --suppress=unmatchedSuppression:util.h \
+ $(filter -D%,$(CFLAGS)) \
.