aboutsummaryrefslogtreecommitdiff
path: root/travis/linux_gcc
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-02-28 01:02:25 +0100
committerEven Rouault <even.rouault@spatialys.com>2017-02-28 17:02:53 +0100
commit21d16428760469717fd25ebf9d03c286db935c66 (patch)
tree0747dd9d46c106e11a4e85d0caaacc002f2557e9 /travis/linux_gcc
parent8bf1acf2692e7628c2a7b41ad53d876f9b9b09e9 (diff)
downloadPROJ-21d16428760469717fd25ebf9d03c286db935c66.tar.gz
PROJ-21d16428760469717fd25ebf9d03c286db935c66.zip
Enable cppcheck and fix related mostly false-positive warnings
Diffstat (limited to 'travis/linux_gcc')
-rwxr-xr-xtravis/linux_gcc/before_install.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/travis/linux_gcc/before_install.sh b/travis/linux_gcc/before_install.sh
index d09c6ef1..31805e80 100755
--- a/travis/linux_gcc/before_install.sh
+++ b/travis/linux_gcc/before_install.sh
@@ -1,5 +1,15 @@
#!/bin/bash
+sudo apt-get install -y cppcheck
+
+cppcheck --inline-suppr --template='{file}:{line},{severity},{id},{message}' --enable=all --inconclusive --std=posix -DPJ_SELFTEST=1 src/*.c 2>/tmp/cppcheck.txt
+
+grep "error," /tmp/cppcheck.txt
+if [[ $? -eq 0 ]] ; then
+ echo "cppcheck failed"
+ exit 1
+fi
+
set -e
./travis/before_install.sh