Fix #14850 (Compilation fails on oraclelinux:8 (g++ 8.5.0 released in 2021))#8654
Fix #14850 (Compilation fails on oraclelinux:8 (g++ 8.5.0 released in 2021))#8654danmar wants to merge 10 commits into
Conversation
firewave
left a comment
There was a problem hiding this comment.
This feels like a compiler bug to me.
We should make noexcept optional as a hack for this compiler in question instead of rolling back perfectly valid code.
|
See also https://trac.cppcheck.net/ticket/14851 to make sure such problems are not just platform-specific. |
|
@firewave thanks for your review.. I also feel these errors are pretty weird. do you have some more specifiec suggestion how we hack it.. how about : And then I use NOEXCEPT in the constructor and assignment operator? So when compiling on oraclelinux I will have to provide |
testing more platforms/compilers sounds good to me. we can easily break stuff.. |
Something along those lines. Using |
I was not sure if it was a g++ 8.5.0 generic bug. Or what versions are affected. but I now see that we can reproduce with godbolt also... |
That code appears to be invalid as it doesn't compile at all regardless of version or compiler. |
yes .. and when I fix that then 8.5 doesn't complain anymore. :-( |
|
@firewave ping could you please look? this blocks a cppcheck premium release as I can't build release binaries. |
|
I have a system which has lots of old GCC versions installed and I wanted to give it a spin with it first but I won't until later today. |
There was a problem hiding this comment.
Pull request overview
This PR addresses a GCC ≤9 (not Clang) compilation failure reported on Oracle Linux 8 by relaxing the noexcept specification for Settings move operations under affected compiler versions, and extends CI coverage to include an oraclelinux:8 container build. It also includes a small header formatting cleanup in lib/checks.h.
Changes:
- Add a GCC-version-guarded workaround to omit
noexceptonSettingsmove ctor/assignment for GCC ≤9. - Add
oraclelinux:8to the Docker-based Unix-ish CI matrix and install required build dependencies. - Minor namespace closing brace cleanup in
lib/checks.h.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
lib/settings.h |
Introduces the GCC workaround macro and applies it to Settings move operations. |
lib/settings.cpp |
Applies the workaround macro to the defaulted move operations’ definitions. |
lib/checks.h |
Removes an unnecessary trailing semicolon after a namespace block. |
.github/workflows/CI-unixish-docker.yml |
Adds Oracle Linux 8 to CI and installs dependencies for that container. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alright I will wait until later today. |
|
|
||
| Settings(Settings&&) noexcept; | ||
| Settings& operator=(Settings&&) noexcept; | ||
| Settings(Settings&&) CPPCHECK_NOEXCEPT; |
| Settings(Settings&&) noexcept; | ||
| Settings& operator=(Settings&&) noexcept; | ||
| Settings(Settings&&) CPPCHECK_NOEXCEPT; | ||
| Settings& operator=(Settings&&) CPPCHECK_NOEXCEPT; |
| Settings(Settings&&) noexcept; | ||
| Settings& operator=(Settings&&) noexcept; | ||
| Settings(Settings&&) CPPCHECK_NOEXCEPT; | ||
| Settings& operator=(Settings&&) CPPCHECK_NOEXCEPT; |
Ugh. Won't happen that soon. Something in my main machine broke as it starts but I am only getting a black screen. |
|
The graphics card was simply loose... I was able to reproduce the issue with GCC 7 to 9 (no earlier version handy) and it is working with GCC 10 and up. |
| - 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" |
There was a problem hiding this comment.
Please use oraclelinux:8-slim for a smaller base image.
| strategy: | ||
| matrix: | ||
| image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"] | ||
| image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23", "oraclelinux:8"] |
There was a problem hiding this comment.
Please use oraclelinux:8-slim for a smaller base image.
| /** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */ | ||
| CPPCHECKLIB const std::list<Check *>& get(); | ||
| }; | ||
| } |
There was a problem hiding this comment.
I am curious why we did not see this warning in the CI before.
| // 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 |
There was a problem hiding this comment.
This comment can be adjusted to g++ before 10.x as it is not distribution bound.
No description provided.