From 8c214280d37bdad036da7e9166925376500821a5 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 9 Sep 2023 19:50:16 +0200 Subject: [PATCH] bumped Cppcheck to 2.12.1 - build Cppcheck with matchcompiler for improved performance - build Cppcheck with Boost for improved ValueFlow performance --- .github/workflows/build.yml | 2 +- scripts/install_cppcheck.sh | 9 ++++++--- scripts/install_cppcheck_dependencies_with_apt.sh | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dd09ba7..cd40f92f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,7 @@ jobs: CC: gcc # This is required to use a version of cppcheck other than that # supplied with the operating system - CPPCHECK_VER: "2.11" + CPPCHECK_VER: "2.12.1" CPPCHECK_REPO: https://github.com/danmar/cppcheck.git steps: # Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20') diff --git a/scripts/install_cppcheck.sh b/scripts/install_cppcheck.sh index 94600b23..2fa0a37a 100755 --- a/scripts/install_cppcheck.sh +++ b/scripts/install_cppcheck.sh @@ -123,17 +123,20 @@ fi cd "$workdir" + make_args="MATCHCOMPILER=yes FILESDIR=$FILESDIR PREFIX=$FILESDIR" + case "$CPPCHECK_VER" in 1.*) # CFGDIR is needed for cppcheck before 1.86 - make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR CFGDIR=$FILESDIR" + make_args="$make_args CFGDIR=$FILESDIR" ;; 2.8 | 2.9 | 2.1*) # Cppcheck 2.8 removed the dependency on z3 - make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR" + # Cppcheck 2.8 added optional support for utilizing Boost + make_args="$make_args CPPFLAGS=-DHAVE_BOOST" ;; 2.*) - make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR USE_Z3=yes" + make_args="$make_args USE_Z3=yes" # Check that the Z3 development files appear to be installed # before trying to create z3_version.h. Otherwise we may # mislead the user as to what needs to be done. diff --git a/scripts/install_cppcheck_dependencies_with_apt.sh b/scripts/install_cppcheck_dependencies_with_apt.sh index c5a055dd..0c2f308d 100755 --- a/scripts/install_cppcheck_dependencies_with_apt.sh +++ b/scripts/install_cppcheck_dependencies_with_apt.sh @@ -24,6 +24,8 @@ case "$CPPCHECK_VER" in ;; 2.8 | 2.9 | 2.1*) # Cppcheck 2.8 removed the dependency on z3 + # Cppcheck 2.8 added optional support for utilizing Boost + PACKAGES="$PACKAGES libboost-container-dev" ;; 2.*) PACKAGES="$PACKAGES libz3-dev z3"