Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/CI-gcc-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: CI-gcc-versions

on:
push:
branches:
- 'main'
- 'releases/**'
- '2.*'
tags:
- '2.*'
pull_request:

permissions:
contents: read

jobs:
build:

strategy:
matrix:
image: ["gcc:6.5", "gcc:7.5", "gcc:8.5", "gcc:9.5"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These images are way too big (500+ MB) to be used in the CI.

I would also prefer an actual distro as there are several other moving parts in those which might cause issues (mainly CMake).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it should be sufficient to test the minimum support version.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also prefer an actual distro as there are several other moving parts in those which might cause issues (mainly CMake).

And the limitations of GitHub runners which will no longer allow us to run certain distro versions. We should probably apply the same we do for Python - specify the oldest what we can reasonable use in the CI as the actual minimum - even if it might be EOL/EOS.

fail-fast: false

runs-on: ubuntu-22.04

container:
image: ${{ matrix.image }}

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Build cppcheck
run: |
make -j$(nproc) CXXOPTS="-Werror"
17 changes: 16 additions & 1 deletion .github/workflows/CI-unixish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use oraclelinux:8-slim for a smaller base image.

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
Expand Down Expand Up @@ -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
Expand All @@ -87,7 +96,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"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use oraclelinux:8-slim for a smaller base image.

fail-fast: false # Prefer quick result

runs-on: ubuntu-22.04
Expand All @@ -111,6 +120,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
Expand Down
2 changes: 1 addition & 1 deletion lib/checks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Check *>& get();
};
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious why we did not see this warning in the CI before.


#endif // checksH
4 changes: 2 additions & 2 deletions lib/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
16 changes: 14 additions & 2 deletions lib/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@
};


#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
Comment on lines +98 to +102

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment can be adjusted to g++ before 10.x as it is not distribution bound.

#define CPPCHECK_NOEXCEPT
#else
#define CPPCHECK_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
Expand All @@ -113,8 +125,8 @@
Settings(const Settings&);
Settings& operator=(const Settings&);

Settings(Settings&&) noexcept;
Settings& operator=(Settings&&) noexcept;
Settings(Settings&&) CPPCHECK_NOEXCEPT;

Check warning

Code scanning / Cppcheck Premium

User-provided copy and move member functions of a class should have appropriate signatures. Move constructor must be noexcept and have only one argument which must be non-volatile Warning

User-provided copy and move member functions of a class should have appropriate signatures. Move constructor must be noexcept and have only one argument which must be non-volatile
Settings& operator=(Settings&&) CPPCHECK_NOEXCEPT;

Check warning

Code scanning / Cppcheck Premium

Exception-unfriendly functions shall be noexcept Warning

Exception-unfriendly functions shall be noexcept

Check warning

Code scanning / Cppcheck Premium

User-provided copy and move member functions of a class should have appropriate signatures. Assignment operator must have lvalue ref-qualifier must not be virtual and have only one argument which must be non-volatile Warning

User-provided copy and move member functions of a class should have appropriate signatures. Assignment operator must have lvalue ref-qualifier must not be virtual and have only one argument which must be non-volatile

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

Expand Down
Loading