From eff100e99cc0e14b9d99f1a31817f9a69071c1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 16 Jun 2026 13:45:48 +0200 Subject: [PATCH 01/13] Fix #14850 (Compilation fails on oraclelinux:8 (g++ 8.5.0 released in 2021)) --- .github/workflows/CI-unixish-docker.yml | 28 ++++++++++++++++++++++++- lib/settings.cpp | 4 ++-- lib/settings.h | 11 ++++++++-- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index 16c1615ed04..cb121d3c295 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -63,6 +63,12 @@ jobs: run: | apk add cmake make g++ pcre-dev + - name: Install missing software on Oracle Linux + if: contains(matrix.image, 'oraclelinux') + run: | + yum install -y git python3 which epel-release + yum install -y cmake3 gcc-c++ make pcre-devel + # needs to be called after the package installation since # - it doesn't call "apt-get update" - name: ccache @@ -87,7 +93,7 @@ jobs: strategy: matrix: - image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"] + image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8"] fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 @@ -111,6 +117,12 @@ jobs: run: | apk add make g++ pcre-dev bash python3 libxml2-utils + - name: Install missing software on Oracle Linux + if: contains(matrix.image, 'oraclelinux') + run: | + yum install -y git python3 which epel-release + yum install -y cmake3 gcc-c++ make pcre-devel + # needs to be called after the package installation since # - it doesn't call "apt-get update" - name: ccache @@ -121,15 +133,29 @@ jobs: # /usr/lib/ccache/bin - Alpine Linux - name: Build cppcheck + if: "!contains(matrix.image, 'oraclelinux')" run: | export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" + - name: Build cppcheck (Oracle Linux) + if: contains(matrix.image, 'oraclelinux') + run: | + export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" CPPFLAGS="-DGCC_BUG_HACK_NOEXCEPT" + - name: Build test + if: "!contains(matrix.image, 'oraclelinux')" run: | export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" testrunner + - name: Build test (Oracle Linux) + if: contains(matrix.image, 'oraclelinux') + run: | + export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" CPPFLAGS="-DGCC_BUG_HACK_NOEXCEPT" testrunner + - name: Run test run: | make -j$(nproc) HAVE_RULES=yes test diff --git a/lib/settings.cpp b/lib/settings.cpp index 95d4c4e953b..57c5def45a0 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -79,8 +79,8 @@ Settings::~Settings() = default; Settings::Settings(const Settings&) = default; Settings & Settings::operator=(const Settings &) = default; -Settings::Settings(Settings&&) noexcept = default; -Settings & Settings::operator=(Settings &&) noexcept = default; +Settings::Settings(Settings&&) NOEXCEPT = default; +Settings & Settings::operator=(Settings &&) NOEXCEPT = default; std::string Settings::loadCppcheckCfg(Settings& settings, Suppressions& suppressions, bool debug) { diff --git a/lib/settings.h b/lib/settings.h index 04ddb9adb9a..7f6e772a7c9 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -94,6 +94,13 @@ class SimpleEnableGroup { }; +#ifdef GCC_BUG_HACK_NOEXCEPT +#define NOEXCEPT +#else +#define NOEXCEPT noexcept +#endif + + /** * @brief This is just a container for general settings so that we don't need * to pass individual values to functions or constructors now or in the @@ -113,8 +120,8 @@ class CPPCHECKLIB WARN_UNUSED Settings { Settings(const Settings&); Settings& operator=(const Settings&); - Settings(Settings&&) noexcept; - Settings& operator=(Settings&&) noexcept; + Settings(Settings&&) NOEXCEPT; + Settings& operator=(Settings&&) NOEXCEPT; static std::string loadCppcheckCfg(Settings& settings, Suppressions& suppressions, bool debug = false); From b17eebcf055f7f945bb3436f6a05461e28fabab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 16 Jun 2026 15:10:00 +0200 Subject: [PATCH 02/13] format --- lib/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/settings.h b/lib/settings.h index 7f6e772a7c9..ae69aca4437 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -96,7 +96,7 @@ class SimpleEnableGroup { #ifdef GCC_BUG_HACK_NOEXCEPT #define NOEXCEPT -#else +#else #define NOEXCEPT noexcept #endif From 839a224625f5ddab7a3bf37c96a454c19c20c413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 16 Jun 2026 15:18:47 +0200 Subject: [PATCH 03/13] cleanup --- .github/workflows/CI-unixish-docker.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index cb121d3c295..51978735f41 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -63,12 +63,6 @@ jobs: run: | apk add cmake make g++ pcre-dev - - name: Install missing software on Oracle Linux - if: contains(matrix.image, 'oraclelinux') - run: | - yum install -y git python3 which epel-release - yum install -y cmake3 gcc-c++ make pcre-devel - # needs to be called after the package installation since # - it doesn't call "apt-get update" - name: ccache From e78bea0d96a5d99d9676974ef9dd761a451e158e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 16 Jun 2026 17:42:31 +0200 Subject: [PATCH 04/13] rely on gcc version --- lib/settings.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/settings.h b/lib/settings.h index ae69aca4437..3af7f08fb71 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -94,7 +94,12 @@ class SimpleEnableGroup { }; -#ifdef GCC_BUG_HACK_NOEXCEPT +#if defined(__GNUC__) && __GNUC__ <= 9 +// Hack to workaround GCC bug. +// Details: https://trac.cppcheck.net/ticket/14850 +// seen on: +// oraclelinux:8, g++-8.5 +// ubuntu:20.04, g++-9.4.0 #define NOEXCEPT #else #define NOEXCEPT noexcept From f7d148bfe57ba2a8492af233c849a1830bb755b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 16 Jun 2026 17:48:10 +0200 Subject: [PATCH 05/13] cleanup --- .github/workflows/CI-unixish-docker.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index 51978735f41..f0373880309 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -127,29 +127,15 @@ jobs: # /usr/lib/ccache/bin - Alpine Linux - name: Build cppcheck - if: "!contains(matrix.image, 'oraclelinux')" run: | export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" - - name: Build cppcheck (Oracle Linux) - if: contains(matrix.image, 'oraclelinux') - run: | - export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" CPPFLAGS="-DGCC_BUG_HACK_NOEXCEPT" - - name: Build test - if: "!contains(matrix.image, 'oraclelinux')" run: | export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" testrunner - - name: Build test (Oracle Linux) - if: contains(matrix.image, 'oraclelinux') - run: | - export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" CPPFLAGS="-DGCC_BUG_HACK_NOEXCEPT" testrunner - - name: Run test run: | make -j$(nproc) HAVE_RULES=yes test From c4de347f1899ddc1959b80b6c35158096b9937c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 16 Jun 2026 20:28:42 +0200 Subject: [PATCH 06/13] remove redundant semicolon --- lib/checks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checks.h b/lib/checks.h index ec4a78c2008..9c053b81405 100644 --- a/lib/checks.h +++ b/lib/checks.h @@ -29,6 +29,6 @@ namespace CheckInstances { /** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */ CPPCHECKLIB const std::list& get(); -}; +} #endif // checksH From 7916620f140bd5aafdc7f582e37bb27b57a51385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 16 Jun 2026 20:44:51 +0200 Subject: [PATCH 07/13] clang-tidy --- lib/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/settings.h b/lib/settings.h index 3af7f08fb71..14d07404ebf 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -94,7 +94,7 @@ class SimpleEnableGroup { }; -#if defined(__GNUC__) && __GNUC__ <= 9 +#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 9 // Hack to workaround GCC bug. // Details: https://trac.cppcheck.net/ticket/14850 // seen on: From 679ada0fe7c18e9da5c1b37250fad96eb418691c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 17 Jun 2026 10:41:21 +0200 Subject: [PATCH 08/13] rename --- lib/settings.cpp | 4 ++-- lib/settings.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/settings.cpp b/lib/settings.cpp index 57c5def45a0..c0539bbeaba 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -79,8 +79,8 @@ Settings::~Settings() = default; Settings::Settings(const Settings&) = default; Settings & Settings::operator=(const Settings &) = default; -Settings::Settings(Settings&&) NOEXCEPT = default; -Settings & Settings::operator=(Settings &&) NOEXCEPT = default; +Settings::Settings(Settings&&) CPPCHECK_NOEXCEPT = default; +Settings & Settings::operator=(Settings &&) CPPCHECK_NOEXCEPT = default; std::string Settings::loadCppcheckCfg(Settings& settings, Suppressions& suppressions, bool debug) { diff --git a/lib/settings.h b/lib/settings.h index 14d07404ebf..4ec8f794fa5 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -100,9 +100,9 @@ class SimpleEnableGroup { // seen on: // oraclelinux:8, g++-8.5 // ubuntu:20.04, g++-9.4.0 -#define NOEXCEPT +#define CPPCHECK_NOEXCEPT #else -#define NOEXCEPT noexcept +#define CPPCHECK_NOEXCEPT noexcept #endif @@ -125,8 +125,8 @@ class CPPCHECKLIB WARN_UNUSED Settings { Settings(const Settings&); Settings& operator=(const Settings&); - Settings(Settings&&) NOEXCEPT; - Settings& operator=(Settings&&) NOEXCEPT; + Settings(Settings&&) CPPCHECK_NOEXCEPT; + Settings& operator=(Settings&&) CPPCHECK_NOEXCEPT; static std::string loadCppcheckCfg(Settings& settings, Suppressions& suppressions, bool debug = false); From 98eff0419a540b364849b80e20f89f6a27314f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 17 Jun 2026 10:43:59 +0200 Subject: [PATCH 09/13] test --- .github/workflows/CI-unixish-docker.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index f0373880309..c9443481d10 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -30,6 +30,9 @@ jobs: - image: "alpine:3.23" with_gui: false # it appears FindQt6.cmake is not provided by any package full_build: false # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing + - image: "oraclelinux:8" + with_gui: false # no qt6 are installed + full_build: true # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 @@ -63,6 +66,12 @@ jobs: run: | apk add cmake make g++ pcre-dev + - name: Install missing software on Oracle Linux + if: contains(matrix.image, 'oraclelinux') + run: | + yum install -y git python3 which epel-release + yum install -y cmake3 gcc-c++ make pcre-devel + # needs to be called after the package installation since # - it doesn't call "apt-get update" - name: ccache From 8542efe7727311b2144dc01f999dbabd11bc424c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 17 Jun 2026 10:54:30 +0200 Subject: [PATCH 10/13] comment --- .github/workflows/CI-unixish-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index c9443481d10..c6d9c5098ef 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -31,8 +31,8 @@ jobs: with_gui: false # it appears FindQt6.cmake is not provided by any package full_build: false # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing - image: "oraclelinux:8" - with_gui: false # no qt6 are installed - full_build: true # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing + with_gui: false # no qt6 are installed, missing GUI in old distros is OK + full_build: true fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 From dff55ca55b1d5164b148c8fa6da5997677f42cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 19 Jun 2026 22:53:18 +0200 Subject: [PATCH 11/13] review --- .github/workflows/CI-unixish-docker.yml | 4 ++-- lib/settings.h | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index c6d9c5098ef..c87c7b96bc8 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -30,7 +30,7 @@ jobs: - image: "alpine:3.23" with_gui: false # it appears FindQt6.cmake is not provided by any package full_build: false # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing - - image: "oraclelinux:8" + - image: "oraclelinux:8-slim" with_gui: false # no qt6 are installed, missing GUI in old distros is OK full_build: true fail-fast: false # Prefer quick result @@ -96,7 +96,7 @@ jobs: strategy: matrix: - image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8"] + image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8-slim"] fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 diff --git a/lib/settings.h b/lib/settings.h index 4ec8f794fa5..4a73f35039b 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -97,9 +97,7 @@ class SimpleEnableGroup { #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 9 // Hack to workaround GCC bug. // Details: https://trac.cppcheck.net/ticket/14850 -// seen on: -// oraclelinux:8, g++-8.5 -// ubuntu:20.04, g++-9.4.0 +// seen on g++ before 10.x #define CPPCHECK_NOEXCEPT #else #define CPPCHECK_NOEXCEPT noexcept From 9216c9f7d725f59bab04da93f5f7e793b1c406a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 19 Jun 2026 23:18:52 +0200 Subject: [PATCH 12/13] 8 --- .github/workflows/CI-unixish-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index c87c7b96bc8..c6d9c5098ef 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -30,7 +30,7 @@ jobs: - image: "alpine:3.23" with_gui: false # it appears FindQt6.cmake is not provided by any package full_build: false # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing - - image: "oraclelinux:8-slim" + - image: "oraclelinux:8" with_gui: false # no qt6 are installed, missing GUI in old distros is OK full_build: true fail-fast: false # Prefer quick result @@ -96,7 +96,7 @@ jobs: strategy: matrix: - image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8-slim"] + image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8"] fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 From b23b81de1d388ea3bd018955f9cae17b85ae867f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 20 Jun 2026 15:57:33 +0200 Subject: [PATCH 13/13] skip test --- .github/workflows/CI-unixish-docker.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index c6d9c5098ef..16c1615ed04 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -30,9 +30,6 @@ jobs: - image: "alpine:3.23" with_gui: false # it appears FindQt6.cmake is not provided by any package full_build: false # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing - - image: "oraclelinux:8" - with_gui: false # no qt6 are installed, missing GUI in old distros is OK - full_build: true fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 @@ -66,12 +63,6 @@ jobs: run: | apk add cmake make g++ pcre-dev - - name: Install missing software on Oracle Linux - if: contains(matrix.image, 'oraclelinux') - run: | - yum install -y git python3 which epel-release - yum install -y cmake3 gcc-c++ make pcre-devel - # needs to be called after the package installation since # - it doesn't call "apt-get update" - name: ccache @@ -96,7 +87,7 @@ jobs: strategy: matrix: - image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8"] + image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"] fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 @@ -120,12 +111,6 @@ jobs: run: | apk add make g++ pcre-dev bash python3 libxml2-utils - - name: Install missing software on Oracle Linux - if: contains(matrix.image, 'oraclelinux') - run: | - yum install -y git python3 which epel-release - yum install -y cmake3 gcc-c++ make pcre-devel - # needs to be called after the package installation since # - it doesn't call "apt-get update" - name: ccache