From 21d16428760469717fd25ebf9d03c286db935c66 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 28 Feb 2017 01:02:25 +0100 Subject: Enable cppcheck and fix related mostly false-positive warnings --- travis/linux_gcc/before_install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'travis') 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 -- cgit v1.2.3