Skip to content

Commit 0409b5d

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

4 files changed

Lines changed: 33 additions & 6 deletions

File tree

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
- image: "alpine:3.23"
3131
with_gui: false # it appears FindQt6.cmake is not provided by any package
3232
full_build: false # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing
33+
- image: "oraclelinux:8"
34+
with_gui: false # no qt6 are installed, missing GUI in old distros is OK
35+
full_build: true
3336
fail-fast: false # Prefer quick result
3437

3538
runs-on: ubuntu-22.04
@@ -63,6 +66,12 @@ jobs:
6366
run: |
6467
apk add cmake make g++ pcre-dev
6568
69+
- name: Install missing software on Oracle Linux
70+
if: contains(matrix.image, 'oraclelinux')
71+
run: |
72+
yum install -y git python3 which epel-release
73+
yum install -y cmake3 gcc-c++ make pcre-devel
74+
6675
# needs to be called after the package installation since
6776
# - it doesn't call "apt-get update"
6877
- name: ccache
@@ -87,7 +96,7 @@ jobs:
8796

8897
strategy:
8998
matrix:
90-
image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"]
99+
image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8"]
91100
fail-fast: false # Prefer quick result
92101

93102
runs-on: ubuntu-22.04
@@ -111,6 +120,12 @@ jobs:
111120
run: |
112121
apk add make g++ pcre-dev bash python3 libxml2-utils
113122
123+
- name: Install missing software on Oracle Linux
124+
if: contains(matrix.image, 'oraclelinux')
125+
run: |
126+
yum install -y git python3 which epel-release
127+
yum install -y cmake3 gcc-c++ make pcre-devel
128+
114129
# needs to be called after the package installation since
115130
# - it doesn't call "apt-get update"
116131
- name: ccache

lib/checks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ namespace CheckInstances
2929
{
3030
/** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */
3131
CPPCHECKLIB const std::list<Check *>& get();
32-
};
32+
}
3333

3434
#endif // checksH

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&&) CPPCHECK_NOEXCEPT = default;
83+
Settings & Settings::operator=(Settings &&) CPPCHECK_NOEXCEPT = default;
8484

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

lib/settings.h

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

9696

97+
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 9
98+
// Hack to workaround GCC bug.
99+
// Details: https://trac.cppcheck.net/ticket/14850
100+
// seen on:
101+
// oraclelinux:8, g++-8.5
102+
// ubuntu:20.04, g++-9.4.0
103+
#define CPPCHECK_NOEXCEPT
104+
#else
105+
#define CPPCHECK_NOEXCEPT noexcept
106+
#endif
107+
108+
97109
/**
98110
* @brief This is just a container for general settings so that we don't need
99111
* to pass individual values to functions or constructors now or in the
@@ -113,8 +125,8 @@ class CPPCHECKLIB WARN_UNUSED Settings {
113125
Settings(const Settings&);
114126
Settings& operator=(const Settings&);
115127

116-
Settings(Settings&&) noexcept;
117-
Settings& operator=(Settings&&) noexcept;
128+
Settings(Settings&&) CPPCHECK_NOEXCEPT;
129+
Settings& operator=(Settings&&) CPPCHECK_NOEXCEPT;
118130

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

0 commit comments

Comments
 (0)