aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2026-05-12 15:52:51 +1000
committerStefano Brivio <sbrivio@redhat.com>2026-05-16 15:46:59 +0200
commitb356b62e04d4b5b862c5561229e00425f1ca3dd9 (patch)
tree06591a79c1da5075c1097bfa2457316bbe2b7cb0
parentfb9be080c8fc998ade0cb330781c4a49801339f6 (diff)
downloadpasst-b356b62e04d4b5b862c5561229e00425f1ca3dd9.tar
passt-b356b62e04d4b5b862c5561229e00425f1ca3dd9.tar.gz
passt-b356b62e04d4b5b862c5561229e00425f1ca3dd9.tar.bz2
passt-b356b62e04d4b5b862c5561229e00425f1ca3dd9.tar.lz
passt-b356b62e04d4b5b862c5561229e00425f1ca3dd9.tar.xz
passt-b356b62e04d4b5b862c5561229e00425f1ca3dd9.tar.zst
passt-b356b62e04d4b5b862c5561229e00425f1ca3dd9.zip
cppcheck, clang-tidy: Static checkers don't need non-preprocessor flags
Currently we pass all our compiler flags to clang-tidy, except -pie, which it won't accept. In fact in order to run the checker, we only need the preprocessor flags. Simplify the command line by passing only those. For cppcheck we already filter out just -D options from the compiler flags. Simplify this by only passing preprocessor flags, now that we've split those out into their own variables. Furthermore, one of cppcheck's features which we're currently not exploiting is to check multiple / all preprocessor option combinations in a single pass. Therefore, pass only $(BASE_CPPFLAGS), which contains the mandatory options with which we can't compile at all. While we're there remove a redundant $^ that slipped in at some point. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--Makefile8
1 files changed, 2 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 3bc5c35..2b5d49a 100644
--- a/Makefile
+++ b/Makefile
@@ -194,9 +194,7 @@ CLANG_TIDY = clang-tidy
CLANG_TIDY_FLAGS = -DCLANG_TIDY_58992
clang-tidy: $(PASST_SRCS)
- $(CLANG_TIDY) $^ -- \
- $(filter-out -pie,$(BASE_CPPFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(CFLAGS)) \
- $(CLANG_TIDY_FLAGS)
+ $(CLANG_TIDY) $^ -- $(BASE_CPPFLAGS) $(CPPFLAGS) $(CLANG_TIDY_FLAGS)
CPPCHECK = cppcheck
CPPCHECK_FLAGS = --std=c11 --error-exitcode=1 --enable=all --force \
@@ -212,6 +210,4 @@ CPPCHECK_FLAGS = --std=c11 --error-exitcode=1 --enable=all --force \
-D CPPCHECK_6936
cppcheck: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
- $(CPPCHECK) $(CPPCHECK_FLAGS) \
- $(filter -D%,$(BASE_CPPFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(CFLAGS)) $^ \
- $^
+ $(CPPCHECK) $(CPPCHECK_FLAGS) $(BASE_CPPFLAGS) $^