Skip to content

Commit 34bd599

Browse files
committed
Fix #14850 (Compilation fails on oraclelinux:8 (g++ 8.5.0 released in 2021))
1 parent a7faefc commit 34bd599

3 files changed

Lines changed: 38 additions & 5 deletions

File tree

.github/workflows/CI-unixish-docker.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ jobs:
6363
run: |
6464
apk add cmake make g++ pcre-dev
6565
66+
- name: Install missing software on Oracle Linux
67+
if: contains(matrix.image, 'oraclelinux')
68+
run: |
69+
yum install -y git python3 which epel-release
70+
yum install -y cmake3 gcc-c++ make pcre-devel
71+
6672
# needs to be called after the package installation since
6773
# - it doesn't call "apt-get update"
6874
- name: ccache
@@ -87,7 +93,7 @@ jobs:
8793

8894
strategy:
8995
matrix:
90-
image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"]
96+
image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8"]
9197
fail-fast: false # Prefer quick result
9298

9399
runs-on: ubuntu-22.04
@@ -111,6 +117,12 @@ jobs:
111117
run: |
112118
apk add make g++ pcre-dev bash python3 libxml2-utils
113119
120+
- name: Install missing software on Oracle Linux
121+
if: contains(matrix.image, 'oraclelinux')
122+
run: |
123+
yum install -y git python3 which epel-release
124+
yum install -y cmake3 gcc-c++ make pcre-devel
125+
114126
# needs to be called after the package installation since
115127
# - it doesn't call "apt-get update"
116128
- name: ccache
@@ -121,15 +133,29 @@ jobs:
121133
# /usr/lib/ccache/bin - Alpine Linux
122134

123135
- name: Build cppcheck
136+
if: "!contains(matrix.image, 'oraclelinux')"
124137
run: |
125138
export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
126139
make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror"
127140
141+
- name: Build cppcheck (Oracle Linux)
142+
if: contains(matrix.image, 'oraclelinux')
143+
run: |
144+
export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
145+
make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" CPPFLAGS="-DGCC_BUG_HACK_NOEXCEPT"
146+
128147
- name: Build test
148+
if: "!contains(matrix.image, 'oraclelinux')"
129149
run: |
130150
export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
131151
make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" testrunner
132152
153+
- name: Build test (Oracle Linux)
154+
if: contains(matrix.image, 'oraclelinux')
155+
run: |
156+
export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
157+
make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" CPPFLAGS="-DGCC_BUG_HACK_NOEXCEPT" testrunner
158+
133159
- name: Run test
134160
run: |
135161
make -j$(nproc) HAVE_RULES=yes test

lib/settings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ Settings::~Settings() = default;
7979
Settings::Settings(const Settings&) = default;
8080
Settings & Settings::operator=(const Settings &) = default;
8181

82-
Settings::Settings(Settings&&) noexcept = default;
83-
Settings & Settings::operator=(Settings &&) noexcept = default;
82+
Settings::Settings(Settings&&) NOEXCEPT = default;
83+
Settings & Settings::operator=(Settings &&) NOEXCEPT = default;
8484

8585
std::string Settings::loadCppcheckCfg(Settings& settings, Suppressions& suppressions, bool debug)
8686
{

lib/settings.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ class SimpleEnableGroup {
9494
};
9595

9696

97+
#ifdef GCC_BUG_HACK_NOEXCEPT
98+
#define NOEXCEPT
99+
#else
100+
#define NOEXCEPT noexcept
101+
#endif
102+
103+
97104
/**
98105
* @brief This is just a container for general settings so that we don't need
99106
* to pass individual values to functions or constructors now or in the
@@ -113,8 +120,8 @@ class CPPCHECKLIB WARN_UNUSED Settings {
113120
Settings(const Settings&);
114121
Settings& operator=(const Settings&);
115122

116-
Settings(Settings&&) noexcept;
117-
Settings& operator=(Settings&&) noexcept;
123+
Settings(Settings&&) NOEXCEPT;
124+
Settings& operator=(Settings&&) NOEXCEPT;
118125

119126
static std::string loadCppcheckCfg(Settings& settings, Suppressions& suppressions, bool debug = false);
120127

0 commit comments

Comments
 (0)