aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-10-28 10:41:39 +0100
committerGitHub <noreply@github.com>2019-10-28 10:41:39 +0100
commitd9b9afe2b9921b0b3624095b60cca7d630cae67a (patch)
tree7865bf5e9b3d7b293f207c10a24fe965a114cfce /scripts
parente2d5b13f3442a8e88093a9d68e1be550194a4d77 (diff)
parent7026fa2241d4e42ac35688487b7c7dd4d7f8bad1 (diff)
downloadPROJ-d9b9afe2b9921b0b3624095b60cca7d630cae67a.tar.gz
PROJ-d9b9afe2b9921b0b3624095b60cca7d630cae67a.zip
Merge pull request #1697 from rouault/cppcheck_fixes
Fixes/workaround to be able to use cppcheck from Ubuntu 16.04 (fixes #1648)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cppcheck.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/cppcheck.sh b/scripts/cppcheck.sh
index 19620207..f42d5f6d 100755
--- a/scripts/cppcheck.sh
+++ b/scripts/cppcheck.sh
@@ -1,5 +1,4 @@
#!/bin/bash
-# Note: tested with cppcheck 1.61 as shipped with Ubuntu 14.04
echo `cppcheck --version`
LOG_FILE=/tmp/cppcheck_proj.txt
@@ -23,7 +22,7 @@ for dirname in ${TOPDIR}/src; do
echo "Running cppcheck on $dirname... (can be long)"
if ! cppcheck --inline-suppr --template='{file}:{line},{severity},{id},{message}' \
--enable=all --inconclusive --std=posix \
- -DCPPCHECK -D__cplusplus=201103L -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H \
+ -DCPPCHECK -D__cplusplus=201103L -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -DNAN \
-I${TOPDIR}/src -I${TOPDIR}/include \
"$dirname" \
-j 8 >>${LOG_FILE} 2>&1 ; then
@@ -34,7 +33,17 @@ done
ret_code=0
-grep -v "unmatchedSuppression" ${LOG_FILE} | grep -v "nn.hpp" | grep -v "nlohmann/json.hpp" | grep -v "wkt1_generated_parser" | grep -v "wkt2_generated_parser" > ${LOG_FILE}.tmp
+grep -v "unmatchedSuppression" ${LOG_FILE} \
+ | grep -v "nn.hpp" \
+ | grep -v "nlohmann/json.hpp" \
+ | grep -v "wkt1_generated_parser" \
+ | grep -v "wkt2_generated_parser" \
+ | grep -v "passedByValue,Function parameter 'coo' should be passed by const reference" \
+ | grep -v "passedByValue,Function parameter 'lpz' should be passed by const reference" \
+ | grep -v "passedByValue,Function parameter 'xyz' should be passed by const reference" \
+ | grep -v "passedByValue,Function parameter 'in' should be passed by const reference" \
+ | grep -v "knownConditionTrueFalse,Condition '!allowEmptyIntersection' is always false" \
+ > ${LOG_FILE}.tmp
mv ${LOG_FILE}.tmp ${LOG_FILE}
if grep "null pointer" ${LOG_FILE} ; then