Skip to content
Snippets Groups Projects
Commit 238c8b4e authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Updated cppcheck to version 1.84.

Notice newer cppcheck versions are slower. In order to make the check fit
on travis-ci I had to make a few extra changes:
- better optimization flags when building cppcheck
- force a number of ifdefs in the check

Now master takes approx 25 minutes, so we have room for adding new code.
parent 709f24a4
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ matrix: ...@@ -25,7 +25,7 @@ matrix:
- os: linux - os: linux
dist: trusty dist: trusty
sudo: required sudo: required
env: CPPCHECK=yes CPPCHECK_VERSION=1.81 env: CPPCHECK=yes CPPCHECK_VERSION=1.84
# then check with different optimization flags # then check with different optimization flags
- os: linux - os: linux
dist: trusty dist: trusty
......
...@@ -22,7 +22,7 @@ native="$($CC -march=native -Q --help=target | grep march= | awk '{print $2}')" ...@@ -22,7 +22,7 @@ native="$($CC -march=native -Q --help=target | grep march= | awk '{print $2}')"
# the object file should not be recycled # the object file should not be recycled
git checkout $version git checkout $version
make -j 4 install CFGDIR="$HOME/opt/share/cppcheck/" CXXFLAGS="-O2 -march="$native" -mtune="$native" -Wunreachable-code" PREFIX="$HOME/opt" make -j 4 install CFGDIR="$HOME/opt/share/cppcheck/" CXXFLAGS="-DNDEBUG -O2 -march="$native" -mtune="$native" -Wunreachable-code" PREFIX="$HOME/opt"
cd ../ cd ../
cppcheck --version cppcheck --version
......
...@@ -34,7 +34,9 @@ if [ $do_cppcheck == true ] ; then ...@@ -34,7 +34,9 @@ if [ $do_cppcheck == true ] ; then
else else
files="$(echo */*.{h,cpp})" files="$(echo */*.{h,cpp})"
fi fi
cppcheck --std=c++11 --std=posix 4 -j 4 --platform=unix64 --language=c++ -U__PRETTY_FUNCTION__ \ cppcheck --std=c++11 --std=posix -j 4 --platform=unix64 --language=c++ \
-U__PRETTY_FUNCTION__ -U__PLUMED_HAS_EXTERNAL_LAPACK -U__PLUMED_HAS_EXTERNAL_BLAS \
-UGMX_CYGWIN -UF77_NO_UNDERSCORE -U_GLIBCXX_DEBUG -DNDEBUG -U__PLUMED_PBC_WHILE \
--template='[{file}:{line}] ({severity}) :{id}: {message}' --enable=all --inline-suppr --force \ --template='[{file}:{line}] ({severity}) :{id}: {message}' --enable=all --inline-suppr --force \
$files $files
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment