Skip to content

Commit 83f6777

Browse files
committed
fix cppcheck in Makefile
1 parent 09e035a commit 83f6777

3 files changed

Lines changed: 45 additions & 2 deletions

File tree

Makefile.am

100644100755
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,27 @@ test-regression-nginx:
4040

4141

4242
cppcheck:
43-
cppcheck . --enable=all --force 2>&1 | sed 's/^/warning: /g' 1>&2;
43+
@cppcheck \
44+
-j `getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu || echo 1` \
45+
--enable=all \
46+
--force \
47+
--verbose \
48+
--library=gnu \
49+
--library=posix \
50+
--std=c++17 \
51+
-I ./apache2 \
52+
-I /usr/include/libxml2 \
53+
-I @APXS_INCLUDEDIR@ \
54+
-I @APR_INCLUDEDIR@ \
55+
-I @APU_INCLUDEDIR@ \
56+
--suppressions-list=./tests/cppcheck_suppressions.txt \
57+
--inline-suppr \
58+
--inconclusive \
59+
--template="warning: {file},{line},{severity},{id},{message}" \
60+
--error-exitcode=1 \
61+
standalone/
62+
63+
check-static: cppcheck
4464

4565
check-coding-style:
4666
for i in `(find . -iname "*.c" ; find . -iname "*.h")`; \

autogen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ rm -rf autom4te.cache
99
rm -f aclocal.m4
1010
case `uname` in Darwin*) glibtoolize --force --copy ;;
1111
*) libtoolize --force --copy ;; esac
12-
autoreconf --install
12+
autoreconf --install --force
1313
autoheader
1414
automake --add-missing --foreign --copy --force-missing
1515
autoconf --force

tests/cppcheck_suppressions.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
normalCheckLevelMaxBranches
2+
checkersReport
3+
staticFunction
4+
5+
unusedFunction
6+
missingIncludeSystem
7+
useStlAlgorithm
8+
preprocessorErrorDirective
9+
funcArgNamesDifferent
10+
missingInclude
11+
12+
purgedConfiguration
13+
14+
nullPointerRedundantCheck
15+
knownConditionTrueFalse
16+
cstyleCast
17+
functionStatic
18+
shadowFunction
19+
20+
stlcstrConstructor
21+
stlcstrStream
22+
uselessCallsSubstr
23+
unmatchedSuppression

0 commit comments

Comments
 (0)