diff --git a/.clang-tidy b/.clang-tidy
index 19508860132..b83436861bd 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -18,18 +18,19 @@ Checks: >
-objc-*,
-openmp-*,
-zircon-*,
- cert-err34-c,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-rvalue-reference-param-not-moved,
google-explicit-constructor,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
+ -bugprone-command-processor,
-bugprone-easily-swappable-parameters,
-bugprone-empty-catch,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-bugprone-switch-missing-default-case,
+ -bugprone-throwing-static-initialization,
-bugprone-unchecked-optional-access,
-clang-analyzer-*,
-concurrency-mt-unsafe,
@@ -41,7 +42,9 @@ Checks: >
-modernize-avoid-c-arrays,
-modernize-deprecated-ios-base-aliases,
-misc-include-cleaner,
+ -misc-multiple-inheritance,
-misc-unused-using-decls,
+ -modernize-avoid-c-style-cast,
-modernize-loop-convert,
-modernize-macro-to-enum,
-modernize-raw-string-literal,
@@ -50,10 +53,12 @@ Checks: >
-modernize-type-traits,
-modernize-use-designated-initializers,
-modernize-use-nodiscard,
+ -modernize-use-scoped-lock,
-modernize-use-trailing-return-type,
-performance-avoid-endl,
-performance-inefficient-string-concatenation,
-performance-no-automatic-move,
+ -portability-avoid-pragma-once,
-portability-simd-intrinsics,
-portability-std-allocator-const,
-readability-avoid-nested-conditional-operator,
@@ -65,15 +70,25 @@ Checks: >
-readability-identifier-length,
-readability-identifier-naming,
-readability-implicit-bool-conversion,
+ -readability-inconsistent-ifelse-braces,
-readability-isolate-declaration,
-readability-magic-numbers,
+ -readability-redundant-parentheses,
-readability-suspicious-call-argument,
- -readability-uppercase-literal-suffix
+ -readability-uppercase-literal-suffix,
+ -readability-use-concise-preprocessor-directives,
+ -misc-unconventional-assign-operator
WarningsAsErrors: '*'
-HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z_]+\.h'
+HeaderFilterRegex: '(cli|gui|frontend|lib|oss-fuzz|test|triage)\/[a-z_]+\.h'
ExcludeHeaderFilterRegex: 'ui_.*.h'
CheckOptions:
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: readability-simplify-boolean-expr.SimplifyDeMorgan
value: '0'
+ - key: modernize-use-trailing-return-type.TransformFunctions
+ value: false
+ - key: misc-override-with-different-visibility.DisallowedVisibilityChange
+ value: widening
+ - key: misc-use-internal-linkage.AnalyzeTypes
+ value: false
diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml
index 93a77d70c33..6b0ad2cc5bd 100644
--- a/.github/workflows/CI-cygwin.yml
+++ b/.github/workflows/CI-cygwin.yml
@@ -37,20 +37,21 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Cygwin
- uses: cygwin/cygwin-install-action@master
+ uses: cygwin/cygwin-install-action@v6
with:
+ site: https://mirrors.cicku.me/cygwin/
platform: ${{ matrix.platform }}
packages: ${{ matrix.packages }}
# Cygwin will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries.
- name: Build all and run test
run: |
- C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j%NUMBER_OF_PROCESSORS% check
+ C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j%NUMBER_OF_PROCESSORS% CXXOPTS="-Werror" test
- name: Extra test for misra
run: |
diff --git a/.github/workflows/CI-mingw.yml b/.github/workflows/CI-mingw.yml
index 8f6ff31182a..f308cfa5110 100644
--- a/.github/workflows/CI-mingw.yml
+++ b/.github/workflows/CI-mingw.yml
@@ -30,8 +30,10 @@ jobs:
runs-on: ${{ matrix.os }}
+ timeout-minutes: 19 # max + 3*std of the last 7K runs
+
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -51,27 +53,23 @@ jobs:
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
- # TODO: bail out on warning
- name: Build cppcheck
run: |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
- make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) cppcheck
- env:
- LDFLAGS: -fuse-ld=lld # use lld for faster linking
+ # use lld for faster linking
+ make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) CXXOPTS="-Werror" cppcheck
- name: Build test
run: |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
- make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) testrunner
- env:
- LDFLAGS: -fuse-ld=lld # use lld for faster linking
+ # use lld for faster linking
+ make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) CXXOPTS="-Werror" testrunner
- name: Run test
run: |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
- make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) check
- env:
- LDFLAGS: -fuse-ld=lld # use lld for faster linking
+ # use lld for faster linking
+ make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) CXXOPTS="-Werror" test
diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml
index d3b4ba8a5f4..adf4a74c81b 100644
--- a/.github/workflows/CI-unixish-docker.yml
+++ b/.github/workflows/CI-unixish-docker.yml
@@ -20,13 +20,16 @@ jobs:
strategy:
matrix:
- image: ["ubuntu:24.04", "ubuntu:24.10"]
include:
- - build_gui: false
- image: "ubuntu:24.04"
- build_gui: true
- - image: "ubuntu:24.10"
- build_gui: true
+ with_gui: true
+ full_build: true
+ - image: "ubuntu:25.10"
+ with_gui: true
+ full_build: true
+ - 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
fail-fast: false # Prefer quick result
runs-on: ubuntu-22.04
@@ -40,7 +43,7 @@ jobs:
image: ${{ matrix.image }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -51,10 +54,15 @@ jobs:
apt-get install -y cmake g++ make libxml2-utils libpcre3-dev
- name: Install missing software (gui) on latest ubuntu
- if: matrix.build_gui
+ if: contains(matrix.image, 'ubuntu')
run: |
apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev
+ - name: Install missing software on Alpine
+ if: contains(matrix.image, 'alpine')
+ run: |
+ apk add cmake make g++ pcre-dev
+
# needs to be called after the package installation since
# - it doesn't call "apt-get update"
- name: ccache
@@ -62,18 +70,13 @@ jobs:
with:
key: ${{ github.workflow }}-${{ matrix.image }}
- - name: CMake build
- if: ${{ !matrix.build_gui }}
+ - name: Run CMake
run: |
- mkdir cmake.output
- cd cmake.output
- cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
- cmake --build . -- -j$(nproc)
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=${{ matrix.with_gui }} -DWITH_QCHART=On -DBUILD_TRIAGE=${{ matrix.with_gui }} -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- - name: CMake build (with GUI)
- if: matrix.build_gui
+ - name: CMake build
+ if: matrix.full_build
run: |
- cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build cmake.output -- -j$(nproc)
- name: Run CMake test
@@ -84,7 +87,7 @@ jobs:
strategy:
matrix:
- image: ["ubuntu:24.04", "ubuntu:24.10"]
+ image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"]
fail-fast: false # Prefer quick result
runs-on: ubuntu-22.04
@@ -93,7 +96,7 @@ jobs:
image: ${{ matrix.image }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -103,6 +106,11 @@ jobs:
apt-get update
apt-get install -y g++ make python3 libxml2-utils libpcre3-dev
+ - name: Install missing software on Alpine
+ if: contains(matrix.image, 'alpine')
+ run: |
+ apk add make g++ pcre-dev bash python3 libxml2-utils
+
# needs to be called after the package installation since
# - it doesn't call "apt-get update"
- name: ccache
@@ -110,19 +118,21 @@ jobs:
with:
key: ${{ github.workflow }}-${{ matrix.image }}
+ # /usr/lib/ccache/bin - Alpine Linux
+
- name: Build cppcheck
run: |
- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w"
+ 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 test
run: |
- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w"
+ 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: Run test
run: |
- make -j$(nproc) check HAVE_RULES=yes
+ make -j$(nproc) HAVE_RULES=yes test
# requires python3
- name: Run extra tests
diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml
index 62adc9a62c5..9bac980c853 100644
--- a/.github/workflows/CI-unixish.yml
+++ b/.github/workflows/CI-unixish.yml
@@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
- os: [ubuntu-22.04, macos-13]
+ os: [ubuntu-22.04, macos-15]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
@@ -30,7 +30,7 @@ jobs:
CCACHE_SLOPPINESS: pch_defines,time_macros
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -58,13 +58,13 @@ jobs:
- name: CMake build on ubuntu (with GUI / system tinyxml2)
if: contains(matrix.os, 'ubuntu')
run: |
- cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+ cmake -S . -B cmake.output.tinyxml2 -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build cmake.output.tinyxml2 -- -j$(nproc)
- name: CMake build on macos (with GUI / system tinyxml2)
if: contains(matrix.os, 'macos')
run: |
- cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6
+ cmake -S . -B cmake.output.tinyxml2 -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6
cmake --build cmake.output.tinyxml2 -- -j$(nproc)
- name: Run CMake test (system tinyxml2)
@@ -75,7 +75,7 @@ jobs:
strategy:
matrix:
- os: [ubuntu-22.04, macos-13]
+ os: [ubuntu-22.04, macos-15]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
@@ -85,7 +85,7 @@ jobs:
CCACHE_SLOPPINESS: pch_defines,time_macros
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -97,7 +97,7 @@ jobs:
# TODO: move latest compiler to separate step
# TODO: bail out on warnings with latest GCC
- name: Set up GCC
- uses: egor-tensin/setup-gcc@v1
+ uses: egor-tensin/setup-gcc@v2
if: false # matrix.os == 'ubuntu-22.04'
with:
version: 13
@@ -127,12 +127,12 @@ jobs:
- name: Run CMake on ubuntu (with GUI)
if: contains(matrix.os, 'ubuntu')
run: |
- cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install
- name: Run CMake on macos (with GUI)
if: contains(matrix.os, 'macos')
run: |
- cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6
- name: Run CMake build
run: |
@@ -150,18 +150,122 @@ jobs:
- name: Run CMake install
run: |
cmake --build cmake.output --target install
+ # TODO: validate the installed files
+
+ - name: Run CMake on ubuntu (no CLI)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ cmake -S . -B cmake.output_nocli -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_CLI=Off
+
+ - name: Run CMake on ubuntu (no CLI / with tests)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ # the test and CLI code are too intertwined so for now we need to reject that
+ if cmake -S . -B cmake.output_nocli_tests -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DBUILD_CLI=Off; then
+ exit 1
+ else
+ exit 0
+ fi
+
+ - name: Run CMake on ubuntu (no CLI / with GUI)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ cmake -S . -B cmake.output_nocli_gui -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=On
+
+ - name: Run CMake on ubuntu (no GUI)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ cmake -S . -B cmake.output_nogui -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_GUI=Off
+
+ - name: Run CMake on ubuntu (no GUI / with triage)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ # cannot build triage without GUI
+ if cmake -S . -B cmake.output_nogui_triage -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_GUI=Off -DBUILD_TRIAGE=On; then
+ exit 1
+ else
+ exit 0
+ fi
+
+ - name: Run CMake on ubuntu (no CLI / no GUI)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ cmake -S . -B cmake.output_nocli_nogui -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_GUI=Off
+
+ build_cmake_cxxstd:
+
+ strategy:
+ matrix:
+ os: [ubuntu-22.04, macos-15]
+ cxxstd: [14, 17, 20]
+ # FIXME: macos-15 fails to compile with C++20
+ #
+ # /Users/runner/work/cppcheck/cppcheck/cmake.output/gui/test/projectfile/moc_testprojectfile.cpp:84:1: error: 'constinit' specifier is incompatible with C++ standards before C++20 [-Werror,-Wc++20-compat]
+ # 84 | Q_CONSTINIT const QMetaObject TestProjectFile::staticMetaObject = { {
+ # | ^
+ # /opt/homebrew/opt/qt/lib/QtCore.framework/Headers/qcompilerdetection.h:1409:23: note: expanded from macro 'Q_CONSTINIT'
+ exclude:
+ - os: macos-15
+ cxxstd: 20
+ fail-fast: false # Prefer quick result
+
+ runs-on: ${{ matrix.os }}
+
+ env:
+ # TODO: figure out why there are cache misses with PCH enabled
+ CCACHE_SLOPPINESS: pch_defines,time_macros
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: ccache
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.cxxstd }}
+
+ - name: Install missing software on ubuntu
+ if: contains(matrix.os, 'ubuntu')
+ run: |
+ sudo apt-get update
+ sudo apt-get install libxml2-utils
+ # qt6-tools-dev-tools for lprodump
+ # qt6-l10n-tools for lupdate
+ sudo apt-get install qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev
+
+ # coreutils contains "nproc"
+ - name: Install missing software on macos
+ if: contains(matrix.os, 'macos')
+ run: |
+ # pcre was removed from runner images in November 2022
+ brew install coreutils qt@6 pcre
+
+ - name: Run CMake on ubuntu (with GUI)
+ if: contains(matrix.os, 'ubuntu')
+ run: |
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+
+ - name: Run CMake on macos (with GUI)
+ if: contains(matrix.os, 'macos')
+ run: |
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6
+
+ - name: Run CMake build
+ run: |
+ cmake --build cmake.output -- -j$(nproc)
build_uchar:
strategy:
matrix:
- os: [ubuntu-22.04, macos-13]
+ os: [ubuntu-22.04, macos-15]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -179,23 +283,23 @@ jobs:
- name: Build with Unsigned char
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
+ make -j$(nproc) CXXOPTS="-Werror -funsigned-char" testrunner
- name: Test with Unsigned char
run: |
- ./testrunner TestSymbolDatabase
+ ./testrunner
build_mathlib:
strategy:
matrix:
- os: [ubuntu-22.04, macos-13]
+ os: [ubuntu-22.04, macos-15]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -213,23 +317,23 @@ jobs:
- name: Build with TEST_MATHLIB_VALUE
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all
+ make -j$(nproc) CXXOPTS="-Werror" CPPOPTS=-DTEST_MATHLIB_VALUE all
- name: Test with TEST_MATHLIB_VALUE
run: |
- make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE check
+ make -j$(nproc) test
check_nonneg:
strategy:
matrix:
- os: [ubuntu-22.04, macos-13]
+ os: [ubuntu-22.04, macos-15]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -241,24 +345,123 @@ jobs:
- name: Check syntax with NONNEG
run: |
- ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
+ make check-nonneg CXXOPTS="-Werror"
+
+ build_cmake_boost:
+
+ strategy:
+ matrix:
+ os: [macos-15] # non-macos platforms are already built with Boost in other contexts
+ fail-fast: false # Prefer quick result
+
+ runs-on: ${{ matrix.os }}
+
+ env:
+ # TODO: figure out why there are cache misses with PCH enabled
+ CCACHE_SLOPPINESS: pch_defines,time_macros
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: ccache
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
+
+ - name: Run CMake on macOS (force Boost)
+ run: |
+ # make sure we fail when Boost is requested and not available.
+ # will fail because no package configuration is available.
+ if cmake -S . -B cmake.output.boost-force-noavail -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DUSE_BOOST=On; then
+ exit 1
+ else
+ exit 0
+ fi
+
+ # coreutils contains "nproc"
+ - name: Install missing software on macOS
+ run: |
+ brew install coreutils boost
+
+ - name: Run CMake on macOS (force Boost)
+ run: |
+ cmake -S . -B cmake.output.boost-force -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DUSE_BOOST=On
+
+ - name: Run CMake on macOS (no Boost)
+ run: |
+ # make sure Boost is not used when disabled even though it is available
+ cmake -S . -B cmake.output.boost-no -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DUSE_BOOST=Off
+ if grep -q '\-DHAVE_BOOST' ./cmake.output.boost-no/compile_commands.json; then
+ exit 1
+ else
+ exit 0
+ fi
+
+ - name: Run CMake on macOS (with Boost)
+ run: |
+ cmake -S . -B cmake.output.boost -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+ grep -q '\-DHAVE_BOOST' ./cmake.output.boost/compile_commands.json
+
+ - name: Build with CMake on macOS (with Boost)
+ run: |
+ cmake --build cmake.output.boost -- -j$(nproc)
+
+ build_cmake_minimum: # TODO: move to docker workflow?
+
+ runs-on: ubuntu-22.04 # use the oldest available runner
+
+ env:
+ CMAKE_VERSION: 3.22
+ CMAKE_VERSION_FULL: 3.22.6
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Install missing software
+ run: |
+ sudo apt-get update
+ sudo apt-get install libxml2-utils
+ # qt6-tools-dev-tools for lprodump
+ # qt6-l10n-tools for lupdate
+ sudo apt-get install qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev
+
+ - name: Install CMake
+ run: |
+ wget https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64.tar.gz
+ tar xf cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64.tar.gz
+
+ - name: Run CMake (without GUI)
+ run: |
+ export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH
+ # FIXME: cannot use --warn-uninitialized here as it completely breaks the build
+ cmake -S . -B cmake.output -Werror=dev -DHAVE_RULES=On -DBUILD_TESTING=On
+
+ - name: Run CMake (with GUI)
+ run: |
+ export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH
+ # FIXME: cannot use --warn-uninitialized here as it completely breaks the build
+ cmake -S . -B cmake.output.gui -Werror=dev -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On
build:
strategy:
matrix:
- os: [ubuntu-22.04, macos-13]
+ os: [ubuntu-22.04, macos-15]
include:
- xdist_n: auto
- # FIXME: test_color_tty fails with xdist
- - os: macos-13
+ # FIXME: test_color_tty fails with xdist - see #13278
+ - os: macos-15
xdist_n: '1'
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -284,9 +487,10 @@ jobs:
if: contains(matrix.os, 'macos')
run: |
# pcre was removed from runner images in November 2022
- brew install coreutils python3 pcre gnu-sed
+ brew install coreutils pcre gnu-sed
- - name: Install missing Python packages
+ - name: Install missing Python packages on ubuntu
+ if: contains(matrix.os, 'ubuntu')
run: |
python3 -m pip install pip --upgrade
python3 -m pip install pytest
@@ -294,19 +498,32 @@ jobs:
python3 -m pip install pytest-xdist
python3 -m pip install psutil
+ # we need to use -break-system-packages --user because the common approaches do not work.
+ # using pip works but it appears to install the packages into a different Python installation so they are not found later on.
+ # using python3 -m pip without the additional flags fails since the packages are being managed by a different tool (brew) and that lacks some of the packages.
+ # using pipx also does not work.
+ - name: Install missing Python packages on macos
+ if: contains(matrix.os, 'macos')
+ run: |
+ python3 -m pip install --break-system-packages --user pip --upgrade
+ python3 -m pip install --break-system-packages --user pytest
+ python3 -m pip install --break-system-packages --user pytest-timeout
+ python3 -m pip install --break-system-packages --user pytest-xdist
+ python3 -m pip install --break-system-packages --user psutil
+
- name: Build cppcheck
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- make -j$(nproc) HAVE_RULES=yes
+ make -j$(nproc) CXXOPTS="-Werror" HAVE_RULES=yes
- name: Build test
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- make -j$(nproc) testrunner HAVE_RULES=yes
+ make -j$(nproc) CXXOPTS="-Werror" HAVE_RULES=yes testrunner
- name: Run test
run: |
- make -j$(nproc) check HAVE_RULES=yes
+ make -j$(nproc) HAVE_RULES=yes test
# requires "gnu-sed" installed on macos
- name: Run extra tests
@@ -382,7 +599,7 @@ jobs:
- name: Test Signalhandler
run: |
- cmake -S . -B build.cmake.signal -G "Unix Makefiles" -DBUILD_TESTS=On
+ cmake -S . -B build.cmake.signal -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On
cmake --build build.cmake.signal --target test-signalhandler -- -j$(nproc)
# TODO: how to run this without copying the file?
cp build.cmake.signal/bin/test-s* .
@@ -393,7 +610,7 @@ jobs:
- name: Test Stacktrace
if: contains(matrix.os, 'ubuntu')
run: |
- cmake -S . -B build.cmake.stack -G "Unix Makefiles" -DBUILD_TESTS=On
+ cmake -S . -B build.cmake.stack -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On
cmake --build build.cmake.stack --target test-stacktrace -- -j$(nproc)
# TODO: how to run this without copying the file?
cp build.cmake.stack/bin/test-s* .
@@ -456,6 +673,28 @@ jobs:
warnings="-pedantic -Wall -Wextra -Wcast-qual -Wno-deprecated-declarations -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar"
g++ $warnings -c -Ilib -Iexternals/tinyxml2 democlient/democlient.cpp
+ - name: Test disabled executors
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ g++ -Ilib -c cli/threadexecutor.cpp -DDISALLOW_THREAD_EXECUTOR
+ test -z "$(nm threadexecutor.o)"
+ g++ -Ilib -c cli/processexecutor.cpp -DDISALLOW_PROCESS_EXECUTOR
+ test -z "$(nm processexecutor.o)"
+ # TODO: test NO_* defines
+
+ - name: Test execinfo.h detection
+ run: |
+ make clean
+ make cli/stacktrace.o | grep HAVE_EXECINFO_H=1
+ test -n "$(nm cli/stacktrace.o)"
+
+ - name: Test testrunner inclusion/exclusion
+ run: |
+ ! ./testrunner -d TestUtils | grep -v TestUtils > /dev/null
+ ! ./testrunner -d TestUtils::trim | grep -v TestUtils::trim > /dev/null
+ ! ./testrunner -d -x TestUtils | grep TestUtils > /dev/null
+ ! ./testrunner -d -x TestUtils:trim | grep TestUtils:trim > /dev/null
+
- name: Show all ignored files
if: false # TODO: currently lists all the contents of ignored folders - we only need what actually matched
run: |
@@ -473,7 +712,7 @@ jobs:
runs-on: ubuntu-22.04 # run on the latest image only
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -494,11 +733,11 @@ jobs:
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
# compile with verification and ast matchers
- make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2 -w -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
+ make -j$(nproc) CXXOPTS="-Werror -g -O2" CPPOPTS="-DCHECK_INTERNAL -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
- name: CMake
run: |
- cmake -S . -B cmake.output -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On
- name: Generate dependencies
run: |
@@ -508,28 +747,4 @@ jobs:
- name: Self check
run: |
- selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive"
- cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
- ec=0
-
- # TODO: add --check-config
-
- # early exit
- if [ $ec -eq 1 ]; then
- exit $ec
- fi
-
- # self check externals
- ./cppcheck $selfcheck_options externals || ec=1
- # self check lib/cli
- mkdir b1
- ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json cli || ec=1
- ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json --enable=internal lib || ec=1
- # check gui with qt settings
- mkdir b2
- ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b2 -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui || ec=1
- # self check test and tools
- ./cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/dmake/*.cpp || ec=1
- # triage
- ./cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage || ec=1
- exit $ec
+ ./selfcheck.sh
diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml
index e07cedbc9f3..66858c7afbe 100644
--- a/.github/workflows/CI-windows.yml
+++ b/.github/workflows/CI-windows.yml
@@ -19,21 +19,19 @@ defaults:
run:
shell: cmd
-# TODO: choose/add a step to bail out on compiler warnings (maybe even the release build)
-
jobs:
build_qt:
strategy:
matrix:
os: [windows-2022, windows-2025]
- qt_ver: [5.15.2, 6.9.0]
+ qt_ver: [6.10.0]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -49,37 +47,98 @@ jobs:
modules: 'qtcharts'
setup-python: 'false'
cache: true
- aqtversion: '==3.1.*' # TODO: remove when aqtinstall 3.2.2 is available
-
- - name: Run CMake for GUI release (Qt 5)
- if: startsWith(matrix.qt_ver, '5')
- run: |
- ; TODO: enable rules?
- ; specify Release build so matchcompiler is used
- cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DBUILD_ONLINE_HELP=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install || exit /b !errorlevel!
- - name: Run CMake for GUI release (Qt 6)
- if: startsWith(matrix.qt_ver, '6')
+ - name: Run CMake
run: |
- ; TODO: enable rules?
- ; specify Release build so matchcompiler is used
- cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DBUILD_ONLINE_HELP=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install || exit /b !errorlevel!
+ rem TODO: enable rules?
+ cmake -S . -B build -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Debug -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_TESTING=Off -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DBUILD_ONLINE_HELP=On -DISABLE_DMAKE=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
- - name: Run CMake build
+ - name: Build GUI
run: |
- cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
+ cmake --build build --config Debug --target cppcheck-gui || exit /b !errorlevel!
+ # TODO: can this be done in CMake?
- name: Deploy GUI
run: |
- windeployqt build\bin\Release || exit /b !errorlevel!
- del build\bin\Release\cppcheck-gui.ilk || exit /b !errorlevel!
- del build\bin\Release\cppcheck-gui.pdb || exit /b !errorlevel!
+ windeployqt --no-translations build\bin\Debug || exit /b !errorlevel!
+ del build\bin\Debug\cppcheck-gui.pdb || exit /b !errorlevel!
# TODO: run GUI tests
- name: Run CMake install
run: |
- cmake --build build --target install
+ rem TODO: the Qt DLLs are not being installed
+ cmake --build build --config Debug --target install
+ rem TODO: validate the installed files
+ rem TODO: the structure does not match an actual Windows installation
+
+ build_cmake_cxxstd:
+ strategy:
+ matrix:
+ os: [windows-2022, windows-2025]
+ cxxstd: [14, 17, 20]
+ fail-fast: false
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Set up Visual Studio environment
+ uses: ilammy/msvc-dev-cmd@v1
+ with:
+ arch: x64
+
+ - name: Run CMake
+ run: |
+ cmake -S . -B build.cxxstd -Werror=dev --warn-uninitialized -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
+
+ - name: Build
+ run: |
+ cmake --build build.cxxstd --config Debug || exit /b !errorlevel!
+
+ build_cmake_minimum:
+
+ runs-on: windows-2022 # use the oldest available runner
+
+ env:
+ CMAKE_VERSION: 3.22
+ CMAKE_VERSION_FULL: 3.22.6
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Install CMake
+ run: |
+ curl -fsSL https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64.zip -o cmake.zip || exit /b !errorlevel!
+ 7z x cmake.zip || exit /b !errorlevel!
+
+ - name: Set up Visual Studio environment
+ uses: ilammy/msvc-dev-cmd@v1
+ with:
+ arch: x64
+
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: 6.10.0
+ modules: 'qtcharts'
+ setup-python: 'false'
+ cache: true
+
+ - name: Run CMake (without GUI)
+ run: |
+ :: TODO: enable DHAVE_RULES?
+ cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64\bin\cmake.exe -S . -B cmake.output -A x64 -DHAVE_RULES=Off -DBUILD_TESTING=On
+
+ - name: Run CMake (with GUI)
+ run: |
+ :: TODO: enable DHAVE_RULES?
+ cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64\bin\cmake.exe -S . -B cmake.output.gui -A x64 -DHAVE_RULES=Off -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On
build:
strategy:
@@ -95,15 +154,15 @@ jobs:
PCRE_VERSION: 8.45
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
- - name: Set up Python 3.13
+ - name: Set up Python
if: matrix.config == 'release'
- uses: actions/setup-python@v5
+ uses: actions/setup-python@v6
with:
- python-version: '3.13'
+ python-version: '3.14'
check-latest: true
- name: Set up Visual Studio environment
@@ -113,7 +172,7 @@ jobs:
- name: Cache PCRE
id: cache-pcre
- uses: actions/cache@v4
+ uses: actions/cache@v5
with:
path: |
externals\pcre.h
@@ -133,7 +192,7 @@ jobs:
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
git apply --ignore-space-change ..\externals\pcre.patch || exit /b !errorlevel!
- cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5 || exit /b !errorlevel!
+ cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
nmake || exit /b !errorlevel!
copy pcre.h ..\externals || exit /b !errorlevel!
copy pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
@@ -150,8 +209,6 @@ jobs:
python -m pip install pytest-xdist || exit /b !errorlevel!
python -m pip install psutil || exit /b !errorlevel!
- # TODO: build with CMake
-
- name: Build CLI debug configuration using MSBuild
if: matrix.config == 'debug'
run: |
@@ -162,7 +219,7 @@ jobs:
- name: Run Debug test
if: matrix.config == 'debug'
- run: .\bin\debug\testrunner.exe || exit /b !errorlevel!
+ run: .\bin\debug\testrunner.exe -t || exit /b !errorlevel!
- name: Build CLI release configuration using MSBuild
if: matrix.config == 'release'
@@ -215,7 +272,7 @@ jobs:
- name: Test SEH wrapper
if: matrix.config == 'release'
run: |
- cmake -S . -B build.cmake.seh -DBUILD_TESTS=On || exit /b !errorlevel!
+ cmake -S . -B build.cmake.seh -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
cmake --build build.cmake.seh --target test-sehwrapper || exit /b !errorlevel!
:: TODO: how to run this without copying the file?
copy build.cmake.seh\bin\Debug\test-sehwrapper.exe . || exit /b !errorlevel!
diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml
deleted file mode 100644
index 3e8fc4053f1..00000000000
--- a/.github/workflows/asan.yml
+++ /dev/null
@@ -1,153 +0,0 @@
-# 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: address sanitizer
-
-on:
- push:
- branches:
- - 'main'
- - 'releases/**'
- - '2.*'
- tags:
- - '2.*'
- pull_request:
-
-permissions:
- contents: read
-
-jobs:
- build:
-
- runs-on: ubuntu-22.04
-
- env:
- QT_VERSION: 6.9.0
- ASAN_OPTIONS: detect_stack_use_after_return=1
- # TODO: figure out why there are cache misses with PCH enabled
- CCACHE_SLOPPINESS: pch_defines,time_macros
-
- steps:
- - uses: actions/checkout@v4
- with:
- persist-credentials: false
-
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
-
- - name: Set up Python 3.13
- uses: actions/setup-python@v5
- with:
- python-version: '3.13'
- check-latest: true
-
- - name: Install missing software on ubuntu
- run: |
- sudo apt-get update
- sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils
- sudo apt-get install -y libcups2-dev # required for Qt6PrintSupport in CMake since Qt 6.7.3
-
- - name: Install clang
- run: |
- sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
- wget https://apt.llvm.org/llvm.sh
- chmod +x llvm.sh
- sudo ./llvm.sh 20
-
- - name: Install Qt ${{ env.QT_VERSION }}
- uses: jurplel/install-qt-action@v4
- with:
- version: ${{ env.QT_VERSION }}
- modules: 'qtcharts'
- setup-python: 'false'
- cache: true
-
- - name: Install missing Python packages
- run: |
- python3 -m pip install pip --upgrade
- python3 -m pip install pytest
- python3 -m pip install pytest-timeout
- python3 -m pip install pytest-xdist
- python3 -m pip install psutil
-
- # TODO: disable all warnings
- - name: CMake
- run: |
- cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- env:
- CC: clang-20
- CXX: clang++-20
-
- - name: Build cppcheck
- run: |
- cmake --build cmake.output --target cppcheck -- -j $(nproc)
-
- - name: Build test
- run: |
- cmake --build cmake.output --target testrunner -- -j $(nproc)
-
- - name: Build GUI tests
- run: |
- cmake --build cmake.output --target gui-tests -- -j $(nproc)
-
- - name: Run tests
- run: ./cmake.output/bin/testrunner
-
- - name: Run cfg tests
- run: |
- cmake --build cmake.output --target checkcfg -- -j $(nproc)
-
- - name: Run CTest
- run: |
- ctest --test-dir cmake.output --output-on-failure -j$(nproc)
-
- - name: Run test/cli
- run: |
- pwd=$(pwd)
- TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
-
- - name: Run test/cli (-j2)
- run: |
- pwd=$(pwd)
- TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
- env:
- TEST_CPPCHECK_INJECT_J: 2
-
- - name: Run test/cli (--clang)
- if: false
- run: |
- pwd=$(pwd)
- TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
- env:
- TEST_CPPCHECK_INJECT_CLANG: clang
-
- - name: Run test/cli (--cppcheck-build-dir)
- run: |
- pwd=$(pwd)
- TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
- env:
- TEST_CPPCHECK_INJECT_BUILDDIR: injected
-
- - name: Generate dependencies
- if: false
- run: |
- # make sure auto-generated GUI files exist
- make -C cmake.output autogen
- make -C cmake.output gui-build-deps triage-build-ui-deps
-
- # TODO: this is currently way too slow (~60 minutes) to enable it
- # TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError
- - name: Self check
- if: false
- run: |
- selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive"
- cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
- ec=0
- ./cmake.output/bin/cppcheck $selfcheck_options externals || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json --enable=internal lib || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/dmake/*.cpp || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1
- exit $ec
diff --git a/.github/workflows/buildman.yml b/.github/workflows/buildman.yml
index b0b399dd851..e84cf4bffd9 100644
--- a/.github/workflows/buildman.yml
+++ b/.github/workflows/buildman.yml
@@ -19,7 +19,7 @@ jobs:
convert_via_pandoc:
runs-on: ubuntu-24.04
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -38,7 +38,7 @@ jobs:
with:
args: --output=output/manual-premium.pdf man/manual-premium.md
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: output
path: output
@@ -46,7 +46,7 @@ jobs:
manpage:
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -59,7 +59,7 @@ jobs:
run: |
make man
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: cppcheck.1
path: cppcheck.1
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml
index 7b462c688f0..400fb929786 100644
--- a/.github/workflows/cifuzz.yml
+++ b/.github/workflows/cifuzz.yml
@@ -10,7 +10,7 @@ permissions:
jobs:
Fuzzing:
runs-on: ubuntu-latest
- if: ${{ github.repository_owner == 'danmar' }}
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
steps:
- name: Build Fuzzers
id: build
@@ -27,7 +27,7 @@ jobs:
dry-run: false
language: c++
- name: Upload Crash
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v7
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml
index 9f854cbad6f..4f2db4ab113 100644
--- a/.github/workflows/clang-tidy.yml
+++ b/.github/workflows/clang-tidy.yml
@@ -24,10 +24,10 @@ jobs:
runs-on: ubuntu-22.04
env:
- QT_VERSION: 6.9.0
+ QT_VERSION: 6.10.0
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -43,8 +43,8 @@ jobs:
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
- sudo ./llvm.sh 20
- sudo apt-get install -y clang-tidy-20
+ sudo ./llvm.sh 22
+ sudo apt-get install -y clang-tidy-22
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
@@ -57,14 +57,14 @@ jobs:
- name: Verify clang-tidy configuration
run: |
- clang-tidy-20 --verify-config
+ clang-tidy-22 --verify-config
- name: Prepare CMake
run: |
- cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off -DWARNINGS_ARE_ERRORS=On
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_COMPILE_WARNING_AS_ERROR=On
env:
- CC: clang-20
- CXX: clang++-20
+ CC: clang-22
+ CXX: clang++-22
- name: Prepare CMake dependencies
run: |
@@ -86,7 +86,7 @@ jobs:
run: |
cmake --build cmake.output --target run-clang-tidy-csa 2> /dev/null
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: Compilation Database
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 185ebe139c6..84d37423d2e 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -33,20 +33,20 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
with:
persist-credentials: false
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@v3
+ uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Build cppcheck
if: matrix.language == 'cpp'
run: |
- make -j$(nproc) HAVE_RULES=yes cppcheck
+ make -j$(nproc) CXXOPTS="-Werror" HAVE_RULES=yes CPPCHK_GLIBCXX_DEBUG= cppcheck
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v3
+ uses: github/codeql-action/analyze@v4
diff --git a/.github/workflows/corpus.yml b/.github/workflows/corpus.yml
new file mode 100644
index 00000000000..2d9f1424fad
--- /dev/null
+++ b/.github/workflows/corpus.yml
@@ -0,0 +1,58 @@
+# 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: corpus
+
+on:
+ schedule:
+ - cron: '0 0 * * 0'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ corpus:
+ runs-on: ubuntu-22.04
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: ccache
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ runner.os }}
+
+ - name: Install missing software on ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y fdupes
+
+ - name: build testrunner
+ run: |
+ store_dir=$(pwd)/store
+ mkdir $store_dir
+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
+ make -j$(nproc) CXXOPTS="-Werror" CPPOPTS="-DSTORE_INPUT_DIR=\"\\\"$store_dir\\\"\"" testrunner
+
+ - name: run testrunner
+ run: |
+ ./testrunner -q
+
+ - name: de-duplicate files
+ run: |
+ set -x
+ ls -l ./store | wc -l
+ echo "removing duplicates"
+ fdupes -qdN ./store > /dev/null
+ ls -l ./store | wc -l
+ # print largest size
+ ls -l ./store | cut -d' ' -f5 | sort -u -n -r | head -n1
+
+ - uses: actions/upload-artifact@v7
+ if: success()
+ with:
+ name: corpus
+ path: ./store
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 3c0c8e1d1df..b5e496adcf6 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -43,7 +43,7 @@ jobs:
- name: Compile instrumented
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- make -j$(nproc) all CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes
+ make -j$(nproc) CXXOPTS="-Werror -g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes CPPCHK_GLIBCXX_DEBUG= all
- name: Run instrumented tests
run: |
@@ -57,12 +57,12 @@ jobs:
lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info
genhtml lcov.info -o coverage_report --frame --legend --demangle-cpp
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: Coverage results
path: coverage_report
- - uses: codecov/codecov-action@v4
+ - uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.xml # optional
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index 3c07b61d7c7..4c62971e4c4 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -12,9 +12,9 @@ permissions:
jobs:
scan:
runs-on: ubuntu-latest
- if: ${{ github.repository_owner == 'danmar' }}
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install missing software on ubuntu
diff --git a/.github/workflows/cppcheck-premium.yml b/.github/workflows/cppcheck-premium.yml
index 94481894c8f..b99cccd69da 100644
--- a/.github/workflows/cppcheck-premium.yml
+++ b/.github/workflows/cppcheck-premium.yml
@@ -18,21 +18,22 @@ on:
permissions:
contents: read
+ security-events: write
jobs:
build:
runs-on: ubuntu-24.04 # run on the latest image only
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
- - name: Download cppcheckpremium
+ - name: Download cppcheckpremium release
run: |
premium_version=${{ inputs.premium_version }}
if [ -z $premium_version ]; then
- premium_version=24.11.0
+ premium_version=26.3.0
#wget https://files.cppchecksolutions.com/devdrop/cppcheckpremium-$premium_version-amd64.tar.gz -O cppcheckpremium.tar.gz
wget https://files.cppchecksolutions.com/$premium_version/ubuntu-24.04/cppcheckpremium-$premium_version-amd64.tar.gz -O cppcheckpremium.tar.gz
else
@@ -44,12 +45,28 @@ jobs:
- name: Generate a license file
run: |
echo cppcheck > cppcheck.lic
- echo 251231 >> cppcheck.lic
+ echo 261231 >> cppcheck.lic
echo 80000 >> cppcheck.lic
- echo 4f8dc8e7c8bb288f >> cppcheck.lic
+ echo 4b64673f03fb6230 >> cppcheck.lic
echo path:lib >> cppcheck.lic
- name: Check
run: |
cppcheckpremium/premiumaddon --check-loc-license cppcheck.lic > cppcheck-premium-loc
- cppcheckpremium/cppcheck -j$(nproc) -D__GNUC__ -D__CPPCHECK__ --suppressions-list=cppcheckpremium-suppressions --platform=unix64 --enable=style --premium=misra-c++-2023 --premium=cert-c++-2016 --inline-suppr --error-exitcode=1 lib
+ cppcheckpremium/cppcheck --premium=safety-off -j$(nproc) -D__GNUC__ -D__CPPCHECK__ --suppressions-list=cppcheckpremium-suppressions --platform=unix64 --enable=style --premium=misra-c++-2023 --premium=cert-c++-2016 --inline-suppr lib --error-exitcode=0 --output-format=sarif 2> results.sarif
+
+ - name: Cat results
+ run: |
+ #sed -i 's|"security-severity":.*||' results.sarif
+ cat results.sarif
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: results
+ path: results.sarif
+
+ - name: Upload report
+ uses: github/codeql-action/upload-sarif@v4
+ with:
+ sarif_file: results.sarif
+ category: cppcheckpremium
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
index 8ad9408a376..4ec72f935fd 100644
--- a/.github/workflows/format.yml
+++ b/.github/workflows/format.yml
@@ -24,12 +24,12 @@ jobs:
UNCRUSTIFY_VERSION: 0.80.1
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
- name: Cache uncrustify
- uses: actions/cache@v4
+ uses: actions/cache@v5
id: cache-uncrustify
with:
path: |
@@ -50,6 +50,6 @@ jobs:
- name: Uncrustify check
run: |
- ~/uncrustify/uncrustify -c .uncrustify.cfg -l CPP --no-backup --replace */*.cpp */*.h
+ UNCRUSTIFY=~/uncrustify/uncrustify ./runformat
git diff
git diff | diff - /dev/null &> /dev/null
diff --git a/.github/workflows/gcc-versions.yml b/.github/workflows/gcc-versions.yml
new file mode 100644
index 00000000000..3402bade743
--- /dev/null
+++ b/.github/workflows/gcc-versions.yml
@@ -0,0 +1,39 @@
+# the purpose of this github action is to test that cppcheck source code can be compiled using old gcc versions.
+# the gcc images we use here are copied from the official gcc images on docker hub
+
+name: gcc-versions
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ strategy:
+ matrix:
+ #image: ["ghcr.io/cppcheck-opensource/gcc:5.4", "ghcr.io/cppcheck-opensource/gcc:6.5", "ghcr.io/cppcheck-opensource/gcc:7.5", "ghcr.io/cppcheck-opensource/gcc:8.5", "ghcr.io/cppcheck-opensource/gcc:9.5"]
+ image: ["ghcr.io/cppcheck-opensource/gcc:5.4"]
+ fail-fast: false
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: Build cppcheck
+ run: |
+ # FIXME: simplecpp-1.8.0 can't be compiled with gcc 5.4, so we can't run 'make test' now
+ #docker run --rm -v ${{ github.workspace }}:/cppcheck -w /cppcheck ${{ matrix.image }} make -j$(nproc) CXXOPTS="-Werror" test
+ docker run --rm -v ${{ github.workspace }}:/cppcheck -w /cppcheck ${{ matrix.image }} g++ -fsyntax-only -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -std=c++11 -Wno-multichar lib/*.cpp
diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml
index ae084c446f8..2e54b92541e 100644
--- a/.github/workflows/iwyu.yml
+++ b/.github/workflows/iwyu.yml
@@ -15,31 +15,31 @@ jobs:
strategy:
matrix:
- # "opensuse/tumbleweed:latest" / "fedora:latest" / "debian:unstable" / "archlinux:latest"
+ # "opensuse/tumbleweed:latest" / "fedora:rawhide" / "debian:unstable" / "archlinux:latest"
include:
- os: ubuntu-22.04
- image: "fedora:latest"
+ image: "fedora:rawhide"
stdlib: libstdc++
- os: ubuntu-22.04
- image: "fedora:latest"
+ image: "fedora:rawhide"
stdlib: libc++
- - os: macos-13
+ - os: macos-26
image: ""
stdlib: libc++ # no libstdc++ on macOS
mapping_file_opt: '-Xiwyu --mapping_file=$(realpath ./macos.imp)'
fail-fast: false
runs-on: ${{ matrix.os }}
- if: ${{ github.repository_owner == 'danmar' }}
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
container:
image: ${{ matrix.image }}
env:
- QT_VERSION: 6.9.0
+ QT_VERSION: 6.10.0
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -71,11 +71,12 @@ jobs:
- name: Install missing software on Fedora
if: contains(matrix.image, 'fedora')
run: |
- dnf install -y cmake clang pcre-devel
+ dnf install -y cmake clang
dnf install -y libglvnd-devel # fixes missing dependency for Qt in CMake
dnf install -y p7zip-plugins # required as fallback for py7zr in Qt installation
dnf install -y python3-pip # fixes missing pip module in jurplel/install-qt-action
dnf install -y python3-devel # fixes building of wheels for jurplel/install-qt-action
+ dnf install -y cairo-devel gtk3-devel libcurl-devel lua-devel openssl-devel python3-devel sqlite-devel boost-devel cppunit-devel libsigc++20-devel # for strict cfg checks
dnf install -y iwyu
ln -s iwyu_tool.py /usr/bin/iwyu_tool
@@ -96,18 +97,21 @@ jobs:
if: contains(matrix.os, 'macos')
run: |
brew install include-what-you-use pcre coreutils
- ln -s iwyu_tool.py /usr/local/bin/iwyu_tool
+ # on Apple Silicon files are symlinked under /opt/homebrew/bin
+ ln -s /opt/homebrew/bin/iwyu_tool.py /usr/local/bin/iwyu_tool
# Fails on OpenSUSE:
# Warning: Failed to restore: Tar failed with error: Unable to locate executable file: tar. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
# Also the shell is broken afterwards:
# OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown
+ #
+ # On macos-26 we need to perform the Python setup because the default installation is managed externally managed
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
- setup-python: 'false'
+ setup-python: ${{ contains(matrix.os, 'macos') }}
install-deps: false
cache: true
@@ -121,8 +125,8 @@ jobs:
- name: Prepare CMake
run: |
- # TODO: why does it build dmake in the next step?
- cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.stdlib == 'libc++' }}
+ # TODO: re-enable HAVE_RULES
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=Off -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.stdlib == 'libc++' }}
env:
CC: clang
CXX: clang++
@@ -144,17 +148,25 @@ jobs:
- name: iwyu_tool
run: |
- # -isystem/usr/lib/clang/17/include
- # TODO: remove -stdlib= - it should have been taken from the compilation database
- iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -stdlib=${{ matrix.stdlib }} ${{ matrix.mapping_file_opt }} > iwyu.log
+ iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments ${{ matrix.mapping_file_opt }} ${{ matrix.clang_inc }} > iwyu.log
+
+ # TODO: run with all configurations
+ - name: test/cfg
+ if: matrix.stdlib == 'libstdc++'
+ run: |
+ # TODO: redirect to log
+ ./test/cfg/runtests.sh
+ env:
+ IWYU: include-what-you-use
+ IWYU_CLANG_INC: ${{ matrix.clang_inc }}
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: Compilation Database (include-what-you-use - ${{ matrix.os }} ${{ matrix.stdlib }})
path: ./cmake.output/compile_commands.json
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
if: ${{ contains(matrix.os, 'macos') && (success() || failure()) }}
with:
name: macOS Mappings
@@ -162,7 +174,7 @@ jobs:
./iwyu-mapgen-apple-libc.py
./macos.imp
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: Logs (include-what-you-use - ${{ matrix.os }} ${{ matrix.stdlib }})
@@ -181,13 +193,13 @@ jobs:
fail-fast: false
runs-on: ubuntu-22.04
- if: ${{ github.repository_owner == 'danmar' }}
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
env:
- QT_VERSION: 6.9.0
+ QT_VERSION: 6.10.0
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -202,13 +214,13 @@ jobs:
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
- sudo ./llvm.sh 20
- sudo apt-get install -y clang-tools-20
+ sudo ./llvm.sh 22
+ sudo apt-get install -y clang-tools-22
- name: Install libc++
if: matrix.stdlib == 'libc++'
run: |
- sudo apt-get install -y libc++-20-dev
+ sudo apt-get install -y libc++-22-dev
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
@@ -221,11 +233,11 @@ jobs:
- name: Prepare CMake
run: |
- # TODO: why does it build dmake in the next step?
- cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.use_libcxx }}
+ # TODO: re-enable HAVE_RULES
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=Off -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.use_libcxx }}
env:
- CC: clang-20
- CXX: clang++-20
+ CC: clang-22
+ CXX: clang++-22
- name: Prepare CMake dependencies
run: |
@@ -242,15 +254,15 @@ jobs:
- name: clang-include-cleaner
run: |
# TODO: run multi-threaded
- find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-20 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1
+ find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-22 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: Compilation Database (clang-include-cleaner - ${{ matrix.stdlib }})
path: ./cmake.output/compile_commands.json
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: Logs (clang-include-cleaner - ${{ matrix.stdlib }})
diff --git a/.github/workflows/release-windows-mingw.yml b/.github/workflows/release-windows-mingw.yml
new file mode 100644
index 00000000000..8085990e39d
--- /dev/null
+++ b/.github/workflows/release-windows-mingw.yml
@@ -0,0 +1,69 @@
+# 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: release-windows-mingw
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+defaults:
+ run:
+ shell: msys2 {0}
+
+jobs:
+ # TODO: add CMake build
+ build_mingw:
+ strategy:
+ matrix:
+ # only use the latest windows-* as the installed toolchain is identical
+ os: [windows-2025]
+ fail-fast: false
+
+ runs-on: ${{ matrix.os }}
+
+ timeout-minutes: 19 # max + 3*std of the last 7K runs
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Set up MSYS2
+ uses: msys2/setup-msys2@v2
+ with:
+ release: false # use pre-installed
+ # TODO: install mingw-w64-x86_64-make and use mingw32.make instead - currently fails with "Windows Subsystem for Linux has no installed distributions."
+ install: >-
+ mingw-w64-x86_64-lld
+ make
+ mingw-w64-x86_64-gcc
+ python
+
+ - name: Build cppcheck
+ run: |
+ export PATH="/mingw64/lib/ccache/bin:$PATH"
+ # set RDYNAMIC to work around broken MinGW detection
+ make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) CXXFLAGS=-O2 MATCHCOMPILER=yes cppcheck
+
+ - name: Package
+ run: |
+ mkdir cppcheck-mingw
+ cp cppcheck.exe cppcheck-mingw/
+ cp -R cfg platforms cppcheck-mingw/
+ cp /mingw64/bin/libgcc_s_seh-1.dll cppcheck-mingw/
+ cp /mingw64/bin/libstdc*.dll cppcheck-mingw/
+ cp /mingw64/bin/libwinpthread-1.dll cppcheck-mingw/
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: cppcheck-mingw
+ path: cppcheck-mingw
diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml
index 5edbc8d6b67..aa467d7b875 100644
--- a/.github/workflows/release-windows.yml
+++ b/.github/workflows/release-windows.yml
@@ -22,18 +22,26 @@ jobs:
build:
runs-on: windows-2025
- if: ${{ github.repository_owner == 'danmar' }}
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
env:
+ PYTHON_VERSION: 3.14
# see https://www.pcre.org/original/changelog.txt
PCRE_VERSION: 8.45
- QT_VERSION: 6.9.0
+ QT_VERSION: 6.10.0
+ BOOST_MINOR_VERSION: 89
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: ${{ env.PYTHON_VERSION }}
+ check-latest: true
+
- name: Set up Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
@@ -47,28 +55,37 @@ jobs:
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
git apply --ignore-space-change ..\externals\pcre.patch || exit /b !errorlevel!
- cmake . -G "Visual Studio 17 2022" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 || exit /b !errorlevel!
- msbuild -m PCRE.sln -p:Configuration=Release -p:Platform=x64 || exit /b !errorlevel!
+ cmake . -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
+ msbuild -m PCRE.slnx -p:Configuration=Release -p:Platform=x64 || exit /b !errorlevel!
copy pcre.h ..\externals || exit /b !errorlevel!
copy Release\pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
+ - name: Download Boost
+ run: |
+ curl -fsSL https://archives.boost.io/release/1.%BOOST_MINOR_VERSION%.0/source/boost_1_%BOOST_MINOR_VERSION%_0.7z -o boost.zip || exit /b !errorlevel!
+
+ - name: Install Boost
+ run: |
+ @echo on
+ 7z x boost.zip boost_1_%BOOST_MINOR_VERSION%_0/boost || exit /b !errorlevel!
+ ren boost_1_%BOOST_MINOR_VERSION%_0 boost || exit /b !errorlevel!
+
# available modules: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-modules
# available tools: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-tools
- - name: Install Qt ${{ env.QT_VERSION }}
+ - name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
setup-python: 'false'
tools: 'tools_opensslv3_x64'
- aqtversion: '==3.1.*' # TODO: remove when aqtinstall 3.2.2 is available
# TODO: build with multiple threads
- name: Build x64 release GUI
run: |
:: TODO: enable rules?
:: specify Release build so matchcompiler is used
- cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On || exit /b !errorlevel!
+ cmake -S . -B build -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On -DUSE_BOOST=ON -DBOOST_INCLUDEDIR=%GITHUB_WORKSPACE%\boost -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
# TODO: package PDBs
@@ -78,7 +95,7 @@ jobs:
del build\bin\Release\cppcheck-gui.ilk || exit /b !errorlevel!
del build\bin\Release\cppcheck-gui.pdb || exit /b !errorlevel!
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: deploy
path: build\bin\Release
@@ -87,11 +104,12 @@ jobs:
run: python tools\matchcompiler.py --write-dir lib || exit /b !errorlevel!
# TODO: build with multiple threads
- # TODO: build with boost enabled
- name: Build CLI x64 release configuration using MSBuild
- run: msbuild -m cppcheck.sln -t:cli -p:Configuration=Release-PCRE -p:Platform=x64 || exit /b !errorlevel!
+ run: msbuild -m cppcheck.sln -t:cli -p:Configuration=Release-PCRE -p:Platform=x64 -p:HaveBoost=HAVE_BOOST -p:BoostInclude=%GITHUB_WORKSPACE%\boost || exit /b !errorlevel!
+ env:
+ _CL_: /WX
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: bin
path: bin
@@ -121,7 +139,6 @@ jobs:
@echo on
move build\bin\Release win_installer\files || exit /b !errorlevel!
copy AUTHORS win_installer\files\authors.txt || exit /b !errorlevel!
- copy readme.txt win_installer\files\ || exit /b !errorlevel!
copy win_installer\GPLv3.txt win_installer\files\ || exit /b !errorlevel!
copy externals\picojson\LICENSE win_installer\files\picojson-license.txt || exit /b !errorlevel!
copy externals\simplecpp\LICENSE win_installer\files\simplecpp-license.txt || exit /b !errorlevel!
@@ -141,7 +158,7 @@ jobs:
:: copy libcrypto-3-x64.dll and libssl-3-x64.dll
copy %RUNNER_WORKSPACE%\Qt\Tools\OpenSSLv3\Win_x64\bin\lib*.dll win_installer\files || exit /b !errorlevel!
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: collect
path: win_installer\files
@@ -156,7 +173,7 @@ jobs:
@echo ProductVersion="%PRODUCTVER%" || exit /b !errorlevel!
msbuild -m cppcheck.wixproj -p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }} || exit /b !errorlevel!
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: installer
path: win_installer/Build/
@@ -192,7 +209,7 @@ jobs:
del win_installer\files\Qt6Svg.dll || exit /b !errorlevel!
del win_installer\files\vc_redist.x64.exe || exit /b !errorlevel!
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: portable
path: win_installer\files
diff --git a/.github/workflows/ubsan.yml b/.github/workflows/sanitizers.yml
similarity index 63%
rename from .github/workflows/ubsan.yml
rename to .github/workflows/sanitizers.yml
index 5720cbf35d5..6021d1237d2 100644
--- a/.github/workflows/ubsan.yml
+++ b/.github/workflows/sanitizers.yml
@@ -1,6 +1,6 @@
# 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: undefined behaviour sanitizers
+name: sanitizers
on:
push:
@@ -18,28 +18,51 @@ permissions:
jobs:
build:
+ strategy:
+ matrix:
+ include:
+ - sanitizer: 'asan'
+ cmake_opts: '-DANALYZE_ADDRESS=On'
+ run_ctest: true
+ inject_executor: 'process'
+ run_selfcheck: false # TODO: this is currently way too slow (~60 minutes) to enable it
+ - sanitizer: 'tsan'
+ cmake_opts: '-DANALYZE_THREAD=On'
+ run_ctest: false # TODO: test-filelist fails with data race in pthread_cond_destroy
+ inject_executor: 'thread'
+ run_selfcheck: false # TODO: disabled for now as it takes around 40 minutes to finish
+ selfcheck_opts: '--executor=thread --error-exitcode=0' # set --error-exitcode=0 so we only fail on sanitizer issues - since it uses threads for execution it will exit the whole process on the first issue
+ - sanitizer: 'ubsan'
+ cmake_opts: '-DANALYZE_UNDEFINED=On'
+ run_ctest: true
+ inject_executor: 'process'
+ run_selfcheck: true
+ fail-fast: false
+
runs-on: ubuntu-22.04
env:
- QT_VERSION: 6.9.0
+ QT_VERSION: 6.10.0
+ ASAN_OPTIONS: detect_stack_use_after_return=1
+ TSAN_OPTIONS: halt_on_error=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:report_error_type=1
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
- key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
+ key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.sanitizer }}
- - name: Set up Python 3.13
- uses: actions/setup-python@v5
+ - name: Set up Python
+ uses: actions/setup-python@v6
with:
- python-version: '3.13'
+ python-version: '3.14'
check-latest: true
- name: Install missing software on ubuntu
@@ -53,7 +76,7 @@ jobs:
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
- sudo ./llvm.sh 20
+ sudo ./llvm.sh 22
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
@@ -71,13 +94,12 @@ jobs:
python3 -m pip install pytest-xdist
python3 -m pip install psutil
- # TODO: disable warnings
- name: CMake
run: |
- cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify ${{ matrix.cmake_opts }} -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
- CC: clang-20
- CXX: clang++-20
+ CC: clang-22
+ CXX: clang++-22
- name: Build cppcheck
run: |
@@ -92,13 +114,14 @@ jobs:
cmake --build cmake.output --target gui-tests -- -j $(nproc)
- name: Run tests
- run: ./cmake.output/bin/testrunner
+ run: ./cmake.output/bin/testrunner -t
- name: Run cfg tests
run: |
cmake --build cmake.output --target checkcfg -- -j $(nproc)
- name: Run CTest
+ if: matrix.run_ctest
run: |
ctest --test-dir cmake.output --output-on-failure -j$(nproc)
@@ -106,6 +129,8 @@ jobs:
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
+ env:
+ TEST_CPPCHECK_INJECT_EXECUTOR: ${{ matrix.inject_executor }}
- name: Run test/cli (-j2)
run: |
@@ -130,6 +155,7 @@ jobs:
TEST_CPPCHECK_INJECT_BUILDDIR: injected
- name: Generate dependencies
+ if: matrix.run_selfcheck
run: |
# make sure auto-generated GUI files exist
make -C cmake.output autogen
@@ -137,14 +163,6 @@ jobs:
# TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError
- name: Self check
+ if: matrix.run_selfcheck
run: |
- selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive"
- cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
- ec=0
- ./cmake.output/bin/cppcheck $selfcheck_options externals || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json --enable=internal lib || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/dmake/*.cpp || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1
- exit $ec
+ ./selfcheck_san.sh ./cmake.output ${{ matrix.selfcheck_opts }}
diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml
index a02b8c09dc8..8cee3c5a5b4 100644
--- a/.github/workflows/scriptcheck.yml
+++ b/.github/workflows/scriptcheck.yml
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -31,7 +31,7 @@ jobs:
key: ${{ github.workflow }}-${{ runner.os }}
- name: Cache Cppcheck
- uses: actions/cache@v4
+ uses: actions/cache@v5
with:
path: cppcheck
key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }}
@@ -39,7 +39,7 @@ jobs:
- name: build cppcheck
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- make -j$(nproc) -s CXXFLAGS="-w"
+ make -j$(nproc) CXXOPTS="-Werror"
strip -s ./cppcheck
scriptcheck:
@@ -48,27 +48,27 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
- python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13']
+ python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13', '3.14']
include:
- - python-version: '3.13'
+ - python-version: '3.14'
python-latest: true
fail-fast: false
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
# TODO: bailout on error
- name: Restore Cppcheck
- uses: actions/cache@v4
+ uses: actions/cache@v5
with:
path: cppcheck
key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }}
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v5
+ uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -87,7 +87,7 @@ jobs:
python -m pip install pip --upgrade
python -m pip install natsort
python -m pip install pexpect
- python -m pip install 'pylint<=3.3.0'
+ python -m pip install 'pylint<4.1.0'
python -m pip install unittest2
python -m pip install pytest
python -m pip install pytest-xdist
@@ -203,19 +203,19 @@ jobs:
dmake:
strategy:
matrix:
- os: [ubuntu-22.04, macos-13, windows-2025]
+ os: [ubuntu-22.04, macos-15, windows-2025]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
- name: run dmake
run: |
- make -j3 CXXFLAGS="-w" run-dmake
+ make -j3 CXXOPTS="-Werror" run-dmake
- name: check diff
run: |
diff --git a/.github/workflows/selfcheck.yml b/.github/workflows/selfcheck.yml
index 8e0c3859522..f16ce8d8332 100644
--- a/.github/workflows/selfcheck.yml
+++ b/.github/workflows/selfcheck.yml
@@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-22.04
env:
- QT_VERSION: 6.9.0
+ QT_VERSION: 6.10.0
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -56,7 +56,7 @@ jobs:
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
# valgrind cannot handle DWARF 5 yet so force version 4
# work around performance regression with -inline-deferral
- make -j$(nproc) -s CXXFLAGS="-O2 -w -DHAVE_BOOST -gdwarf-4 -mllvm -inline-deferral" MATCHCOMPILER=yes
+ make -j$(nproc) CXXOPTS="-Werror -O2 -gdwarf-4" CPPOPTS="-DHAVE_BOOST -mllvm -inline-deferral" MATCHCOMPILER=yes CPPCHK_GLIBCXX_DEBUG=
env:
CC: clang-14
CXX: clang++-14
@@ -64,7 +64,7 @@ jobs:
# unusedFunction - start
- name: CMake
run: |
- cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On
+ cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=ON -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off
- name: Generate dependencies
run: |
@@ -76,11 +76,10 @@ jobs:
# make sure the auto-generated GUI dependencies exist
make -C cmake.output gui-build-deps
- # TODO: find a way to report unmatched suppressions without need to add information checks
- name: Self check (unusedFunction)
if: false # TODO: fails with preprocessorErrorDirective - see #10667
run: |
- ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
+ ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
env:
DISABLE_VALUEFLOW: 1
UNUSEDFUNCTION_ONLY: 1
@@ -91,7 +90,7 @@ jobs:
# unusedFunction notest - start
- name: CMake (no test)
run: |
- cmake -S . -B cmake.output.notest -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DBUILD_TRIAGE=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On
+ cmake -S . -B cmake.output.notest -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_GUI=ON -DBUILD_TRIAGE=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off
- name: Generate dependencies (no test)
run: |
@@ -102,10 +101,9 @@ jobs:
# make sure the auto-generated GUI dependencies exist
make -C cmake.output.notest gui-build-deps
- # TODO: find a way to report unmatched suppressions without need to add information checks
- name: Self check (unusedFunction / no test)
run: |
- ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.notest/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
+ ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
env:
DISABLE_VALUEFLOW: 1
UNUSEDFUNCTION_ONLY: 1
@@ -114,17 +112,34 @@ jobs:
# unusedFunction notest nogui - start
- name: CMake (no test / no gui)
run: |
- cmake -S . -B cmake.output.notest_nogui -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DENABLE_CHECK_INTERNAL=On
+ cmake -S . -B cmake.output.notest_nogui -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=Off -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off
- name: Generate dependencies (no test / no gui)
run: |
# make sure the precompiled headers exist
make -C cmake.output.notest_nogui lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx
- # TODO: find a way to report unmatched suppressions without need to add information checks
- name: Self check (unusedFunction / no test / no gui)
run: |
- ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib -D__CPPCHECK__ -D__GNUC__ --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.notest_nogui/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
+ echo '
+
+
+ unusedFunction
+ lib/errorlogger.h
+ verboseMessage
+
+
+ unusedFunction
+ lib/importproject.cpp
+ selectVsConfigurations
+
+
+ unusedFunction
+ lib/importproject.cpp
+ getVSConfigs
+
+ ' > supprs.xml
+ ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib -D__CPPCHECK__ -D__GNUC__ --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nogui/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr --suppress-xml=supprs.xml
env:
DISABLE_VALUEFLOW: 1
UNUSEDFUNCTION_ONLY: 1
@@ -133,7 +148,7 @@ jobs:
# unusedFunction notest nocli - start
- name: CMake (no test / no cli)
run: |
- cmake -S . -B cmake.output.notest_nocli -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_CLI=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On
+ cmake -S . -B cmake.output.notest_nocli -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=ON -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off
- name: Generate dependencies (no test / no cli)
run: |
@@ -144,24 +159,42 @@ jobs:
# make sure the auto-generated GUI dependencies exist
make -C cmake.output.notest_nocli gui-build-deps
- # TODO: find a way to report unmatched suppressions without need to add information checks
- name: Self check (unusedFunction / no test / no cli)
if: false # TODO: the findings are currently too intrusive
run: |
- ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.notest_nocli/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
+ ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nocli/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
env:
DISABLE_VALUEFLOW: 1
UNUSEDFUNCTION_ONLY: 1
# unusedFunction notest nocli - end
+ # unusedFunction notest nocli nogui - start
+ - name: CMake (no test / no cli / no gui)
+ run: |
+ cmake -S . -B cmake.output.notest_nocli_nogui -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=Off -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off
+
+ - name: Generate dependencies (no test / no cli / no gui)
+ run: |
+ # make sure the precompiled headers exist
+ make -C cmake.output.notest_nocli_nogui lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx
+
+ - name: Self check (unusedFunction / no test / no cli / no gui)
+ if: false # TODO: the findings are currently too intrusive
+ run: |
+ ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nocli_nogui/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
+ env:
+ DISABLE_VALUEFLOW: 1
+ UNUSEDFUNCTION_ONLY: 1
+ # unusedFunction notest nocli nogui - end
+
- name: Fetch corpus
run: |
- wget https://github.com/danmar/cppcheck/archive/refs/tags/2.8.tar.gz
+ wget https://github.com/cppcheck-opensource/cppcheck/archive/refs/tags/2.8.tar.gz
tar xvf 2.8.tar.gz
- name: CMake (corpus / no test)
run: |
- cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_POLICY_VERSION_MINIMUM=3.5
+ cmake -S cppcheck-2.8 -B cmake.output.corpus -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5
- name: Generate dependencies (corpus)
run: |
@@ -172,18 +205,30 @@ jobs:
# make sure the auto-generated GUI dependencies exist
make -C cmake.output.corpus gui-build-deps
- # TODO: find a way to report unmatched suppressions without need to add information checks
- name: Self check (unusedFunction / corpus / no test / callgrind)
run: |
# TODO: fix -rp so the suppressions actually work
- valgrind --tool=callgrind ./cppcheck --template=selfcheck --error-exitcode=0 --library=cppcheck-lib --library=qt -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.corpus/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr 2>callgrind.log || (cat callgrind.log && false)
+ valgrind --tool=callgrind ./cppcheck --template=selfcheck --error-exitcode=0 --library=cppcheck-lib --library=qt -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.corpus/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr 2>callgrind.log || (cat callgrind.log && false)
cat callgrind.log
callgrind_annotate --auto=no > callgrind.annotated.log
head -50 callgrind.annotated.log
env:
DISABLE_VALUEFLOW: 1
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: Callgrind Output
path: ./callgrind.*
+
+ - name: Self check (unusedFunction / corpus / no test / memcheck)
+ run: |
+ # TODO: fix -rp so the suppressions actually work
+ valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./cppcheck --template=selfcheck --error-exitcode=0 --library=cppcheck-lib --library=qt -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.corpus/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr 9>memcheck.log || (cat memcheck.log && false)
+ cat memcheck.log
+ env:
+ DISABLE_VALUEFLOW: 1
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: Memcheck Output
+ path: ./memcheck.*
diff --git a/.github/workflows/tsan.yml b/.github/workflows/tsan.yml
deleted file mode 100644
index 2f6b1ef38e0..00000000000
--- a/.github/workflows/tsan.yml
+++ /dev/null
@@ -1,156 +0,0 @@
-# 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: thread sanitizer
-
-on:
- push:
- branches:
- - 'main'
- - 'releases/**'
- - '2.*'
- tags:
- - '2.*'
- pull_request:
-
-permissions:
- contents: read
-
-jobs:
- build:
-
- runs-on: ubuntu-22.04
-
- env:
- QT_VERSION: 6.9.0
- TSAN_OPTIONS: halt_on_error=1
- # TODO: figure out why there are cache misses with PCH enabled
- CCACHE_SLOPPINESS: pch_defines,time_macros
-
- steps:
- - uses: actions/checkout@v4
- with:
- persist-credentials: false
-
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
-
- - name: Set up Python 3.13
- uses: actions/setup-python@v5
- with:
- python-version: '3.13'
- check-latest: true
-
- - name: Install missing software on ubuntu
- run: |
- sudo apt-get update
- sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils
- sudo apt-get install -y libcups2-dev # required for Qt6PrintSupport in CMake since Qt 6.7.3
-
- - name: Install clang
- run: |
- sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
- wget https://apt.llvm.org/llvm.sh
- chmod +x llvm.sh
- sudo ./llvm.sh 20
-
- - name: Install Qt ${{ env.QT_VERSION }}
- uses: jurplel/install-qt-action@v4
- with:
- version: ${{ env.QT_VERSION }}
- modules: 'qtcharts'
- setup-python: 'false'
- cache: true
-
- - name: Install missing Python packages
- run: |
- python3 -m pip install pip --upgrade
- python3 -m pip install pytest
- python3 -m pip install pytest-timeout
- python3 -m pip install pytest-xdist
- python3 -m pip install psutil
-
- - name: CMake
- run: |
- cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=Off -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- env:
- CC: clang-20
- CXX: clang++-20
-
- - name: Build cppcheck
- run: |
- cmake --build cmake.output --target cppcheck -- -j $(nproc)
-
- - name: Build test
- run: |
- cmake --build cmake.output --target testrunner -- -j $(nproc)
-
- - name: Build GUI tests
- run: |
- cmake --build cmake.output --target gui-tests -- -j $(nproc)
-
- - name: Run tests
- run: ./cmake.output/bin/testrunner
-
- - name: Run cfg tests
- run: |
- cmake --build cmake.output --target checkcfg -- -j $(nproc)
-
- - name: Run CTest
- if: false # TODO: test-filelist fails with data race in pthread_cond_destroy
- run: |
- ctest --test-dir cmake.output --output-on-failure -j$(nproc)
-
- - name: Run test/cli
- run: |
- pwd=$(pwd)
- TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
- env:
- TEST_CPPCHECK_INJECT_EXECUTOR: thread
-
- - name: Run test/cli (-j2)
- run: |
- pwd=$(pwd)
- TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
- env:
- TEST_CPPCHECK_INJECT_J: 2
-
- - name: Run test/cli (--clang)
- if: false
- run: |
- pwd=$(pwd)
- TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
- env:
- TEST_CPPCHECK_INJECT_CLANG: clang
-
- - name: Run test/cli (--cppcheck-build-dir)
- run: |
- pwd=$(pwd)
- TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
- env:
- TEST_CPPCHECK_INJECT_BUILDDIR: injected
-
- - name: Generate dependencies
- if: false
- run: |
- # make sure auto-generated GUI files exist
- make -C cmake.output autogen
- make -C cmake.output gui-build-deps triage-build-ui-deps
-
- # TODO: disabled for now as it takes around 40 minutes to finish
- # set --error-exitcode=0 so we only fail on sanitizer issues - since it uses threads for execution it will exit the whole process on the first issue
- - name: Self check
- if: false
- run: |
- selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=0 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive"
- selfcheck_options="$selfcheck_options --executor=thread"
- cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
- ec=0
- ./cmake.output/bin/cppcheck $selfcheck_options externals || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json --enable=internal lib || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/dmake/*.cpp || ec=1
- ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1
- exit $ec
diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml
index 7fd16382802..25ef4dd63a2 100644
--- a/.github/workflows/valgrind.yml
+++ b/.github/workflows/valgrind.yml
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
persist-credentials: false
@@ -41,24 +41,30 @@ jobs:
- name: Build cppcheck
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) HAVE_RULES=yes MATCHCOMPILER=yes
+ make -j$(nproc) CXXOPTS="-Werror -O1 -g" CPPOPTS="-DHAVE_BOOST" HAVE_RULES=yes MATCHCOMPILER=yes CPPCHK_GLIBCXX_DEBUG=
- name: Build test
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) testrunner HAVE_RULES=yes MATCHCOMPILER=yes
+ make -j$(nproc) CXXOPTS="-Werror -O1 -g" CPPOPTS="-DHAVE_BOOST" HAVE_RULES=yes MATCHCOMPILER=yes CPPCHK_GLIBCXX_DEBUG= testrunner
- name: Run valgrind
run: |
ec=0
- valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate 9>memcheck.log || ec=1
+ # disabled all tests invoking processes because the child processes fail with still reachable memory.
+ # some of the TestProcessExecutor* tests are also extremely slow.
+ excluded_tests="TestProcessExecutorFS \
+ TestProcessExecutorFiles \
+ TestSuppressions::suppressionsSettingsProcessesFiles \
+ TestSuppressions::suppressionsSettingsProcessesFS"
+ valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all -s --log-fd=9 --error-exitcode=42 ./testrunner -t -x $excluded_tests 9>memcheck.log || ec=1
cat memcheck.log
exit $ec
# TODO: debuginfod.ubuntu.com is currently not responding to any requests causing it to run into a 40(!) minute timeout
#env:
# DEBUGINFOD_URLS: https://debuginfod.ubuntu.com
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: Logs
diff --git a/.gitignore b/.gitignore
index a3e8838d5f6..a821204bf2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
*.bak
*.gcno
+*.gch
*.o
+*.a
*.pyc
/cppcheck
/cppcheck.exe
@@ -15,6 +17,7 @@ tags
tools/daca2*.html
tools/errmsg
tools/extracttests
+.DS_Store
# dump files generated by Cppcheck
*.*.dump
@@ -125,4 +128,4 @@ stage
# PCRE Windows files
/externals/pcre.h
-/externals/pcre64.lib
\ No newline at end of file
+/externals/pcre64.lib
diff --git a/.pylintrc b/.pylintrc
index 9b14fa2d00e..0ca3480c06f 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -63,4 +63,3 @@ reports=no
ignored-classes=SQLObject,_socketobject
[MASTER]
init-hook='import sys; sys.path.append("./addons")'
-suggestion-mode=yes
diff --git a/.selfcheck_suppressions b/.selfcheck_suppressions
index 6a00f33655f..63d33fd2704 100644
--- a/.selfcheck_suppressions
+++ b/.selfcheck_suppressions
@@ -1,28 +1,69 @@
missingIncludeSystem
-
-# temporary suppressions - fix the warnings!
-simplifyUsing:lib/valueptr.h
-varid0:gui/projectfile.cpp
-naming-privateMemberVariable:gui/test/cppchecklibrarydata/testcppchecklibrarydata.h
-symbolDatabaseWarning:*/moc_*.cpp
-simplifyUsing:*/moc_*.cpp
+# should not be reported - see #13387
+checkersReport
# warnings in Qt generated code we cannot fix
-funcArgNamesDifferent:*/moc_*.cpp
-naming-varname:*/ui_*.h
-functionStatic:*/ui_fileview.h
+funcArgNamesDifferentUnnamed:*/moc_aboutdialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_applicationdialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_applicationlist.cpp
+funcArgNamesDifferent:*/moc_checkthread.cpp
+funcArgNamesDifferentUnnamed:*/moc_checkthread.cpp
+funcArgNamesDifferentUnnamed:*/moc_codeeditor.cpp
+funcArgNamesDifferent:*/moc_codeeditstylecontrols.cpp
+funcArgNamesDifferentUnnamed:*/moc_codeeditstylecontrols.cpp
+funcArgNamesDifferentUnnamed:*/moc_compliancereportdialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_codeeditstyledialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_fileviewdialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_helpdialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_libraryaddfunctiondialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_librarydialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_libraryeditargdialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_mainwindow.cpp
+funcArgNamesDifferentUnnamed:*/moc_newsuppressiondialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_platforms.cpp
+funcArgNamesDifferentUnnamed:*/moc_projectfile.cpp
+funcArgNamesDifferentUnnamed:*/moc_projectfiledialog.cpp
+funcArgNamesDifferent:*/moc_resultstree.cpp
+funcArgNamesDifferentUnnamed:*/moc_resultstree.cpp
+funcArgNamesDifferent:*/moc_resultsview.cpp
+funcArgNamesDifferentUnnamed:*/moc_resultsview.cpp
+funcArgNamesDifferentUnnamed:*/moc_scratchpad.cpp
+funcArgNamesDifferentUnnamed:*/moc_settingsdialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_statsdialog.cpp
+funcArgNamesDifferentUnnamed:*/moc_testcppchecklibrarydata.cpp
+funcArgNamesDifferentUnnamed:*/moc_testfilelist.cpp
+funcArgNamesDifferentUnnamed:*/moc_testprojectfile.cpp
+funcArgNamesDifferentUnnamed:*/moc_testresultstree.cpp
+funcArgNamesDifferentUnnamed:*/moc_testtranslationhandler.cpp
+funcArgNamesDifferentUnnamed:*/moc_testxmlreportv2.cpp
+funcArgNamesDifferentUnnamed:*/moc_threaddetails.cpp
+funcArgNamesDifferent:*/moc_threadhandler.cpp
+funcArgNamesDifferentUnnamed:*/moc_threadhandler.cpp
+funcArgNamesDifferent:*/moc_threadresult.cpp
+funcArgNamesDifferentUnnamed:*/moc_threadresult.cpp
+funcArgNamesDifferentUnnamed:*/moc_translationhandler.cpp
+funcArgNamesDifferentUnnamed:*/moc_txtreport.cpp
+naming-varname:*/gui/ui_*.h
+functionStatic:*/gui/ui_*.h
# --debug-warnings suppressions
valueFlowBailout
valueFlowBailoutIncompleteVar
-autoNoType
+valueFlowMaxIterations:gui/resultstree.cpp
+autoNoType:externals/simplecpp/simplecpp.cpp
+autoNoType:cli/*.cpp
+autoNoType:lib/*.cpp
+autoNoType:lib/library.h
+autoNoType:gui/*.cpp
+autoNoType:test/*.cpp
+autoNoType:tools/triage/mainwindow.cpp
# ticket 11631
templateInstantiation:test/testutils.cpp
naming-varname:externals/simplecpp/simplecpp.h
naming-privateMemberVariable:externals/simplecpp/simplecpp.h
-
-valueFlowMaxIterations:externals/tinyxml2/tinyxml2.cpp
+# false positive; lambda captures its owner
+danglingLifetime:externals/simplecpp/simplecpp.h:505
# TODO: these warnings need to be addressed upstream
uninitMemberVar:externals/tinyxml2/tinyxml2.h
@@ -31,8 +72,12 @@ missingOverride:externals/tinyxml2/tinyxml2.h
invalidPrintfArgType_sint:externals/tinyxml2/tinyxml2.h
naming-privateMemberVariable:externals/tinyxml2/tinyxml2.h
functionStatic:externals/tinyxml2/tinyxml2.cpp
-invalidPrintfArgType_uint:externals/tinyxml2/tinyxml2.cpp
funcArgNamesDifferent:externals/tinyxml2/tinyxml2.cpp
+funcArgNamesDifferentUnnamed:externals/tinyxml2/tinyxml2.cpp
+funcArgNamesDifferentUnnamed:externals/tinyxml2/tinyxml2.h
nullPointerRedundantCheck:externals/tinyxml2/tinyxml2.cpp
knownConditionTrueFalse:externals/tinyxml2/tinyxml2.cpp
useStlAlgorithm:externals/simplecpp/simplecpp.cpp
+funcArgNamesDifferentUnnamed:externals/simplecpp/simplecpp.h
+missingMemberCopy:externals/simplecpp/simplecpp.h
+shadowFunction:externals/simplecpp/simplecpp.h
diff --git a/.selfcheck_unused_suppressions b/.selfcheck_unused_suppressions
index ce685d8ab10..5da7c225dfa 100644
--- a/.selfcheck_unused_suppressions
+++ b/.selfcheck_unused_suppressions
@@ -1,8 +1,8 @@
+# should not be reported - see #13387
+checkersReport
+
# we are not using all methods of their interfaces
unusedFunction:externals/*/*
-# usage is disabled
-unusedFunction:lib/symboldatabase.cpp
-
# Q_OBJECT functions which are not called in our code
unusedFunction:cmake.output.notest/gui/cppcheck-gui_autogen/*/moc_aboutdialog.cpp
diff --git a/AUTHORS b/AUTHORS
index b0927e9d2e1..e804ab53e16 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,7 @@
The cppcheck team, in alphabetical order:
0x41head
+Aaron Danen
Abhijit Sawant
Abhishek Bharadwaj
Abigail Buccaneer
@@ -22,6 +23,8 @@ Alexey Eryomenko
Alexey Zhikhartsev
Alfi Maulana
Ali Can Demiralp
+Alvin Che-Chia Chang
+Allen Winter
Alon Alexander
Alon Liberman
Ameen Ali
@@ -32,6 +35,7 @@ Andreas Lutsch
Andreas Pokorny
Andreas Rönnquist
Andreas Vollenweider
+Andreas Wilhelm
Andrei Karas
Andrew C Aitchison
Andrew C. Martin
@@ -79,6 +83,7 @@ Carlos Gomes Martinho
Carl-Oskar Larsson
Cary Converse
Cary R
+Caspar Kielwein
Changkyoon Kim
Chris Lalancette
Christian Ehrlicher
@@ -96,6 +101,7 @@ daisuke-chiba
Daniel Friedrich
David Korczynski
Daniel Marjamäki
+Daschle Newberry
David Hallas
David Korth
Dávid Slivka
@@ -103,6 +109,7 @@ Debrard Sebastien
Deepak Gupta
Degen's Regens
dencat
+Devansh Varshney
Diego de las Heras
Dirk Jagdmann
Dirk Mueller
@@ -128,14 +135,18 @@ Felipe Pena
Felix Faber
Felix Geyer
Felix Passenberg
+Felix Patschkowski
Felix Wolff
+Florian Mueller
Florin Iucha
+flovent
Francesc Elies
François Berder
Frank Winklmeier
Frank Zingsheim
Frederik Schwarzer
fu7mu4
+Gaël Bonithon
Galimov Albert
Garrett Bodily
Gary Leutheuser
@@ -148,7 +159,9 @@ Gerhard Zlabinger
Gerik Rhoden
Gianfranco Costamagna
Gianluca Scacco
+Gilmar Santos Jr
Gleydson Soares
+Goncalo Mao-Cheia
Goran Džaferi
Graham Whitted
Greg Hewgill
@@ -186,7 +199,9 @@ Jesse Boswell
Jim Kuhn
Jim Zhou
jlguardi
+Joel Johnson
Johan Bertrand
+Johan Crone
Johan Samuelson
John Marshall
John-Paul Ore
@@ -195,6 +210,7 @@ Jonathan Clohessy
Jonathan Haehne
Jonathan Neuschäfer
Jonathan Thackray
+Jonny Paton
José Martins
Jose Roquette
Joshua Beck
@@ -214,6 +230,7 @@ Ketil Skjerve
Kevin Christian
Kevin Kendzia
Kimmo Varis
+Kitsios Konstantinos
Kleber Tarcísio
Konrad Grochowski
Konrad Windszus
@@ -224,6 +241,7 @@ Lars Even Almaas
larudwer
Lau bakman
Lauri Nurmi
+Leander Schulten
Leandro Lisboa Penz
Leila F. Rahman
Lena Herscheid
@@ -236,6 +254,7 @@ Ludvig Gunne Lindström
Luis Díaz Más
Luís Pereira
Lukas Grützmacher
+Lukas Hiesmayr
Lukasz Czajczyk
Łukasz Jankowski
Luxon Jean-Pierre
@@ -243,6 +262,7 @@ Maarten van der Schrieck
Maksim Derbasov
Malcolm Parsons
Marc-Antoine Perennou
+Marcel Petrick
Marcel Raad
Marco Trevisan
Marek Zmysłowski
@@ -269,6 +289,7 @@ Matthias Schmieder
Matt Johnson
Maurice Gilden
Mavik
+Melroy van den Berg
Michael Drake
Michael Løiten
Miika-Petteri Matikainen
@@ -291,6 +312,7 @@ Nicolás Alvarez
Nicolas Le Cam
Nilesh Kumar
Ogawa KenIchi
+Ola Söder
Oleksandr Labetskyi
Oleksandr Redko
Oliver Schode
@@ -313,6 +335,7 @@ Philip Chimento
Philipp Kloke
Pierre Schweitzer
Pieter Duchi
+Piotr Idzik
Pino Toscano
Pranav Khanna
Radek Jarecki
@@ -321,6 +344,7 @@ Ramzan Bekbulatov
Raphael Geissert
Razvan Ioan Alexe
Reijo Tomperi
+Reshma V Kumar
Rainer Wiesenfarth
Riccardo Ghetta
Richard A. Smith
@@ -332,6 +356,7 @@ Robert Habrich
Robert Morin
Roberto Martelloni
Robert Reif
+Robin Getz
rofl0r
Roman Zaytsev Borisovich
Ronald Hiemstra
@@ -347,6 +372,7 @@ Samuel Degrande
Samuel Poláček
Sandeep Dutta
Savvas Etairidis
+Sayed Kaif
Scott Ehlert
Scott Furry
Seafarix Ltd.
@@ -400,9 +426,11 @@ Tobias Weibel
Tomasz Kłoczko
Tom Pollok
Tomo Dote
+Tommy Bergman
Toralf Förster
Troshin V.S.
Tyson Nottingham
+Usman Majid
Valentin Batz
Valerii Lashmanov
Vasily Maslyukov
@@ -411,9 +439,12 @@ Vesa Pikki
Ville-Pekka Vahteala
Ville Skyttä
Vincent Le Garrec
+Vít Kučera
Vladimir Petrigo
Wang Haoyu
+Wang Yang
WenChung Chiu
+William Jakobsson
Wolfgang Stöggl
x29a
XhmikosR
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a47d5fc6257..b5857a8413a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 3.13)
-project(Cppcheck VERSION 2.17.99 LANGUAGES CXX)
+cmake_minimum_required(VERSION 3.22)
+project(Cppcheck VERSION 2.21.99 LANGUAGES CXX)
include(cmake/options.cmake)
@@ -11,11 +11,13 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(GNUInstallDirs)
+include(CTest)
include(cmake/compilerCheck.cmake)
include(cmake/versions.cmake)
include(cmake/findDependencies.cmake)
include(cmake/compileroptions.cmake)
+include(cmake/includechecks.cmake)
include(cmake/compilerDefinitions.cmake)
include(cmake/buildFiles.cmake)
if(BUILD_GUI)
@@ -47,11 +49,13 @@ if(LIBXML2_XMLLINT_EXECUTABLE)
add_dependencies(validatePlatforms validatePlatforms-${platformname})
endforeach()
- add_custom_target(errorlist-xml $ --errorlist > ${CMAKE_BINARY_DIR}/errorlist.xml
- DEPENDS cppcheck)
+ if(TARGET cppcheck)
+ add_custom_target(errorlist-xml $ --errorlist > ${CMAKE_BINARY_DIR}/errorlist.xml
+ DEPENDS cppcheck)
- add_custom_target(example-xml $ --xml --enable=all --inconclusive --max-configs=1 ${CMAKE_SOURCE_DIR}/samples 2> ${CMAKE_BINARY_DIR}/example.xml
- DEPENDS cppcheck)
+ add_custom_target(example-xml $ --xml --enable=all --inconclusive --max-configs=1 ${CMAKE_SOURCE_DIR}/samples 2> ${CMAKE_BINARY_DIR}/example.xml
+ DEPENDS cppcheck)
+ endif()
add_custom_target(createXMLExamples DEPENDS errorlist-xml example-xml)
@@ -75,10 +79,6 @@ endif()
# - Cygwin handling
# - MinGW handling
-if(BUILD_TESTS)
- enable_testing()
-endif()
-
add_custom_target(copy_cfg ALL
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/cfg"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/cfg"
@@ -90,9 +90,16 @@ add_custom_target(copy_addons ALL
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/addons"
COMMENT "Copying addons files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
+add_custom_target(remove_unsigned_platforms ALL
+ ${CMAKE_COMMAND} -E remove -f
+ "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/platforms/unix32-unsigned.xml"
+ "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/platforms/unix64-unsigned.xml"
+ COMMENT "Removing unsigned platforms files from ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
+
add_custom_target(copy_platforms ALL
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/platforms"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/platforms"
+ DEPENDS remove_unsigned_platforms
COMMENT "Copying platforms files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
if(USE_BUNDLED_TINYXML2)
@@ -100,7 +107,9 @@ if(USE_BUNDLED_TINYXML2)
add_subdirectory(externals/tinyxml2)
endif()
add_subdirectory(externals/simplecpp)
+add_subdirectory(externals/picojson)
add_subdirectory(lib) # CppCheck Library
+add_subdirectory(frontend)
add_subdirectory(cli) # Client application
add_subdirectory(test) # Tests
add_subdirectory(gui) # Graphical application
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e80e4a3b581..09e88f021e2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,7 +6,7 @@ These are some guidelines *any* contributor should follow. They will help to mak
## Code Changes
-Code contributions are handled via GitHub pull requests: https://github.com/danmar/cppcheck/pulls.
+Code contributions are handled via GitHub pull requests: https://github.com/cppcheck-opensource/cppcheck/pulls.
If you file a pull request you might not get a reply immediately. We are a very small team and it might not fit in the current scope or time.
@@ -18,7 +18,7 @@ Also after you filed a pull request please be ready to reply to questions and fe
Please do not be discouraged if your change was rejected or if the review process might not have been as smooth as it could have been.
-Each change should be accompanied with a unit ([C++](https://github.com/danmar/cppcheck/tree/main/test)) or integration ([Python](https://github.com/danmar/cppcheck/tree/main/test/cli)) test to ensure that it doesn't regress with future changes. Negative tests (testing the opposite behavior) would be favorable but might not be required or might already exist depending on the change. Tests which introduce `TODO_ASSERT_` or `@pytest.mark.skip`/`@pytest.mark.xfail` should have tickets filed.
+Each change should be accompanied with a unit ([C++](https://github.com/cppcheck-opensource/cppcheck/tree/main/test)) or integration ([Python](https://github.com/cppcheck-opensource/cppcheck/tree/main/test/cli)) test to ensure that it doesn't regress with future changes. Negative tests (testing the opposite behavior) would be favorable but might not be required or might already exist depending on the change. Tests which introduce `TODO_ASSERT_` or `@pytest.mark.skip`/`@pytest.mark.xfail` should have tickets filed.
If the change is modifying existing behavior (i.e. adding a feature or fixing a bug) it should be accompanied by an issue in the [tracker](https://trac.cppcheck.net) (if you do not have access we can assist with that). Depending on the change it might also warrant an entry in `releasenotes.txt`.
@@ -34,6 +34,8 @@ Note: Usually you can run the CI on your own fork to verify that it passes befor
Cppcheck is tracking its issues at https://trac.cppcheck.net.
+The tickets are not really prioritized (except for non-synthetic crashing issues) but of most interest are the following types of tickets.
+
[False Positives](https://trac.cppcheck.net/query?status=accepted&status=assigned&status=new&status=reopened&component=False+positive&col=id&col=summary&col=status&col=component&col=type&col=priority&col=milestone&order=priority)
Since Cppcheck aims to be low on false positives, these kind of issues are obviously of the highest priority.
@@ -44,6 +46,18 @@ Changes might lead to fewer findings being reported. In very few cases this migh
[Other Defects](https://trac.cppcheck.net/query?status=accepted&status=assigned&status=new&status=reopened&type=defect&component=!False+positive&col=id&col=summary&col=type&col=status&col=component&col=priority&col=milestone&order=priority)
+Note: If you start working on ticket, please assign yourself or request to be.
+
+## Source TODOs
+
+There are also various source-level TODOs. These might be related to already tracked issues (even if not explicitly noted) but may also be just exist exploratively, have even been added overzealously or might even be outdated.
+
+So if you start spending a lot of time on these, you might want to get into touch before proceeding further.
+
+## simplecpp
+
+At its core Cppcheck is relying on the `simplecpp` library which is a preprocessor implementation which was spun off into its [separate project](https://github.com/cppcheck-opensource/simplecpp) with its own [bug tracker](https://github.com/cppcheck-opensource/simplecpp/issues). This is also maintained by the Cppcheck developers and contributions to it are also welcome.
+
## Translations
We are also maintaining various translations for `cppcheck-gui`.
diff --git a/Makefile b/Makefile
index b3b65e504e7..5810fcc9aa3 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ ifdef FILESDIR
override CPPFLAGS+=-DFILESDIR=\"$(FILESDIR)\"
endif
-RDYNAMIC=-rdynamic
+RDYNAMIC?=-rdynamic
# Set the CPPCHK_GLIBCXX_DEBUG flag. This flag is not used in release Makefiles.
# The _GLIBCXX_DEBUG define doesn't work in Cygwin or other Win32 systems.
ifndef COMSPEC
@@ -132,7 +132,7 @@ ifeq (clang++, $(findstring clang++,$(CXX)))
CPPCHK_GLIBCXX_DEBUG=
endif
ifndef CXXFLAGS
- CXXFLAGS=-pedantic -Wall -Wextra -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-sign-compare -Wno-multichar -Woverloaded-virtual $(CPPCHK_GLIBCXX_DEBUG) -g
+ CXXFLAGS=-pedantic -Wall -Wextra -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-sign-compare -Wno-multichar -Woverloaded-virtual -g
endif
ifeq (g++, $(findstring g++,$(CXX)))
@@ -144,7 +144,8 @@ ifeq ($(HAVE_RULES),yes)
ifeq ($(PCRE_CONFIG),)
$(error Did not find pcre-config)
endif
- override CXXFLAGS += -DHAVE_RULES $(shell $(PCRE_CONFIG) --cflags)
+ override CXXFLAGS += $(shell $(PCRE_CONFIG) --cflags)
+ override CPPFLAGS += -DHAVE_RULES
ifdef LIBS
LIBS += $(shell $(PCRE_CONFIG) --libs)
else
@@ -154,6 +155,19 @@ else ifneq ($(HAVE_RULES),)
$(error invalid HAVE_RULES value '$(HAVE_RULES)')
endif
+# older make versions do not support # in $(shell) and newer ones handle the escape sequence literally
+REQUIRE_ESCAPE=$(shell echo "\#define DEF" | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
+ifeq ($(REQUIRE_ESCAPE),1)
+ HAVE_EXECINFO_H=$(shell echo "\#include " | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
+else
+ HAVE_EXECINFO_H=$(shell echo "#include " | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
+endif
+override CPPFLAGS += -DHAVE_EXECINFO_H=$(HAVE_EXECINFO_H)
+
+override CXXFLAGS += $(CXXOPTS)
+override CPPFLAGS += $(CPPOPTS)
+override LDFLAGS += $(LDOPTS)
+
ifndef PREFIX
PREFIX=/usr
endif
@@ -162,12 +176,20 @@ ifndef INCLUDE_FOR_LIB
INCLUDE_FOR_LIB=-Ilib -isystem externals -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml2
endif
+ifndef INCLUDE_FOR_FE
+ INCLUDE_FOR_FE=-Ilib
+endif
+
ifndef INCLUDE_FOR_CLI
- INCLUDE_FOR_CLI=-Ilib -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml2
+ INCLUDE_FOR_CLI=-Ilib -Ifrontend -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml2
endif
ifndef INCLUDE_FOR_TEST
- INCLUDE_FOR_TEST=-Ilib -Icli -isystem externals/simplecpp -isystem externals/tinyxml2
+ INCLUDE_FOR_TEST=-Ilib -Ifrontend -Icli -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml2
+endif
+
+ifndef CFLAGS_FOR_TEST
+ CFLAGS_FOR_TEST=-Wno-dollar-in-identifier-extension
endif
BIN=$(DESTDIR)$(PREFIX)/bin
@@ -186,7 +208,6 @@ LIBOBJ = $(libcppdir)/valueflow.o \
$(libcppdir)/addoninfo.o \
$(libcppdir)/analyzerinfo.o \
$(libcppdir)/astutils.o \
- $(libcppdir)/check.o \
$(libcppdir)/check64bit.o \
$(libcppdir)/checkassert.o \
$(libcppdir)/checkautovariables.o \
@@ -199,6 +220,7 @@ LIBOBJ = $(libcppdir)/valueflow.o \
$(libcppdir)/checkersreport.o \
$(libcppdir)/checkexceptionsafety.o \
$(libcppdir)/checkfunctions.o \
+ $(libcppdir)/checkimpl.o \
$(libcppdir)/checkinternal.o \
$(libcppdir)/checkio.o \
$(libcppdir)/checkleakautovar.o \
@@ -206,6 +228,7 @@ LIBOBJ = $(libcppdir)/valueflow.o \
$(libcppdir)/checknullpointer.o \
$(libcppdir)/checkother.o \
$(libcppdir)/checkpostfixoperator.o \
+ $(libcppdir)/checks.o \
$(libcppdir)/checksizeof.o \
$(libcppdir)/checkstl.o \
$(libcppdir)/checkstring.o \
@@ -234,7 +257,9 @@ LIBOBJ = $(libcppdir)/valueflow.o \
$(libcppdir)/platform.o \
$(libcppdir)/preprocessor.o \
$(libcppdir)/programmemory.o \
+ $(libcppdir)/regex.o \
$(libcppdir)/reverseanalyzer.o \
+ $(libcppdir)/sarifreport.o \
$(libcppdir)/settings.o \
$(libcppdir)/standards.o \
$(libcppdir)/summaries.o \
@@ -252,6 +277,8 @@ LIBOBJ = $(libcppdir)/valueflow.o \
EXTOBJ = externals/simplecpp/simplecpp.o \
externals/tinyxml2/tinyxml2.o
+FEOBJ = frontend/frontend.o
+
CLIOBJ = cli/cmdlineparser.o \
cli/cppcheckexecutor.o \
cli/executor.o \
@@ -277,6 +304,7 @@ TESTOBJ = test/fixture.o \
test/testbufferoverrun.o \
test/testcharvar.o \
test/testcheck.o \
+ test/testcheckersreport.o \
test/testclangimport.o \
test/testclass.o \
test/testcmdlineparser.o \
@@ -289,6 +317,7 @@ TESTOBJ = test/fixture.o \
test/testexecutor.o \
test/testfilelister.o \
test/testfilesettings.o \
+ test/testfrontend.o \
test/testfunctions.o \
test/testgarbage.o \
test/testimportproject.o \
@@ -309,6 +338,8 @@ TESTOBJ = test/fixture.o \
test/testpreprocessor.o \
test/testprocessexecutor.o \
test/testprogrammemory.o \
+ test/testregex.o \
+ test/testsarifreport.o \
test/testsettings.o \
test/testsimplifytemplate.o \
test/testsimplifytokens.o \
@@ -344,13 +375,13 @@ TESTOBJ = test/fixture.o \
###### Targets
-cppcheck: $(EXTOBJ) $(LIBOBJ) $(CLIOBJ)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS) $(RDYNAMIC)
+cppcheck: $(EXTOBJ) $(LIBOBJ) $(FEOBJ) $(CLIOBJ)
+ $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS) $(RDYNAMIC)
all: cppcheck testrunner
-testrunner: $(EXTOBJ) $(TESTOBJ) $(LIBOBJ) cli/cmdlineparser.o cli/cppcheckexecutor.o cli/executor.o cli/filelister.o cli/processexecutor.o cli/sehwrapper.o cli/signalhandler.o cli/singleexecutor.o cli/stacktrace.o cli/threadexecutor.o
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS) $(RDYNAMIC)
+testrunner: $(EXTOBJ) $(TESTOBJ) $(LIBOBJ) $(FEOBJ) cli/cmdlineparser.o cli/cppcheckexecutor.o cli/executor.o cli/filelister.o cli/processexecutor.o cli/sehwrapper.o cli/signalhandler.o cli/singleexecutor.o cli/stacktrace.o cli/threadexecutor.o
+ $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS) $(RDYNAMIC)
test: all
./testrunner
@@ -368,7 +399,7 @@ run-dmake: dmake
./dmake
clean:
- rm -f build/*.cpp build/*.o lib/*.o cli/*.o test/*.o tools/dmake/*.o externals/*/*.o testrunner dmake cppcheck cppcheck.exe cppcheck.1
+ rm -f build/*.cpp build/*.o lib/*.o cli/*.o frontend/*.o test/*.o tools/dmake/*.o externals/*/*.o testrunner dmake cppcheck cppcheck.exe cppcheck.1
man: man/cppcheck.1
@@ -446,16 +477,19 @@ checkCWEEntries: /tmp/errorlist.xml
.PHONY: validateRules
validateRules:
xmllint --noout rules/*.xml
+.PHONY: check-nonneg
+check-nonneg:
+ ls lib/*.cpp | xargs -n 1 -P $$(nproc) g++ -fsyntax-only -DNONNEG $(CXXFLAGS) $(INCLUDE_FOR_LIB)
###### Build
-$(libcppdir)/valueflow.o: lib/valueflow.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/calculate.h lib/check.h lib/checkers.h lib/checkuninitvar.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/findtoken.h lib/forwardanalyzer.h lib/infer.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/programmemory.h lib/reverseanalyzer.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vf_analyzers.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h
+$(libcppdir)/valueflow.o: lib/valueflow.cpp lib/analyzer.h lib/astutils.h lib/calculate.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkuninitvar.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/findtoken.h lib/forwardanalyzer.h lib/infer.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/programmemory.h lib/reverseanalyzer.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vf_analyzers.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/valueflow.cpp
-$(libcppdir)/tokenize.o: lib/tokenize.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/summaries.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/tokenize.o: lib/tokenize.cpp externals/simplecpp/simplecpp.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/summaries.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/tokenize.cpp
-$(libcppdir)/symboldatabase.o: lib/symboldatabase.cpp lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/keywords.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/symboldatabase.o: lib/symboldatabase.cpp lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/keywords.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/symboldatabase.cpp
$(libcppdir)/addoninfo.o: lib/addoninfo.cpp externals/picojson/picojson.h lib/addoninfo.h lib/config.h lib/json.h lib/path.h lib/standards.h lib/utils.h
@@ -464,31 +498,28 @@ $(libcppdir)/addoninfo.o: lib/addoninfo.cpp externals/picojson/picojson.h lib/ad
$(libcppdir)/analyzerinfo.o: lib/analyzerinfo.cpp externals/tinyxml2/tinyxml2.h lib/analyzerinfo.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h lib/utils.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/analyzerinfo.cpp
-$(libcppdir)/astutils.o: lib/astutils.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkclass.h lib/checkers.h lib/config.h lib/errortypes.h lib/findtoken.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vfvalue.h
+$(libcppdir)/astutils.o: lib/astutils.cpp lib/astutils.h lib/check.h lib/checkclass.h lib/checkers.h lib/checkimpl.h lib/config.h lib/errortypes.h lib/findtoken.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/astutils.cpp
-$(libcppdir)/check.o: lib/check.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
- $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/check.cpp
-
-$(libcppdir)/check64bit.o: lib/check64bit.cpp lib/addoninfo.h lib/check.h lib/check64bit.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/check64bit.o: lib/check64bit.cpp lib/check.h lib/check64bit.h lib/checkers.h lib/checkimpl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/check64bit.cpp
-$(libcppdir)/checkassert.o: lib/checkassert.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkassert.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkassert.o: lib/checkassert.cpp lib/astutils.h lib/check.h lib/checkassert.h lib/checkers.h lib/checkimpl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkassert.cpp
-$(libcppdir)/checkautovariables.o: lib/checkautovariables.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkautovariables.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/checkautovariables.o: lib/checkautovariables.cpp lib/astutils.h lib/check.h lib/checkautovariables.h lib/checkers.h lib/checkimpl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkautovariables.cpp
-$(libcppdir)/checkbool.o: lib/checkbool.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkbool.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkbool.o: lib/checkbool.cpp lib/astutils.h lib/check.h lib/checkbool.h lib/checkers.h lib/checkimpl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkbool.cpp
-$(libcppdir)/checkbufferoverrun.o: lib/checkbufferoverrun.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/checkbufferoverrun.h lib/checkers.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/checkbufferoverrun.o: lib/checkbufferoverrun.cpp externals/tinyxml2/tinyxml2.h lib/astutils.h lib/check.h lib/checkbufferoverrun.h lib/checkers.h lib/checkimpl.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vf_common.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkbufferoverrun.cpp
-$(libcppdir)/checkclass.o: lib/checkclass.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/checkclass.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/checkclass.o: lib/checkclass.cpp externals/tinyxml2/tinyxml2.h lib/astutils.h lib/check.h lib/checkclass.h lib/checkers.h lib/checkimpl.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkclass.cpp
-$(libcppdir)/checkcondition.o: lib/checkcondition.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkcondition.h lib/checkers.h lib/checkother.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkcondition.o: lib/checkcondition.cpp lib/astutils.h lib/check.h lib/checkcondition.h lib/checkers.h lib/checkimpl.h lib/checkother.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkcondition.cpp
$(libcppdir)/checkers.o: lib/checkers.cpp lib/checkers.h lib/config.h
@@ -497,73 +528,79 @@ $(libcppdir)/checkers.o: lib/checkers.cpp lib/checkers.h lib/config.h
$(libcppdir)/checkersidmapping.o: lib/checkersidmapping.cpp lib/checkers.h lib/config.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkersidmapping.cpp
-$(libcppdir)/checkersreport.o: lib/checkersreport.cpp lib/addoninfo.h lib/checkers.h lib/checkersreport.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h
+$(libcppdir)/checkersreport.o: lib/checkersreport.cpp lib/addoninfo.h lib/checkers.h lib/checkersreport.h lib/config.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkersreport.cpp
-$(libcppdir)/checkexceptionsafety.o: lib/checkexceptionsafety.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkexceptionsafety.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkexceptionsafety.o: lib/checkexceptionsafety.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkexceptionsafety.h lib/checkimpl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkexceptionsafety.cpp
-$(libcppdir)/checkfunctions.o: lib/checkfunctions.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkfunctions.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/checkfunctions.o: lib/checkfunctions.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkfunctions.h lib/checkimpl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkfunctions.cpp
-$(libcppdir)/checkinternal.o: lib/checkinternal.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkinternal.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkimpl.o: lib/checkimpl.cpp lib/checkers.h lib/checkimpl.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+ $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkimpl.cpp
+
+$(libcppdir)/checkinternal.o: lib/checkinternal.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkinternal.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkinternal.cpp
-$(libcppdir)/checkio.o: lib/checkio.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkio.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkio.o: lib/checkio.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkio.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkio.cpp
-$(libcppdir)/checkleakautovar.o: lib/checkleakautovar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkleakautovar.h lib/checkmemoryleak.h lib/checknullpointer.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkleakautovar.o: lib/checkleakautovar.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkleakautovar.h lib/checkmemoryleak.h lib/checknullpointer.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkleakautovar.cpp
-$(libcppdir)/checkmemoryleak.o: lib/checkmemoryleak.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkmemoryleak.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkmemoryleak.o: lib/checkmemoryleak.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkmemoryleak.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkmemoryleak.cpp
-$(libcppdir)/checknullpointer.o: lib/checknullpointer.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checknullpointer.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/findtoken.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/checknullpointer.o: lib/checknullpointer.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checknullpointer.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/findtoken.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checknullpointer.cpp
-$(libcppdir)/checkother.o: lib/checkother.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkother.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/checkother.o: lib/checkother.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkother.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkother.cpp
-$(libcppdir)/checkpostfixoperator.o: lib/checkpostfixoperator.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkpostfixoperator.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkpostfixoperator.o: lib/checkpostfixoperator.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkpostfixoperator.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkpostfixoperator.cpp
-$(libcppdir)/checksizeof.o: lib/checksizeof.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checksizeof.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checks.o: lib/checks.cpp lib/check.h lib/check64bit.h lib/checkassert.h lib/checkautovariables.h lib/checkbool.h lib/checkbufferoverrun.h lib/checkclass.h lib/checkcondition.h lib/checkexceptionsafety.h lib/checkfunctions.h lib/checkimpl.h lib/checkinternal.h lib/checkio.h lib/checkleakautovar.h lib/checkmemoryleak.h lib/checknullpointer.h lib/checkother.h lib/checkpostfixoperator.h lib/checks.h lib/checksizeof.h lib/checkstl.h lib/checkstring.h lib/checktype.h lib/checkuninitvar.h lib/checkunusedvar.h lib/checkvaarg.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/standards.h lib/vfvalue.h
+ $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checks.cpp
+
+$(libcppdir)/checksizeof.o: lib/checksizeof.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checksizeof.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checksizeof.cpp
-$(libcppdir)/checkstl.o: lib/checkstl.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checknullpointer.h lib/checkstl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/pathanalysis.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/checkstl.o: lib/checkstl.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checknullpointer.h lib/checkstl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/pathanalysis.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkstl.cpp
-$(libcppdir)/checkstring.o: lib/checkstring.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkstring.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkstring.o: lib/checkstring.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkstring.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkstring.cpp
-$(libcppdir)/checktype.o: lib/checktype.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checktype.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/checktype.o: lib/checktype.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checktype.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checktype.cpp
-$(libcppdir)/checkuninitvar.o: lib/checkuninitvar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checknullpointer.h lib/checkuninitvar.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkuninitvar.o: lib/checkuninitvar.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checknullpointer.h lib/checkuninitvar.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkuninitvar.cpp
-$(libcppdir)/checkunusedfunctions.o: lib/checkunusedfunctions.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/checkunusedfunctions.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/checkunusedfunctions.o: lib/checkunusedfunctions.cpp externals/tinyxml2/tinyxml2.h lib/analyzerinfo.h lib/astutils.h lib/checkers.h lib/checkunusedfunctions.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkunusedfunctions.cpp
-$(libcppdir)/checkunusedvar.o: lib/checkunusedvar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkunusedvar.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/checkunusedvar.o: lib/checkunusedvar.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkunusedvar.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkunusedvar.cpp
-$(libcppdir)/checkvaarg.o: lib/checkvaarg.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkvaarg.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/checkvaarg.o: lib/checkvaarg.cpp lib/astutils.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkvaarg.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkvaarg.cpp
-$(libcppdir)/clangimport.o: lib/clangimport.cpp lib/addoninfo.h lib/checkers.h lib/clangimport.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/clangimport.o: lib/clangimport.cpp lib/clangimport.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/clangimport.cpp
$(libcppdir)/color.o: lib/color.cpp lib/color.h lib/config.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/color.cpp
-$(libcppdir)/cppcheck.o: lib/cppcheck.cpp externals/picojson/picojson.h externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/checkunusedfunctions.h lib/clangimport.h lib/color.h lib/config.h lib/cppcheck.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/version.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/cppcheck.o: lib/cppcheck.cpp externals/picojson/picojson.h externals/simplecpp/simplecpp.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/checks.h lib/checkunusedfunctions.h lib/clangimport.h lib/color.h lib/config.h lib/cppcheck.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/regex.h lib/rule.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/version.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/cppcheck.cpp
-$(libcppdir)/ctu.o: lib/ctu.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/ctu.o: lib/ctu.cpp externals/tinyxml2/tinyxml2.h lib/astutils.h lib/check.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/ctu.cpp
-$(libcppdir)/errorlogger.o: lib/errorlogger.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/errorlogger.o: lib/errorlogger.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/errorlogger.cpp
$(libcppdir)/errortypes.o: lib/errortypes.cpp lib/config.h lib/errortypes.h lib/utils.h
@@ -572,25 +609,25 @@ $(libcppdir)/errortypes.o: lib/errortypes.cpp lib/config.h lib/errortypes.h lib/
$(libcppdir)/findtoken.o: lib/findtoken.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/findtoken.h lib/library.h lib/mathlib.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/findtoken.cpp
-$(libcppdir)/forwardanalyzer.o: lib/forwardanalyzer.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/forwardanalyzer.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueptr.h lib/vfvalue.h
+$(libcppdir)/forwardanalyzer.o: lib/forwardanalyzer.cpp lib/analyzer.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/forwardanalyzer.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueptr.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/forwardanalyzer.cpp
-$(libcppdir)/fwdanalysis.o: lib/fwdanalysis.cpp lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/fwdanalysis.o: lib/fwdanalysis.cpp lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/fwdanalysis.cpp
-$(libcppdir)/importproject.o: lib/importproject.cpp externals/picojson/picojson.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/importproject.o: lib/importproject.cpp externals/picojson/picojson.h externals/tinyxml2/tinyxml2.h lib/checkers.h lib/config.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/importproject.cpp
-$(libcppdir)/infer.o: lib/infer.cpp lib/calculate.h lib/config.h lib/errortypes.h lib/infer.h lib/mathlib.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueptr.h lib/vfvalue.h
+$(libcppdir)/infer.o: lib/infer.cpp lib/calculate.h lib/config.h lib/errortypes.h lib/infer.h lib/mathlib.h lib/smallvector.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueptr.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/infer.cpp
$(libcppdir)/keywords.o: lib/keywords.cpp lib/config.h lib/keywords.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/keywords.cpp
-$(libcppdir)/library.o: lib/library.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/library.o: lib/library.cpp externals/tinyxml2/tinyxml2.h lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/library.cpp
-$(libcppdir)/mathlib.o: lib/mathlib.cpp externals/simplecpp/simplecpp.h lib/config.h lib/errortypes.h lib/mathlib.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/mathlib.o: lib/mathlib.cpp externals/simplecpp/simplecpp.h lib/config.h lib/errortypes.h lib/mathlib.h lib/smallvector.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/mathlib.cpp
$(libcppdir)/path.o: lib/path.cpp externals/simplecpp/simplecpp.h lib/config.h lib/path.h lib/standards.h lib/utils.h
@@ -599,314 +636,335 @@ $(libcppdir)/path.o: lib/path.cpp externals/simplecpp/simplecpp.h lib/config.h l
$(libcppdir)/pathanalysis.o: lib/pathanalysis.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/pathanalysis.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/pathanalysis.cpp
-$(libcppdir)/pathmatch.o: lib/pathmatch.cpp lib/config.h lib/path.h lib/pathmatch.h lib/standards.h lib/utils.h
+$(libcppdir)/pathmatch.o: lib/pathmatch.cpp lib/config.h lib/path.h lib/pathmatch.h lib/standards.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/pathmatch.cpp
-$(libcppdir)/platform.o: lib/platform.cpp externals/tinyxml2/tinyxml2.h lib/config.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h lib/xml.h
+$(libcppdir)/platform.o: lib/platform.cpp externals/tinyxml2/tinyxml2.h lib/config.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h lib/utils.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/platform.cpp
-$(libcppdir)/preprocessor.o: lib/preprocessor.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h
+$(libcppdir)/preprocessor.o: lib/preprocessor.cpp externals/simplecpp/simplecpp.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/preprocessor.cpp
-$(libcppdir)/programmemory.o: lib/programmemory.cpp lib/addoninfo.h lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vfvalue.h
+$(libcppdir)/programmemory.o: lib/programmemory.cpp lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/programmemory.cpp
-$(libcppdir)/reverseanalyzer.o: lib/reverseanalyzer.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/forwardanalyzer.h lib/library.h lib/mathlib.h lib/platform.h lib/reverseanalyzer.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueptr.h lib/vfvalue.h
+$(libcppdir)/regex.o: lib/regex.cpp lib/config.h lib/regex.h
+ $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/regex.cpp
+
+$(libcppdir)/reverseanalyzer.o: lib/reverseanalyzer.cpp lib/analyzer.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/forwardanalyzer.h lib/library.h lib/mathlib.h lib/platform.h lib/reverseanalyzer.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueptr.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/reverseanalyzer.cpp
-$(libcppdir)/settings.o: lib/settings.cpp externals/picojson/picojson.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/summaries.h lib/suppressions.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/sarifreport.o: lib/sarifreport.cpp externals/picojson/picojson.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/json.h lib/library.h lib/mathlib.h lib/platform.h lib/sarifreport.h lib/settings.h lib/standards.h lib/utils.h
+ $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/sarifreport.cpp
+
+$(libcppdir)/settings.o: lib/settings.cpp externals/picojson/picojson.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/rule.h lib/settings.h lib/standards.h lib/summaries.h lib/suppressions.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/settings.cpp
$(libcppdir)/standards.o: lib/standards.cpp externals/simplecpp/simplecpp.h lib/config.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/standards.cpp
-$(libcppdir)/summaries.o: lib/summaries.cpp lib/addoninfo.h lib/analyzerinfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/summaries.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/summaries.o: lib/summaries.cpp lib/analyzerinfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/summaries.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/summaries.cpp
-$(libcppdir)/suppressions.o: lib/suppressions.cpp externals/tinyxml2/tinyxml2.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
+$(libcppdir)/suppressions.o: lib/suppressions.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/suppressions.cpp
-$(libcppdir)/templatesimplifier.o: lib/templatesimplifier.cpp lib/addoninfo.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/templatesimplifier.o: lib/templatesimplifier.cpp lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/templatesimplifier.cpp
-$(libcppdir)/timer.o: lib/timer.cpp lib/config.h lib/timer.h lib/utils.h
+$(libcppdir)/timer.o: lib/timer.cpp lib/config.h lib/timer.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/timer.cpp
-$(libcppdir)/token.o: lib/token.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/tokenrange.h lib/utils.h lib/valueflow.h lib/vfvalue.h
+$(libcppdir)/token.o: lib/token.cpp externals/simplecpp/simplecpp.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/tokenrange.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/token.cpp
-$(libcppdir)/tokenlist.o: lib/tokenlist.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/keywords.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/tokenlist.o: lib/tokenlist.cpp externals/simplecpp/simplecpp.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/keywords.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/tokenlist.cpp
$(libcppdir)/utils.o: lib/utils.cpp lib/config.h lib/utils.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/utils.cpp
-$(libcppdir)/vf_analyzers.o: lib/vf_analyzers.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vf_analyzers.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h
+$(libcppdir)/vf_analyzers.o: lib/vf_analyzers.cpp lib/analyzer.h lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vf_analyzers.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_analyzers.cpp
-$(libcppdir)/vf_common.o: lib/vf_common.cpp lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h
+$(libcppdir)/vf_common.o: lib/vf_common.cpp lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_common.cpp
-$(libcppdir)/vf_settokenvalue.o: lib/vf_settokenvalue.cpp lib/addoninfo.h lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h
+$(libcppdir)/vf_settokenvalue.o: lib/vf_settokenvalue.cpp lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_settokenvalue.cpp
-$(libcppdir)/vfvalue.o: lib/vfvalue.cpp lib/config.h lib/errortypes.h lib/mathlib.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h
+$(libcppdir)/vfvalue.o: lib/vfvalue.cpp lib/config.h lib/errortypes.h lib/mathlib.h lib/smallvector.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vfvalue.cpp
-cli/cmdlineparser.o: cli/cmdlineparser.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/filelister.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h lib/xml.h
+frontend/frontend.o: frontend/frontend.cpp frontend/frontend.h lib/checkers.h lib/config.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h
+ $(CXX) ${INCLUDE_FOR_FE} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ frontend/frontend.cpp
+
+cli/cmdlineparser.o: cli/cmdlineparser.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/filelister.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/checks.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/regex.h lib/rule.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/cmdlineparser.cpp
-cli/cppcheckexecutor.o: cli/cppcheckexecutor.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/cppcheckexecutor.h cli/executor.h cli/processexecutor.h cli/sehwrapper.h cli/signalhandler.h cli/singleexecutor.h cli/threadexecutor.h externals/picojson/picojson.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/checkersreport.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h
+cli/cppcheckexecutor.o: cli/cppcheckexecutor.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/cppcheckexecutor.h cli/executor.h cli/processexecutor.h cli/sehwrapper.h cli/signalhandler.h cli/singleexecutor.h cli/threadexecutor.h externals/picojson/picojson.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/checkersreport.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/sarifreport.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/cppcheckexecutor.cpp
-cli/executor.o: cli/executor.cpp cli/executor.h lib/addoninfo.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h
+cli/executor.o: cli/executor.cpp cli/executor.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/executor.cpp
cli/filelister.o: cli/filelister.cpp cli/filelister.h lib/config.h lib/filesettings.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/filelister.cpp
-cli/main.o: cli/main.cpp cli/cppcheckexecutor.h lib/config.h lib/errortypes.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h
+cli/main.o: cli/main.cpp cli/cppcheckexecutor.h lib/config.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/main.cpp
-cli/processexecutor.o: cli/processexecutor.cpp cli/executor.h cli/processexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h
+cli/processexecutor.o: cli/processexecutor.cpp cli/executor.h cli/processexecutor.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/processexecutor.cpp
cli/sehwrapper.o: cli/sehwrapper.cpp cli/sehwrapper.h lib/config.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/sehwrapper.cpp
-cli/signalhandler.o: cli/signalhandler.cpp cli/signalhandler.h cli/stacktrace.h lib/config.h lib/utils.h
+cli/signalhandler.o: cli/signalhandler.cpp cli/signalhandler.h cli/stacktrace.h lib/config.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/signalhandler.cpp
-cli/singleexecutor.o: cli/singleexecutor.cpp cli/executor.h cli/singleexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/timer.h lib/utils.h
+cli/singleexecutor.o: cli/singleexecutor.cpp cli/executor.h cli/singleexecutor.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/singleexecutor.cpp
cli/stacktrace.o: cli/stacktrace.cpp cli/stacktrace.h lib/config.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/stacktrace.cpp
-cli/threadexecutor.o: cli/threadexecutor.cpp cli/executor.h cli/threadexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h
+cli/threadexecutor.o: cli/threadexecutor.cpp cli/executor.h cli/threadexecutor.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/threadexecutor.cpp
-test/fixture.o: test/fixture.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/fixture.h test/helpers.h test/options.h test/redirect.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/fixture.cpp
+test/fixture.o: test/fixture.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/fixture.h test/helpers.h test/options.h test/redirect.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/fixture.cpp
+
+test/helpers.o: test/helpers.cpp cli/filelister.h externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/checkers.h lib/config.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/helpers.cpp
+
+test/main.o: test/main.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h test/options.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/main.cpp
+
+test/options.o: test/options.cpp lib/config.h lib/timer.h test/options.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/options.cpp
+
+test/test64bit.o: test/test64bit.cpp lib/check.h lib/check64bit.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/test64bit.cpp
-test/helpers.o: test/helpers.cpp cli/filelister.h externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/helpers.cpp
+test/testanalyzerinformation.o: test/testanalyzerinformation.cpp externals/tinyxml2/tinyxml2.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/xml.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testanalyzerinformation.cpp
-test/main.o: test/main.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h test/options.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/main.cpp
+test/testassert.o: test/testassert.cpp lib/check.h lib/checkassert.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testassert.cpp
-test/options.o: test/options.cpp test/options.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/options.cpp
+test/testastutils.o: test/testastutils.cpp lib/astutils.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testastutils.cpp
-test/test64bit.o: test/test64bit.cpp lib/addoninfo.h lib/check.h lib/check64bit.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/test64bit.cpp
+test/testautovariables.o: test/testautovariables.cpp lib/check.h lib/checkautovariables.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testautovariables.cpp
-test/testanalyzerinformation.o: test/testanalyzerinformation.cpp lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testanalyzerinformation.cpp
+test/testbool.o: test/testbool.cpp lib/check.h lib/checkbool.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testbool.cpp
-test/testassert.o: test/testassert.cpp lib/addoninfo.h lib/check.h lib/checkassert.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testassert.cpp
+test/testbufferoverrun.o: test/testbufferoverrun.cpp lib/check.h lib/checkbufferoverrun.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testbufferoverrun.cpp
-test/testastutils.o: test/testastutils.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testastutils.cpp
+test/testcharvar.o: test/testcharvar.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcharvar.cpp
-test/testautovariables.o: test/testautovariables.cpp lib/addoninfo.h lib/check.h lib/checkautovariables.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testautovariables.cpp
+test/testcheck.o: test/testcheck.cpp lib/check.h lib/checkers.h lib/checks.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcheck.cpp
-test/testbool.o: test/testbool.cpp lib/addoninfo.h lib/check.h lib/checkbool.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testbool.cpp
+test/testcheckersreport.o: test/testcheckersreport.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkersreport.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcheckersreport.cpp
-test/testbufferoverrun.o: test/testbufferoverrun.cpp lib/addoninfo.h lib/check.h lib/checkbufferoverrun.h lib/checkers.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testbufferoverrun.cpp
+test/testclangimport.o: test/testclangimport.cpp lib/check.h lib/checkers.h lib/clangimport.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testclangimport.cpp
-test/testcharvar.o: test/testcharvar.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcharvar.cpp
+test/testclass.o: test/testclass.cpp lib/check.h lib/checkclass.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testclass.cpp
-test/testcheck.o: test/testcheck.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcheck.cpp
+test/testcmdlineparser.o: test/testcmdlineparser.cpp cli/cmdlinelogger.h cli/cmdlineparser.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/regex.h lib/rule.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcmdlineparser.cpp
-test/testclangimport.o: test/testclangimport.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/clangimport.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testclangimport.cpp
+test/testcolor.o: test/testcolor.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcolor.cpp
-test/testclass.o: test/testclass.cpp lib/addoninfo.h lib/check.h lib/checkclass.h lib/checkers.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testclass.cpp
+test/testcondition.o: test/testcondition.cpp lib/check.h lib/checkcondition.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcondition.cpp
-test/testcmdlineparser.o: test/testcmdlineparser.cpp cli/cmdlinelogger.h cli/cmdlineparser.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcmdlineparser.cpp
+test/testconstructors.o: test/testconstructors.cpp lib/check.h lib/checkclass.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testconstructors.cpp
-test/testcolor.o: test/testcolor.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcolor.cpp
+test/testcppcheck.o: test/testcppcheck.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcppcheck.cpp
-test/testcondition.o: test/testcondition.cpp lib/addoninfo.h lib/check.h lib/checkcondition.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcondition.cpp
+test/testerrorlogger.o: test/testerrorlogger.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testerrorlogger.cpp
-test/testconstructors.o: test/testconstructors.cpp lib/addoninfo.h lib/check.h lib/checkclass.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testconstructors.cpp
+test/testexceptionsafety.o: test/testexceptionsafety.cpp lib/check.h lib/checkers.h lib/checkexceptionsafety.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testexceptionsafety.cpp
-test/testcppcheck.o: test/testcppcheck.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcppcheck.cpp
+test/testexecutor.o: test/testexecutor.cpp cli/executor.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testexecutor.cpp
-test/testerrorlogger.o: test/testerrorlogger.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testerrorlogger.cpp
+test/testfilelister.o: test/testfilelister.cpp cli/filelister.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilelister.cpp
-test/testexceptionsafety.o: test/testexceptionsafety.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkexceptionsafety.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testexceptionsafety.cpp
+test/testfilesettings.o: test/testfilesettings.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilesettings.cpp
-test/testexecutor.o: test/testexecutor.cpp cli/executor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testexecutor.cpp
+test/testfrontend.o: test/testfrontend.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfrontend.cpp
-test/testfilelister.o: test/testfilelister.cpp cli/filelister.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilelister.cpp
+test/testfunctions.o: test/testfunctions.cpp lib/check.h lib/checkers.h lib/checkfunctions.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfunctions.cpp
-test/testfilesettings.o: test/testfilesettings.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilesettings.cpp
+test/testgarbage.o: test/testgarbage.cpp lib/check.h lib/checkers.h lib/checks.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testgarbage.cpp
-test/testfunctions.o: test/testfunctions.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfunctions.cpp
+test/testimportproject.o: test/testimportproject.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h test/fixture.h test/redirect.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testimportproject.cpp
-test/testgarbage.o: test/testgarbage.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testgarbage.cpp
+test/testincompletestatement.o: test/testincompletestatement.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testincompletestatement.cpp
-test/testimportproject.o: test/testimportproject.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/redirect.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testimportproject.cpp
+test/testinternal.o: test/testinternal.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkinternal.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testinternal.cpp
-test/testincompletestatement.o: test/testincompletestatement.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testincompletestatement.cpp
+test/testio.o: test/testio.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkio.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testio.cpp
-test/testinternal.o: test/testinternal.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkinternal.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testinternal.cpp
+test/testleakautovar.o: test/testleakautovar.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkleakautovar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testleakautovar.cpp
-test/testio.o: test/testio.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkio.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testio.cpp
+test/testlibrary.o: test/testlibrary.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testlibrary.cpp
-test/testleakautovar.o: test/testleakautovar.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkleakautovar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testleakautovar.cpp
+test/testmathlib.o: test/testmathlib.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testmathlib.cpp
-test/testlibrary.o: test/testlibrary.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testlibrary.cpp
+test/testmemleak.o: test/testmemleak.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkmemoryleak.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testmemleak.cpp
-test/testmathlib.o: test/testmathlib.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testmathlib.cpp
+test/testnullpointer.o: test/testnullpointer.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checknullpointer.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testnullpointer.cpp
-test/testmemleak.o: test/testmemleak.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkmemoryleak.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testmemleak.cpp
+test/testoptions.o: test/testoptions.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h test/options.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testoptions.cpp
-test/testnullpointer.o: test/testnullpointer.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checknullpointer.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testnullpointer.cpp
+test/testother.o: test/testother.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testother.cpp
-test/testoptions.o: test/testoptions.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h test/options.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testoptions.cpp
+test/testpath.o: test/testpath.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpath.cpp
-test/testother.o: test/testother.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testother.cpp
+test/testpathmatch.o: test/testpathmatch.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpathmatch.cpp
-test/testpath.o: test/testpath.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpath.cpp
+test/testplatform.o: test/testplatform.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/xml.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testplatform.cpp
-test/testpathmatch.o: test/testpathmatch.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpathmatch.cpp
+test/testpostfixoperator.o: test/testpostfixoperator.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkpostfixoperator.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpostfixoperator.cpp
-test/testplatform.o: test/testplatform.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/xml.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testplatform.cpp
+test/testpreprocessor.o: test/testpreprocessor.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpreprocessor.cpp
-test/testpostfixoperator.o: test/testpostfixoperator.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkpostfixoperator.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpostfixoperator.cpp
+test/testprocessexecutor.o: test/testprocessexecutor.cpp cli/executor.h cli/processexecutor.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testprocessexecutor.cpp
-test/testpreprocessor.o: test/testpreprocessor.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpreprocessor.cpp
+test/testprogrammemory.o: test/testprogrammemory.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testprogrammemory.cpp
-test/testprocessexecutor.o: test/testprocessexecutor.cpp cli/executor.h cli/processexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testprocessexecutor.cpp
+test/testregex.o: test/testregex.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/regex.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testregex.cpp
-test/testprogrammemory.o: test/testprogrammemory.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/programmemory.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testprogrammemory.cpp
+test/testsarifreport.o: test/testsarifreport.cpp externals/picojson/picojson.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/json.h lib/library.h lib/mathlib.h lib/platform.h lib/sarifreport.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsarifreport.cpp
-test/testsettings.o: test/testsettings.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsettings.cpp
+test/testsettings.o: test/testsettings.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsettings.cpp
-test/testsimplifytemplate.o: test/testsimplifytemplate.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytemplate.cpp
+test/testsimplifytemplate.o: test/testsimplifytemplate.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytemplate.cpp
-test/testsimplifytokens.o: test/testsimplifytokens.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytokens.cpp
+test/testsimplifytokens.o: test/testsimplifytokens.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytokens.cpp
-test/testsimplifytypedef.o: test/testsimplifytypedef.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytypedef.cpp
+test/testsimplifytypedef.o: test/testsimplifytypedef.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytypedef.cpp
-test/testsimplifyusing.o: test/testsimplifyusing.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifyusing.cpp
+test/testsimplifyusing.o: test/testsimplifyusing.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifyusing.cpp
-test/testsingleexecutor.o: test/testsingleexecutor.cpp cli/executor.h cli/singleexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsingleexecutor.cpp
+test/testsingleexecutor.o: test/testsingleexecutor.cpp cli/executor.h cli/singleexecutor.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsingleexecutor.cpp
-test/testsizeof.o: test/testsizeof.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checksizeof.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsizeof.cpp
+test/testsizeof.o: test/testsizeof.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checksizeof.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsizeof.cpp
-test/teststandards.o: test/teststandards.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststandards.cpp
+test/teststandards.o: test/teststandards.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststandards.cpp
-test/teststl.o: test/teststl.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkstl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststl.cpp
+test/teststl.o: test/teststl.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkstl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststl.cpp
-test/teststring.o: test/teststring.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkstring.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststring.cpp
+test/teststring.o: test/teststring.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkstring.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststring.cpp
-test/testsummaries.o: test/testsummaries.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/summaries.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsummaries.cpp
+test/testsummaries.o: test/testsummaries.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/summaries.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsummaries.cpp
test/testsuppressions.o: test/testsuppressions.cpp cli/cppcheckexecutor.h cli/executor.h cli/processexecutor.h cli/singleexecutor.h cli/threadexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsuppressions.cpp
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsuppressions.cpp
-test/testsymboldatabase.o: test/testsymboldatabase.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsymboldatabase.cpp
+test/testsymboldatabase.o: test/testsymboldatabase.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsymboldatabase.cpp
-test/testthreadexecutor.o: test/testthreadexecutor.cpp cli/executor.h cli/threadexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testthreadexecutor.cpp
+test/testthreadexecutor.o: test/testthreadexecutor.cpp cli/executor.h cli/threadexecutor.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testthreadexecutor.cpp
-test/testtimer.o: test/testtimer.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/timer.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtimer.cpp
+test/testtimer.o: test/testtimer.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/timer.h lib/utils.h test/fixture.h test/redirect.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtimer.cpp
-test/testtoken.o: test/testtoken.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtoken.cpp
+test/testtoken.o: test/testtoken.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtoken.cpp
-test/testtokenize.o: test/testtokenize.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenize.cpp
+test/testtokenize.o: test/testtokenize.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenize.cpp
-test/testtokenlist.o: test/testtokenlist.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenlist.cpp
+test/testtokenlist.o: test/testtokenlist.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenlist.cpp
-test/testtokenrange.o: test/testtokenrange.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/tokenrange.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenrange.cpp
+test/testtokenrange.o: test/testtokenrange.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/tokenrange.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenrange.cpp
-test/testtype.o: test/testtype.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checktype.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtype.cpp
+test/testtype.o: test/testtype.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checktype.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtype.cpp
-test/testuninitvar.o: test/testuninitvar.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkuninitvar.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testuninitvar.cpp
+test/testuninitvar.o: test/testuninitvar.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkuninitvar.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testuninitvar.cpp
-test/testunusedfunctions.o: test/testunusedfunctions.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkunusedfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedfunctions.cpp
+test/testunusedfunctions.o: test/testunusedfunctions.cpp lib/check.h lib/checkers.h lib/checkunusedfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedfunctions.cpp
-test/testunusedprivfunc.o: test/testunusedprivfunc.cpp lib/addoninfo.h lib/check.h lib/checkclass.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedprivfunc.cpp
+test/testunusedprivfunc.o: test/testunusedprivfunc.cpp lib/check.h lib/checkclass.h lib/checkers.h lib/checkimpl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedprivfunc.cpp
-test/testunusedvar.o: test/testunusedvar.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/checkunusedvar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedvar.cpp
+test/testunusedvar.o: test/testunusedvar.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkers.h lib/checkimpl.h lib/checkunusedvar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedvar.cpp
-test/testutils.o: test/testutils.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testutils.cpp
+test/testutils.o: test/testutils.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testutils.cpp
-test/testvaarg.o: test/testvaarg.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkvaarg.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvaarg.cpp
+test/testvaarg.o: test/testvaarg.cpp lib/check.h lib/checkers.h lib/checkimpl.h lib/checkvaarg.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvaarg.cpp
-test/testvalueflow.o: test/testvalueflow.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvalueflow.cpp
+test/testvalueflow.o: test/testvalueflow.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvalueflow.cpp
-test/testvarid.o: test/testvarid.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvarid.cpp
+test/testvarid.o: test/testvarid.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvarid.cpp
-test/testvfvalue.o: test/testvfvalue.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/vfvalue.h test/fixture.h
- $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvfvalue.cpp
+test/testvfvalue.o: test/testvfvalue.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/vfvalue.h test/fixture.h
+ $(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvfvalue.cpp
externals/simplecpp/simplecpp.o: externals/simplecpp/simplecpp.cpp externals/simplecpp/simplecpp.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -w -c -o $@ externals/simplecpp/simplecpp.cpp
diff --git a/TUNING.md b/TUNING.md
index 081846d9ea9..ba1f7f49738 100644
--- a/TUNING.md
+++ b/TUNING.md
@@ -28,9 +28,15 @@ Boost.Container (https://www.boost.org/doc/libs/release/libs/container) is being
As the used library is header-only implementation you only need to install the package on the system you build the binary on but not on the system you run the analysis on.
-The official Windows binary is currently not using this (TODO: file ticket).
+The official Windows binary is always using this.
-(TODO: enable usage by default / bail out when it is enforced)
+This will be used by default if Boost is detected in CMake. If you want to enforce the usage, you can use the CMake option `-DUSE_BOOST=On` which will cause the build to fail if no Boost was detected.
+
+Using Visual Studio you need to provide a full Boost release (i.e. including binaries) for it to be detected by CMake. If you are not able to do this you can specify the CMake option `-DBOOST_INCLUDEDIR=` (pointing to the directory which *contains* the `boost` include directory) to work around this (this is a Cppcheck specific hack) - see https://trac.cppcheck.net/ticket/13822 for more details.
+
+If you are using `make` instead you need to specify `-DHAVE_BOOST` in the flags.
+
+If you are using the Visual Studio project you need to specify the properties `HaveBoost` (always needs to be set to `HAVE_BOOST`) and `BoostInclude` (set to the Boost folder). On the command-line you would need to add `-p:HaveBoost=HAVE_BOOST -p:BoostInclude=`.
### Use A Different Compiler
@@ -40,7 +46,7 @@ In our case Clang is mostly faster than GCC. See https://trac.cppcheck.net/ticke
### Use More Advanced Optimizations
-By default we enforce the `-O2` optimization level. Even when using the `Release` build type in CMake which defaults to `-O3`. It might be possible that building with `-O3` might yield a perfomance increase.
+By default we enforce the `-O2` optimization level. Even when using the `Release` build type in CMake which defaults to `-O3`. It might be possible that building with `-O3` might yield a performance increase.
There are also no additional code generation flags provided so the resulting binary can run on any system. You might be able to tune this and apply more optimization which is tailored to the system you will be running the binary on.
@@ -105,6 +111,18 @@ So if you do not require the additional safety you might want to switch to the u
Note: For Windows binaries we currently do not provide the possibility of using processes so this does not apply.
+### Disable Analyzing Of Unused Templated Functions
+
+Currently all templated functions (either locally or in headers) will be analyzed regardless if they are instantiated or not. If you have template-heavy includes that might lead to unnecessary work and findings, and might slow down the analysis. This behavior can be disabled with `--no-check-unused-templates`.
+
+Note: This might lead to "false negatives" in such functions if they are never instantiated. You should make sure that you have proper coverage of the affected functions in your code before enabling this.
+
+### Limit Analysis Of Projects
+
+If you specify a project all files will be analyzed by default. But in some cases you might only be interested in the results in a subset of those (e.g. in IDE integrations).
+
+Using the `--file-filter=` CLI option you can select files using a globbing syntax. Using `--file-filter=-` you can provide the filters directly on the CLI.
+
## Advanced Tuning
### Re-order The Files
diff --git a/addons/README.md b/addons/README.md
index 563c0c793f6..05502f547b6 100644
--- a/addons/README.md
+++ b/addons/README.md
@@ -4,19 +4,19 @@ Addons are scripts that analyses Cppcheck dump files to check compatibility with
## Supported addons
-+ [misra.py](https://github.com/danmar/cppcheck/blob/main/addons/misra.py)
- Used to verify compliance with MISRA C 2012 - a proprietary set of guidelines to avoid such questionable code, developed for embedded systems. Since this standard is proprietary, cppcheck does not display error text by specifying only the number of violated rules (for example, [c2012-21.3]). If you want to display full texts for violated rules, you will need to create a text file containing MISRA rules, which you will have to pass when calling the script with `--rule-texts` key. Some examples of rule texts files available in [tests directory](https://github.com/danmar/cppcheck/blob/main/addons/test/misra/).
-+ [y2038.py](https://github.com/danmar/cppcheck/blob/main/addons/y2038.py)
- Checks Linux system for [year 2038 problem](https://en.wikipedia.org/wiki/Year_2038_problem) safety. This required [modified environment](https://github.com/3adev/y2038). See complete description [here](https://github.com/danmar/cppcheck/blob/main/addons/doc/y2038.txt).
-+ [threadsafety.py](https://github.com/danmar/cppcheck/blob/main/addons/threadsafety.py)
++ [misra.py](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/misra.py)
+ Used to verify compliance with MISRA C 2012 - a proprietary set of guidelines to avoid such questionable code, developed for embedded systems. Since this standard is proprietary, cppcheck does not display error text by specifying only the number of violated rules (for example, [c2012-21.3]). If you want to display full texts for violated rules, you will need to create a text file containing MISRA rules, which you will have to pass when calling the script with `--rule-texts` key. Some examples of rule texts files available in [tests directory](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/test/misra/).
++ [y2038.py](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/y2038.py)
+ Checks code for [year 2038 problem](https://en.wikipedia.org/wiki/Year_2038_problem) safety. See complete description [here](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/doc/y2038.md).
++ [threadsafety.py](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/threadsafety.py)
Analyse Cppcheck dump files to locate threadsafety issues like static local objects used by multiple threads.
-+ [naming.py](https://github.com/danmar/cppcheck/blob/main/addons/naming.py)
++ [naming.py](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/naming.py)
Enforces naming conventions across the code.
-+ [namingng.py](https://github.com/danmar/cppcheck/blob/main/addons/namingng.py)
++ [namingng.py](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/namingng.py)
Enforces naming conventions across the code. Enhanced version with support for type prefixes in variable and function names.
-+ [findcasts.py](https://github.com/danmar/cppcheck/blob/main/addons/findcasts.py)
++ [findcasts.py](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/findcasts.py)
Locates casts in the code.
-+ [misc.py](https://github.com/danmar/cppcheck/blob/main/addons/misc.py)
++ [misc.py](https://github.com/cppcheck-opensource/cppcheck/blob/main/addons/misc.py)
Performs miscellaneous checks.
### Other files
@@ -50,6 +50,11 @@ Addons are scripts that analyses Cppcheck dump files to check compatibility with
cppcheck --addon=misc src/test.c
```
+For project-wide analysis with compile_commands.json:
+```bash
+cppcheck --project=build/compile_commands.json --addon=y2038
+```
+
It is also possible to call scripts as follows:
```bash
cppcheck --dump --quiet src/test.c
@@ -63,5 +68,5 @@ This allows you to add additional parameters when calling the script (for exampl
When using the graphical interface `cppcheck-gui`, the selection and configuration of addons is carried out on the tab `Addons and tools` in the project settings (`Edit Project File`):
-
+
diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py
index 88a4d8cb157..06028e2005c 100755
--- a/addons/cppcheckdata.py
+++ b/addons/cppcheckdata.py
@@ -166,7 +166,7 @@ class ValueType:
Attributes:
type nonstd/pod/record/smart-pointer/container/iterator/void/bool/char/short/wchar_t/int/long/long long/unknown int/float/double/long double
sign signed/unsigned
- bits
+ bits bit count for bit-fields, otherwise None
pointer
constness
reference
@@ -178,7 +178,7 @@ class ValueType:
type = None
sign = None
- bits = 0
+ bits = None
constness = 0
pointer = 0
typeScopeId = None
@@ -188,7 +188,8 @@ class ValueType:
def __init__(self, element):
self.type = element.get('valueType-type')
self.sign = element.get('valueType-sign')
- self.bits = int(element.get('valueType-bits', 0))
+ self.bits = element.get('valueType-bits', None)
+ self.bits = int(self.bits) if self.bits else None
self.pointer = int(element.get('valueType-pointer', 0))
self.constness = int(element.get('valueType-constness', 0))
self.reference = element.get('valueType-reference')
@@ -262,6 +263,7 @@ class Token:
isComplex
isRestrict
isAttributeExport
+ isAnonymous
varId varId for token, each variable has a unique non-zero id
exprId exprId for token, each expression has a unique non-zero id
variable Variable information for this token. See the Variable class.
@@ -272,7 +274,7 @@ class Token:
astParent ast parent
astOperand1 ast operand1
astOperand2 ast operand2
- orriginalName orriginal name of the token
+ orriginalName original name of the token
valueType type information: container/..
file file name
linenr line number
@@ -323,6 +325,7 @@ class Token:
isComplex = False
isRestrict = False
isAttributeExport = False
+ isAnonymous = False
exprId = None
varId = None
variableId = None
@@ -406,6 +409,8 @@ def __init__(self, element):
self.isRestrict = True
if element.get('isAttributeExport'):
self.isAttributeExport = True
+ if element.get('isAnonymous'):
+ self.isAnonymous = True
self.linkId = element.get('link')
self.link = None
if element.get('varId'):
@@ -439,7 +444,7 @@ def __repr__(self):
"isChar", "isBoolean", "isOp", "isArithmeticalOp", "isAssignmentOp",
"isComparisonOp", "isLogicalOp", "isCast", "externLang", "isExpandedMacro",
"isRemovedVoidParameter", "isSplittedVarDeclComma", "isSplittedVarDeclEq",
- "isImplicitInt", "isComplex", "isRestrict", "isAttributeExport", "linkId",
+ "isImplicitInt", "isComplex", "isRestrict", "isAttributeExport", "isAnonymous", "linkId",
"varId", "variableId", "functionId", "valuesId", "valueType",
"typeScopeId", "astParentId", "astOperand1Id", "file",
"linenr", "column"]
@@ -998,7 +1003,7 @@ def isMatch(self, file, line, message, errorId):
and (self.symbolName is None or fnmatch(message, '*'+self.symbolName+'*'))
and fnmatch(errorId, self.errorId)):
return True
- # Other Suppression (Globaly set via suppression file or cli command)
+ # Other Suppression (Globally set via suppression file or cli command)
if ((self.fileName is None or fnmatch(file, self.fileName))
and (self.suppressionType is None)
and (self.symbolName is None or fnmatch(message, '*'+self.symbolName+'*'))
@@ -1336,7 +1341,7 @@ def iterconfigurations(self):
# Parse tokens
elif node.tag == 'tokenlist' and event == 'start':
continue
- elif node.tag == 'token' and event == 'start' and not iter_directive:
+ elif node.tag == 'token' and event == 'start' and not iter_directive and not iter_typedef_info:
cfg.tokenlist.append(Token(node))
# Parse scopes
diff --git a/addons/doc/y2038.md b/addons/doc/y2038.md
new file mode 100644
index 00000000000..5566c3936ba
--- /dev/null
+++ b/addons/doc/y2038.md
@@ -0,0 +1,166 @@
+# README of the Y2038 cppcheck addon
+
+## Contents
+
+- [README of the Y2038 cppcheck addon](#readme-of-the-y2038-cppcheck-addon)
+ - [Contents](#contents)
+ - [What is Y2038?](#what-is-y2038)
+ - [What is the Y2038 cppcheck addon?](#what-is-the-y2038-cppcheck-addon)
+ - [How does the Y2038 cppcheck addon work?](#how-does-the-y2038-cppcheck-addon-work)
+ - [Primary Usage: Cppcheck Addon Integration (`y2038.py`)](#primary-usage-cppcheck-addon-integration-y2038py)
+ - [Implementation Details](#implementation-details)
+ - [Requirements](#requirements)
+ - [How to use the Y2038 cppcheck addon](#how-to-use-the-y2038-cppcheck-addon)
+ - [**Auditing Your Project for Y2038 Compliance**](#auditing-your-project-for-y2038-compliance)
+ - [**CI/CD Integration**](#cicd-integration)
+ - [Testing](#testing)
+ - [Running Y2038 Addon Tests](#running-y2038-addon-tests)
+ - [Test Coverage](#test-coverage)
+ - [Test Structure](#test-structure)
+
+---
+
+## What is Y2038?
+
+In a few words:
+
+Most operating systems and programming environments represent the current time as the number of seconds since the Unix epoch. In C and C++ this is exposed by time() and std::time(), with the Unix epoch defined as 00:00:00 UTC on 1 January 1970.
+
+Typically this representation is stored as a 64-bit signed quantity.
+Some systems, mainly embedded systems and older systems, still use a 32-bit signed
+time_t representation.
+
+On January 19th, 2038 at 03:14:07 GMT, such 32-bit representations will reach
+their maximum positive value.
+
+What happens then is unpredictable: system time might roll back to December
+13th, 1901 at 19:55:13, or it might keep running on until February 7th, 2106
+at 06:28:15 GMT, or the computer may freeze, or just about anything you can
+think of, plus a few ones you can't.
+
+The workaround for this is to switch to a 64-bit signed representation of time
+as seconds from the Unix epoch. This representation will work for more than 250
+billion years.
+
+Working around Y2038 requires fixing the Linux kernel, the C libraries, and
+any user code around which uses 32-bit epoch representations.
+
+There is Y2038-proofing work in progress on the Linux and GNU glibc front.
+
+## What is the Y2038 cppcheck addon?
+
+The Y2038 cppcheck addon is a tool to help detect code which might need fixing
+because it is Y2038-unsafe. This may be because it uses types or functions from
+GNU libc or from the Linux kernel which are known not to be Y2038-proof.
+
+## How does the Y2038 cppcheck addon work?
+
+The Y2038 addon is a comprehensive tool designed to audit your project for Y2038 compliance. It provides a streamlined, intelligent approach to Y2038 analysis.
+
+### Primary Usage: Cppcheck Integration with Project Files
+
+The Y2038 addon integrates seamlessly with cppcheck's core project parsing infrastructure. For optimal analysis, use the addon with project files:
+
+```bash
+cppcheck --project=build/compile_commands.json --addon=y2038
+```
+
+For single files, you can also use:
+```bash
+cppcheck --addon=y2038 source_file.c
+```
+
+#### Implementation Details
+
+The addon leverages cppcheck's built-in project parsing capabilities:
+
+- **Core Integration**: Y2038-related compiler flags are extracted by cppcheck core during project parsing and passed through dump file configuration
+- **Automatic Flag Detection**: Cppcheck automatically detects Y2038-relevant flags (`-D_TIME_BITS=64`, `-D_FILE_OFFSET_BITS=64`, `-D_USE_TIME_BITS64`) from compilation commands
+- **Clean Architecture**: No redundant file parsing - cppcheck handles project files once, addon focuses on analysis
+- **Priority Logic**: Dump file configuration (from cppcheck's project parsing) takes precedence over source code `#define` statements
+- **Source Fallback**: When no project configuration is available, the addon analyzes source code `#define` statements
+
+This architecture ensures optimal performance and maintains clean separation of concerns between cppcheck core (project parsing) and addon (analysis logic).
+
+The output is the standard Cppcheck analysis report, focused on Y2038-related issues.
+
+## Requirements
+
+The Y2038 addon works with any cppcheck installation and requires no additional dependencies beyond cppcheck itself.
+
+For optimal Y2038 analysis, ensure your project uses a supported build system that generates `compile_commands.json`:
+
+- **CMake**: Use `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`
+- **Bear**: For Make/Autotools projects, use `bear` to generate compile commands
+- **Ninja**: Use `ninja -t compdb` to generate compile commands
+- **Bazel**: Use `bazel aquery` with appropriate flags
+
+If using `bear` for Make-based projects, install it via your package manager:
+
+```bash
+# On Debian/Ubuntu
+sudo apt-get install bear
+
+# On Fedora
+sudo dnf install bear
+
+# On macOS (using Homebrew)
+brew install bear
+```
+
+## How to use the Y2038 cppcheck addon
+
+### **Auditing Your Project for Y2038 Compliance**
+
+The Y2038 addon seamlessly integrates with your existing cppcheck workflow.
+
+**For projects with compile_commands.json (recommended):**
+
+```bash
+cppcheck --project=build/compile_commands.json --addon=y2038
+```
+
+**For single file analysis:**
+
+```bash
+cppcheck --addon=y2038 source_file.c
+```
+
+**For project-wide analysis without compile_commands.json:**
+
+```bash
+cppcheck --addon=y2038 src/
+```
+
+The integration automatically:
+
+1. **Extracts Y2038 flags** from your project's compilation commands via cppcheck's project parsing
+2. **Passes flag information** through dump file configuration to the addon
+3. **Analyzes source code** with proper Y2038 context from both build system and source directives
+4. **Reports Y2038 issues** using cppcheck's standard error reporting format
+
+### **CI/CD Integration**
+
+For CI/CD integration, use the Y2038 addon with your project's build configuration:
+
+```sh
+# Example CI script with compile_commands.json
+#!/bin/bash
+# Generate compile_commands.json (if not already available)
+cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build
+# or: bear -- make
+
+# Run Y2038 analysis
+cppcheck --project=build/compile_commands.json --addon=y2038 --error-exitcode=1
+
+# The addon will return a non-zero exit code if Y2038 issues are found.
+# The output is the standard Cppcheck report.
+```
+
+**For projects without compile_commands.json:**
+
+```sh
+# Example CI script for source-only analysis
+#!/bin/bash
+cppcheck --addon=y2038 --error-exitcode=1 src/
+```
diff --git a/addons/doc/y2038.txt b/addons/doc/y2038.txt
deleted file mode 100644
index 990b24bd483..00000000000
--- a/addons/doc/y2038.txt
+++ /dev/null
@@ -1,151 +0,0 @@
-README of the Y2038 cppcheck addon
-==================================
-
-Contents
-
-1. What is Y2038?
-2. What is the Y2038 cppcheck addon?
-3. How does the Y2038 cppcheck addon work?
-4. How to use the Y2038 cppcheck addon
-
----
-
-1. What is Y2038?
-
-In a few words:
-
-In Linux, the current date and time is kept as the number of seconds elapsed
-since the Unix epoch, that is, since January 1st, 1970 at 00:00:00 GMT.
-
-Most of the time, this representation is stored as a 32-bit signed quantity.
-
-On January 19th, 2038 at 03:14:07 GMT, such 32-bit representations will reach
-their maximum positive value.
-
-What happens then is unpredictable: system time might roll back to December
-13th, 1901 at 19:55:13, or it might keep running on until February 7th, 2106
-at 06:28:15 GMT, or the computer may freeze, or just about anything you can
-think of, plus a few ones you can't.
-
-The workaround for this is to switch to a 64-bit signed representation of time
-as seconds from the Unix epoch. This representation will work for more than 250
-billion years.
-
-Working around Y2038 requires fixing the Linux kernel, the C libraries, and
-any user code around which uses 32-bit epoch representations.
-
-There is Y2038-proofing work in progress on the Linux and GNU glibc front.
-
-2. What is the Y2038 cppcheck addon?
-
-The Y2038 cppcheck addon is a tool to help detect code which might need fixing
-because it is Y2038-unsafe. This may be because it uses types or functions from
-GNU libc or from the Linux kernel which are known not to be Y2038-proof.
-
-3. How does the Y2038 cppcheck addon work?
-
-The Y2038 cppcheck addon takes XML dumps produced by cppcheck from source code
-files and looks for the names of types or functions which are known to be Y2038-
-unsafe, and emits diagnostics whenever it finds one.
-
-Of course, this is of little use if your code uses a Y2038-proof glibc and
-correctly configured Y2038-proof time support.
-
-This is why y2038.py takes into account two preprocessor directives:
-_TIME_BITS and __USE_TIME_BITS64.
-
-_TIME_BITS is defined equal to 64 by user code when it wants 64-bit time
-support from the GNU glibc. Code which does not define _TIME_BITS equal to 64
-(or defines it to something else than 64) runs a risk of not being Y2038-proof.
-
-__USE_TIME_BITS64 is defined by the GNU glibc when it actually provides 64-bit
-time support. When this is defined, then all glibc symbols, barring bugs, are
-Y2038-proof (but your code might have its own Y2038 bugs, if it handles signed
-32-bit Unix epoch values).
-
-The Y2038 cppcheck performs the following checks:
-
- 1. Upon meeting a definition for _TIME_BITS, if that definition does not
- set it equal to 64, this error diagnostic is emitted:
-
- Error: _TIME_BITS must be defined equal to 64
-
- This case is very unlikely but might result from a typo, so pointing
- it out is quite useful. Note that definitions of _TIME_BITS as an
- expression evaluating to 64 will be flagged too.
-
- 2. Upon meeting a definition for _USE_TIME_BITS64, if _TIME_BITS is not
- defined equal to 64, this information diagnostic is emitted:
-
- Warning: _USE_TIME_BITS64 is defined but _TIME_BITS was not
-
- This reflects the fact that even though the glibc checked default to
- 64-bit time support, this was not requested by the user code, and
- therefore the user code might fail Y2038 if built against a glibc
- which defaults to 32-bit time support.
-
- 3. Upon meeting a symbol (type or function) which is known to be Y2038-
- unsafe, if _USE_TIME_BITS64 is undefined or _TIME_BITS not properly
- defined, this warning diagnostic is emitted:
-
- Warning: is Y2038-unsafe
-
- This reflects the fact that the user code is referring to a symbol
- which, when glibc defaults to 32-bit time support, might fail Y2038.
-
-General note: y2038.py will handle multiple configurations, and will
-emit diagnostics for each configuration in turn.
-
-4. How to use the Y2038 cppcheck addon
-
-The Y2038 cppcheck addon is used like any other cppcheck addon:
-
- cppcheck --dump file1.c [ file2.c [...]]]
- y2038.py file1.c [ file2.c [...]]]
-
-Sample test C file is provided:
-
- test/y2038-test-1-bad-time-bits.c
- test/y2038-test-2-no-time-bits.c
- test/y2038-test-3-no-use-time-bits.c
- test/y2038-test-4-good.c
-
-These cover the cases described above. You can run them through cppcheck
-and y2038.py to see for yourself how the addon diagnostics look like. If
-this README is not outdated (and if it is, feel free to submit a patch),
-you can run cppcheck on these files as on any others:
-
- cppcheck --dump addons/y2038/test/y2038-*.c
- y2038.py addons/y2038/test/y2038-*.dump
-
-If you have not installed cppcheck yet, you will have to run these
-commands from the root of the cppcheck repository:
-
- make
- sudo make install
- ./cppcheck --dump addons/y2038/test/y2038-*.c
- PYTHONPATH=addons python addons/y2038/y2038.py addons/y2038/test/y2038-*.c.dump
-
-In both cases, y2038.py execution should result in the following:
-
-Checking addons/y2038/test/y2038-test-1-bad-time-bits.c.dump...
-Checking addons/y2038/test/y2038-test-1-bad-time-bits.c.dump, config ""...
-Checking addons/y2038/test/y2038-test-2-no-time-bits.c.dump...
-Checking addons/y2038/test/y2038-test-2-no-time-bits.c.dump, config ""...
-Checking addons/y2038/test/y2038-test-3-no-use-time-bits.c.dump...
-Checking addons/y2038/test/y2038-test-3-no-use-time-bits.c.dump, config ""...
-Checking addons/y2038/test/y2038-test-4-good.c.dump...
-Checking addons/y2038/test/y2038-test-4-good.c.dump, config ""...
-# Configuration "":
-# Configuration "":
-[addons/y2038/test/y2038-test-1-bad-time-bits.c:8]: (error) _TIME_BITS must be defined equal to 64
-[addons/y2038/test/y2038-inc.h:9]: (warning) _USE_TIME_BITS64 is defined but _TIME_BITS was not
-[addons/y2038/test/y2038-test-1-bad-time-bits.c:10]: (information) addons/y2038/test/y2038-inc.h was included from here
-[addons/y2038/test/y2038-inc.h:9]: (warning) _USE_TIME_BITS64 is defined but _TIME_BITS was not
-[addons/y2038/test/y2038-test-2-no-time-bits.c:8]: (information) addons/y2038/test/y2038-inc.h was included from here
-[addons/y2038/test/y2038-test-3-no-use-time-bits.c:13]: (warning) timespec is Y2038-unsafe
-[addons/y2038/test/y2038-test-3-no-use-time-bits.c:15]: (warning) clock_gettime is Y2038-unsafe
-
-Note: y2038.py recognizes option --template as cppcheck does, including
-pre-defined templates 'gcc', 'vs' and 'edit'. The short form -t is also
-recognized.
diff --git a/addons/misra.py b/addons/misra.py
index 1bb190adeef..7abc99f365a 100755
--- a/addons/misra.py
+++ b/addons/misra.py
@@ -22,7 +22,6 @@
import re
import os
import argparse
-import codecs
import string
import copy
@@ -539,6 +538,20 @@ def is_source_file(file):
return file.endswith('.c')
+def has_prior_function_prototype(cfg, function):
+ """Return whether a global prototype precedes the function definition."""
+ for token in cfg.tokenlist:
+ if token == function.tokenDef:
+ break
+ if token.str != function.name or token.scope.type != 'Global':
+ continue
+ opening = token.next
+ if opening and opening.str == '(' and opening.link and \
+ opening.link.next and opening.link.next.str == ';':
+ return True
+ return False
+
+
def is_header(file):
return file.endswith('.h')
@@ -1823,20 +1836,6 @@ def misra_3_1(self, rawTokens):
self.reportError(token, 3, 1)
break
- def misra_3_2(self, rawTokens):
- for token in rawTokens:
- if token.str.startswith('//'):
- # Check for comment ends with trigraph which might be replaced
- # by a backslash.
- if token.str.endswith('??/'):
- self.reportError(token, 3, 2)
- # Check for comment which has been merged with subsequent line
- # because it ends with backslash.
- # The last backslash is no more part of the comment token thus
- # check if next token exists and compare line numbers.
- elif (token.next is not None) and (token.linenr == token.next.linenr):
- self.reportError(token, 3, 2)
-
def misra_4_1(self, rawTokens):
for token in rawTokens:
if (token.str[0] != '"') and (token.str[0] != '\''):
@@ -2017,7 +2016,7 @@ def misra_6_1(self, data):
for token in data.tokenlist:
if not token.valueType:
continue
- if token.valueType.bits == 0:
+ if token.valueType.bits is None:
continue
if not token.variable:
continue
@@ -2074,7 +2073,9 @@ def misra_7_2(self, data):
self.reportError(token, 7, 2)
def misra_7_3(self, rawTokens):
- compiled = re.compile(r'^[0-9.]+[Uu]*l+[Uu]*$')
+ # Match decimal digits, hex digits, decimal point, and e/E p/P floating
+ # point constant exponent separators.
+ compiled = re.compile(r'^(0[xX])?[0-9a-fA-FpP.]+[Uu]*l+[Uu]*$')
for tok in rawTokens:
if compiled.match(tok.str):
self.reportError(tok, 7, 3)
@@ -2262,6 +2263,8 @@ def misra_8_4(self, cfg):
continue
if func.token != func.tokenDef:
continue
+ if has_prior_function_prototype(cfg, func):
+ continue
if func.tokenDef.str == 'main':
continue
self.reportError(func.tokenDef, 8, 4)
@@ -2473,20 +2476,38 @@ def get_category(essential_type):
if essential_type.split(' ')[0] in ('unsigned', 'signed'):
return essential_type.split(' ')[0]
return None
+
for tok in cfg.tokenlist:
- if tok.isAssignmentOp:
- lhs = getEssentialType(tok.astOperand1)
- rhs = getEssentialType(tok.astOperand2)
- #print(lhs)
- #print(rhs)
- if lhs is None or rhs is None:
+ if not tok.isAssignmentOp:
+ continue
+
+ lhs = getEssentialType(tok.astOperand1)
+ rhs = getEssentialType(tok.astOperand2)
+ if lhs is None or rhs is None:
+ continue
+
+ find_std = cfg.standards.c if cfg.standards and cfg.standards.c else self.stdversion
+
+ rhs_tok = tok.astOperand2
+ rhs_macro_name = rhs_tok.macroName if rhs_tok else None
+ rhs_spelling = rhs_macro_name if rhs_macro_name in ('true', 'false') else rhs_tok.str
+
+ rhs_is_source_bool_literal = rhs_spelling in ('true', 'false')
+ rhs_is_source_int_literal_0_1 = rhs_spelling in ('0', '1')
+
+ if lhs == 'bool':
+ if rhs_is_source_bool_literal:
+ continue
+ if find_std == 'c89' and rhs_is_source_int_literal_0_1:
continue
- lhs_category = get_category(lhs)
- rhs_category = get_category(rhs)
- if lhs_category and rhs_category and lhs_category != rhs_category and rhs_category not in ('signed','unsigned'):
- self.reportError(tok, 10, 3)
- if bitsOfEssentialType(lhs) < bitsOfEssentialType(rhs) and (lhs != "bool" or tok.astOperand2.str not in ('0','1')):
- self.reportError(tok, 10, 3)
+
+ lhs_category = get_category(lhs)
+ rhs_category = get_category(rhs)
+ if lhs_category and rhs_category and lhs_category != rhs_category and rhs_category not in ('signed', 'unsigned'):
+ self.reportError(tok, 10, 3)
+
+ if bitsOfEssentialType(lhs) < bitsOfEssentialType(rhs):
+ self.reportError(tok, 10, 3)
def misra_10_4(self, data):
op = {'+', '-', '*', '/', '%', '&', '|', '^', '+=', '-=', ':'}
@@ -3493,8 +3514,9 @@ def misra_17_3(self, cfg):
# Additional check for implicit function calls in expressions
for token in cfg.tokenlist:
- if token.isName and token.function is None and token.valueType is None:
- if token.next and token.next.str == "(" and token.next.valueType is None:
+ if token.isName and token.scope.type != 'Global' and token.function is None and token.valueType is None:
+ if token.next and token.next.str == "(" and token.next.valueType is None and \
+ isFunctionCall(token.next, cfg.standards.c):
if token.next.next.str == "*" and \
token.next.next.next.isName and token.next.next.next.valueType is not None and \
token.next.next.next.valueType.pointer > 0 :
@@ -4537,7 +4559,7 @@ def loadRuleTexts(self, filename):
encodings = ['ascii', 'utf-8', 'windows-1250', 'windows-1252']
for e in encodings:
try:
- file_stream = codecs.open(filename, 'r', encoding=e)
+ file_stream = open(filename, 'r', encoding=e)
file_stream.readlines()
file_stream.seek(0)
except UnicodeDecodeError:
@@ -4716,7 +4738,7 @@ def fillVerifyExpected(verify_expected, tok):
# data.rawTokens is same for all configurations
if cfgNumber == 0:
self.executeCheck(301, self.misra_3_1, data.rawTokens)
- self.executeCheck(302, self.misra_3_2, data.rawTokens)
+ #self.executeCheck(302, self.misra_3_2, data.rawTokens)
self.executeCheck(401, self.misra_4_1, data.rawTokens)
self.executeCheck(402, self.misra_4_2, data.rawTokens)
self.executeCheck(501, self.misra_5_1, cfg)
diff --git a/addons/test/misra/crash10.c b/addons/test/misra/crash10.c
index 455d86e57ec..65e3a14ac96 100644
--- a/addons/test/misra/crash10.c
+++ b/addons/test/misra/crash10.c
@@ -2,7 +2,7 @@
extern uint32_t end;
-//#define KEEP // if uncomment this then wont crash
+//#define KEEP // if uncomment this then won't crash
KEEP static const int32_t ptr_to_end = &end;
diff --git a/addons/test/misra/misra-regression-prototypes.c b/addons/test/misra/misra-regression-prototypes.c
new file mode 100644
index 00000000000..11ce35c9fa0
--- /dev/null
+++ b/addons/test/misra/misra-regression-prototypes.c
@@ -0,0 +1,13 @@
+int regression_function(int value);
+
+int regression_function(int value)
+{
+ return value;
+}
+
+int main(void)
+{
+ int local_prototype(int value);
+ int (*callback)(int) = regression_function;
+ return callback(0);
+}
\ No newline at end of file
diff --git a/addons/test/misra/misra-test-c11.c b/addons/test/misra/misra-test-c11.c
index 031bc361e5f..aa00b2f0b42 100644
--- a/addons/test/misra/misra-test-c11.c
+++ b/addons/test/misra/misra-test-c11.c
@@ -2,6 +2,7 @@
// ~/cppcheck/cppcheck --dump misra/misra-test-c11.c --std=c11
// ~/cppcheck/cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test-c11.c --std=c11 --platform=unix64 && python3 ../misra.py -verify misra/misra-test-c11.c.dump
+#include
#include
typedef unsigned int UINT_TYPEDEF;
@@ -23,3 +24,15 @@ static void misra6_1_fn(void) {
struct_with_bitfields s;
s.h = 61;
}
+
+static void misra_10_3_c11(void) {
+ bool b = false;
+ bool b0 = 0; // 10.3
+ bool b1 = 1; // 10.3
+ bool bf = false; // no-warning
+ bool bt = true; // no-warning
+ b = 0; // 10.3
+ b = 1; // 10.3
+ b = false; // no-warning
+ b = true; // no-warning
+}
diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c
index a1ccb8c4dee..6b6f52342aa 100644
--- a/addons/test/misra/misra-test.c
+++ b/addons/test/misra/misra-test.c
@@ -121,22 +121,6 @@ static void misra_2_7_b(int a, int b, int c, // 2.7
static void misra_2_7_c(int a, ...) { (void)a; }
static void misra_2_7_d(int) { } // 2.7 8.2
-static void misra_3_2(int enable)
-{
- // This won't generate a violation because of subsequent blank line \
-
- int y = 0;
- int x = 0; // 3.2 non-compliant comment ends with backslash \
- if (enable != 0)
- {
- ++x; // This is always executed
- // 3.2 potentially non-compliant comment ends with trigraph resolved to backslash ??/
- ++y; // This is hidden if trigraph replacement is active
- }
-
- (void)printf("x=%i, y=%i\n", x, y); //21.6
-}
-
extern int misra_5_1_extern_var_hides_var_x;
extern int misra_5_1_extern_var_hides_var_y; //5.1
int misra_5_1_var_hides_var________a; // 8.4
@@ -302,6 +286,20 @@ struct misra_7_3_s
{
uint32_t ul_clka;
uint32_t test123l;
+ float t = 6.02E23l; // 7.3
+ float t1 = 6.02E23L;
+ float u = 0xa1B2.p12l; // 7.3
+ float u1 = 0xa1B2.p12L;
+ float v = 0xa1B2.P12l; // 7.3
+ float v1 = 0xa1B2.P12L;
+ float w = 6.02e23l; // 7.3
+ float w1 = 6.02e23L;
+ unsigned long x = 0xabcul; // 7.3
+ unsigned long x1 = 0xabcuL;
+ unsigned long y = 0xABCUl; // 7.3
+ unsigned long y1 = 0xABCUL;
+ unsigned long z = 0XdeadBeEfUl; // 7.3
+ unsigned long z1 = 0XdeadBeEfUL;
};
static void misra_7_3(void) {
@@ -727,7 +725,11 @@ static void misra_10_3(uint32_t u32a, uint32_t u32b) {
res = 0.1f; // 10.3
const char c = '0'; // no-warning
bool b = true; // no-warning
- uint32_t u = UINT32_C(10); // 17.3 no-warning
+ uint32_t u = UINT32_C(10); // no-warning
+ bool b0 = 0; // no-warning
+ bool b1 = 1; // no-warning
+ b = 0; // no-warning
+ b = 1; // no-warning
}
static void misra_10_4(u32 x, s32 y) {
diff --git a/addons/test/misra_test.py b/addons/test/misra_test.py
index 55a24cb4b27..dc46d8beef8 100644
--- a/addons/test/misra_test.py
+++ b/addons/test/misra_test.py
@@ -11,6 +11,7 @@
from addons.misra import C11_STDLIB_IDENTIFIERS, C99_STDLIB_IDENTIFIERS,C90_STDLIB_IDENTIFIERS, isStdLibId, isKeyword
TEST_SOURCE_FILES = [os.path.join('addons','test','misra','misra-test.c')]
+REGRESSION_SOURCE_FILE = os.path.join('addons', 'test', 'misra', 'misra-regression-prototypes.c')
def remove_misra_config(s:str):
@@ -93,6 +94,20 @@ def test_json_out(checker, capsys, test_files):
assert("Required" in json_output['c2012-21.3'][0]['extra'])
assert("Advisory" in json_output['c2012-20.1'][0]['extra'])
+def test_function_prototype_and_pointer_call_regressions(checker, capsys):
+ dump_create(REGRESSION_SOURCE_FILE)
+ sys.argv.append("--cli")
+ try:
+ checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
+ checker.parseDump(REGRESSION_SOURCE_FILE + ".dump")
+ captured = capsys.readouterr().out
+ json_output = convert_json_output(captured.splitlines())
+ assert "c2012-8.4" not in json_output
+ assert "c2012-17.3" not in json_output
+ finally:
+ sys.argv.remove("--cli")
+ dump_remove(REGRESSION_SOURCE_FILE)
+
def test_rules_cppcheck_severity(checker, capsys, test_files):
checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
diff --git a/addons/test/y2038/y2038-test-compiler-flags.c b/addons/test/y2038/y2038-test-compiler-flags.c
new file mode 100644
index 00000000000..99baa0e1582
--- /dev/null
+++ b/addons/test/y2038/y2038-test-compiler-flags.c
@@ -0,0 +1,25 @@
+/*
+ * Shared test case for Y2038 addon compiler flag testing
+ *
+ * This file tests various compiler flag scenarios:
+ * - Proper Y2038 configuration: -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 -D_USE_TIME_BITS64
+ * - Incorrect _TIME_BITS value: -D_TIME_BITS=32
+ * - Incomplete configuration: -D_USE_TIME_BITS64 (without _TIME_BITS)
+ *
+ * The same source code is used for all scenarios - differentiation happens
+ * through the compiler flags passed to cppcheck during dump creation.
+ */
+
+#include
+
+int main(int argc, char **argv)
+{
+ time_t current_time;
+ struct timespec ts;
+
+ current_time = time(NULL);
+ clock_gettime(CLOCK_REALTIME, &ts);
+
+ return 0;
+}
+
diff --git a/addons/test/y2038_test.py b/addons/test/y2038_test.py
index 282e55650d7..861b006d8bf 100644
--- a/addons/test/y2038_test.py
+++ b/addons/test/y2038_test.py
@@ -21,18 +21,28 @@
'./addons/test/y2038/y2038-test-4-good.c',
'./addons/test/y2038/y2038-test-5-good-no-time-used.c']
+# Build system test file (for testing build system integration)
+BUILD_SYSTEM_TEST_FILE = './addons/test/y2038/y2038-test-buildsystem.c'
+
def setup_module(module):
sys.argv.append("--cli")
+
+ # Create dumps for regular test files
for f in TEST_SOURCE_FILES:
dump_create(f)
+ # For build system tests, we'll create dumps on-demand in each test
+ # to avoid conflicts from multiple dump_create calls on the same file
+
def teardown_module(module):
sys.argv.remove("--cli")
for f in TEST_SOURCE_FILES:
dump_remove(f)
+ # Build system test dumps are cleaned up individually in each test method
+
def test_1_bad_time_bits(capsys):
is_safe = check_y2038_safe('./addons/test/y2038/y2038-test-1-bad-time-bits.c.dump', quiet=True)
@@ -107,6 +117,31 @@ def test_5_good(capsys):
assert(len([c for c in unsafe_calls if c['file'].endswith('.c')]) == 0)
+def test_build_system_integration():
+ """Test that Y2038 flags are properly parsed from cppcheck dump file configuration"""
+ from addons.y2038 import parse_dump_config
+
+ # Test Y2038-safe configuration string (as cppcheck would generate it)
+ config_string = "_TIME_BITS=64;_FILE_OFFSET_BITS=64;_USE_TIME_BITS64"
+ result = parse_dump_config(config_string)
+ # Y2038-safe flags should be detected
+ assert result['time_bits_defined'] is True
+ assert result['time_bits_value'] == 64
+ assert result['use_time_bits64_defined'] is True
+ assert result['file_offset_bits_defined'] is True
+ assert result['file_offset_bits_value'] == 64
+
+ # Test partial Y2038 configuration
+ partial_config = "_TIME_BITS=32;_FILE_OFFSET_BITS=64"
+ result = parse_dump_config(partial_config)
+ # Should detect the flags with their actual values
+ assert result['time_bits_defined'] is True
+ assert result['time_bits_value'] == 32 # Not Y2038-safe value
+ assert result['use_time_bits64_defined'] is False
+ assert result['file_offset_bits_defined'] is True
+ assert result['file_offset_bits_value'] == 64
+
+
def test_arguments_regression():
args_ok = ["-t=foo", "--template=foo",
"-q", "--quiet",
@@ -137,4 +172,35 @@ def test_arguments_regression():
pytest.fail("Unexpected SystemExit with '%s'" % arg)
sys.argv.remove(arg)
finally:
- sys.argv = sys_argv_old
\ No newline at end of file
+ sys.argv = sys_argv_old
+
+
+def test_parse_dump_config():
+ """Test the parse_dump_config function for cppcheck dump file integration"""
+ from addons.y2038 import parse_dump_config
+
+ # Test comprehensive Y2038 configuration
+ full_config = "_TIME_BITS=64;_FILE_OFFSET_BITS=64;_USE_TIME_BITS64;OTHER_FLAG=1"
+ result = parse_dump_config(full_config)
+
+ assert result['time_bits_defined'] is True
+ assert result['time_bits_value'] == 64
+ assert result['use_time_bits64_defined'] is True
+ assert result['file_offset_bits_defined'] is True
+ assert result['file_offset_bits_value'] == 64
+
+ # Test empty configuration
+ result = parse_dump_config("")
+ assert result['time_bits_defined'] is False
+ assert result['time_bits_value'] is None
+ assert result['use_time_bits64_defined'] is False
+ assert result['file_offset_bits_defined'] is False
+ assert result['file_offset_bits_value'] is None
+ # Test Y2038-unsafe configuration
+ unsafe_config = "_TIME_BITS=32;_FILE_OFFSET_BITS=32"
+ result = parse_dump_config(unsafe_config)
+ assert result['time_bits_defined'] is True
+ assert result['time_bits_value'] == 32
+ assert result['use_time_bits64_defined'] is False
+ assert result['file_offset_bits_defined'] is True
+ assert result['file_offset_bits_value'] == 32
\ No newline at end of file
diff --git a/addons/threadsafety.py b/addons/threadsafety.py
index 9475e1a5b0d..390a245d4e1 100755
--- a/addons/threadsafety.py
+++ b/addons/threadsafety.py
@@ -111,6 +111,8 @@
'cuserid',
'drand48',
'ecvt',
+ 'elf_fill',
+ 'elf_flagelf',
'encrypt',
'endfsent',
'endgrent',
diff --git a/addons/y2038.py b/addons/y2038.py
index 93d237afd06..b17d41dd330 100755
--- a/addons/y2038.py
+++ b/addons/y2038.py
@@ -2,14 +2,33 @@
#
# cppcheck addon for Y2038 safeness detection
#
+# This addon provides comprehensive Y2038 (Year 2038 Problem) detection for C/C++ code.
+# It extracts compiler flags from cppcheck dump file configuration to determine
+# Y2038 safety, suppressing warnings when proper configuration is detected.
+#
+# Key Features:
+# - Extraction of Y2038-related flags from cppcheck dump file configuration
+# - Compiler flag parsing and validation from cppcheck's project parsing
+# - Warning suppression when proper Y2038 configuration is found
+# - Support for both _TIME_BITS=64 and _FILE_OFFSET_BITS=64 requirements
+# - Priority-based flag resolution (dump file configuration > source code directives)
+#
# Detects:
#
# 1. _TIME_BITS being defined to something else than 64 bits
-# 2. _USE_TIME_BITS64 being defined when _TIME_BITS is not
-# 3. Any Y2038-unsafe symbol when _USE_TIME_BITS64 is not defined.
+# 2. _FILE_OFFSET_BITS being defined to something else than 64 bits
+# 3. _USE_TIME_BITS64 being defined when _TIME_BITS is not
+# 4. Any Y2038-unsafe symbol when proper Y2038 configuration is not present
+# 5. Dump file configurations that affect Y2038 safety
+#
+# Warning Suppression:
+# When both _TIME_BITS=64 AND _FILE_OFFSET_BITS=64 are detected (prioritizing dump file
+# configuration over source code directives), Y2038 warnings are suppressed and an
+# informational message is displayed instead.
#
# Example usage:
# $ cppcheck --addon=y2038 path-to-src/test.c
+# $ cppcheck --dump file.c && python3 y2038.py file.c.dump
#
from __future__ import print_function
@@ -18,13 +37,23 @@
import sys
import re
+# Y2038 flags are extracted by cppcheck core during project parsing
+# and passed through dump file configuration - no redundant parsing needed
+
+# --------------------------------
+# Y2038 safety constants
+# --------------------------------
+
+# Y2038-safe bit values
+Y2038_SAFE_TIME_BITS = 64
+Y2038_SAFE_FILE_OFFSET_BITS = 64
# --------------------------------------------
# #define/#undef detection regular expressions
# --------------------------------------------
# test for '#define _TIME_BITS 64'
-re_define_time_bits_64 = re.compile(r'^\s*#\s*define\s+_TIME_BITS\s+64\s*$')
+re_define_time_bits_64 = re.compile(rf'^\s*#\s*define\s+_TIME_BITS\s+{Y2038_SAFE_TIME_BITS}\s*$')
# test for '#define _TIME_BITS ...' (combine w/ above to test for 'not 64')
re_define_time_bits = re.compile(r'^\s*#\s*define\s+_TIME_BITS\s+.*$')
@@ -38,6 +67,34 @@
# test for '#undef _USE_TIME_BITS64' (if it ever happens)
re_undef_use_time_bits64 = re.compile(r'^\s*#\s*undef\s+_USE_TIME_BITS64\s*$')
+# test for '#define _FILE_OFFSET_BITS 64'
+re_define_file_offset_bits_64 = re.compile(rf'^\s*#\s*define\s+_FILE_OFFSET_BITS\s+{Y2038_SAFE_FILE_OFFSET_BITS}\s*$')
+
+# test for '#define _FILE_OFFSET_BITS ...' (combine w/ above to test for 'not 64')
+re_define_file_offset_bits = re.compile(r'^\s*#\s*define\s+_FILE_OFFSET_BITS\s+.*$')
+
+# test for '#undef _FILE_OFFSET_BITS' (if it ever happens)
+re_undef_file_offset_bits = re.compile(r'^\s*#\s*undef\s+_FILE_OFFSET_BITS\s*$')
+
+# --------------------------------------------
+# Compiler flag parsing regular expressions
+# --------------------------------------------
+
+# test for '_TIME_BITS=64' in compiler flags
+re_flag_time_bits_64 = re.compile(rf'_TIME_BITS={Y2038_SAFE_TIME_BITS}(?:\s|$|;)')
+
+# test for '_TIME_BITS=...' in compiler flags (combine w/ above to test for 'not 64')
+re_flag_time_bits = re.compile(r'_TIME_BITS=(\d+)')
+
+# test for '_USE_TIME_BITS64' in compiler flags
+re_flag_use_time_bits64 = re.compile(r'_USE_TIME_BITS64(?:\s|$|=|;)')
+
+# test for '_FILE_OFFSET_BITS=64' in compiler flags
+re_flag_file_offset_bits_64 = re.compile(rf'_FILE_OFFSET_BITS={Y2038_SAFE_FILE_OFFSET_BITS}(?:\s|$|;)')
+
+# test for '_FILE_OFFSET_BITS=...' in compiler flags
+re_flag_file_offset_bits = re.compile(r'_FILE_OFFSET_BITS=(\d+)')
+
# --------------------------------
# List of Y2038-unsafe identifiers
# --------------------------------
@@ -147,13 +204,142 @@
}
+
+
+
+
+
+
+
+def parse_dump_config(config_name):
+ """
+ Parse Y2038-related flags from cppcheck dump file configuration name.
+
+ This function analyzes the cppcheck dump file configuration name (which contains
+ preprocessor definitions extracted by cppcheck from project files like compile_commands.json)
+ to extract Y2038-related definitions. It looks for _TIME_BITS, _USE_TIME_BITS64, and
+ _FILE_OFFSET_BITS definitions and validates their values.
+
+ Args:
+ config_name (str): The cppcheck configuration name from dump file
+ (e.g., "_TIME_BITS=64;_FILE_OFFSET_BITS=64")
+
+ Returns:
+ dict: Dictionary containing Y2038-related flag information with keys:
+ - 'time_bits_defined' (bool): Whether _TIME_BITS is defined
+ - 'time_bits_value' (int|None): Value of _TIME_BITS (None if not defined)
+ - 'use_time_bits64_defined' (bool): Whether _USE_TIME_BITS64 is defined
+ - 'file_offset_bits_defined' (bool): Whether _FILE_OFFSET_BITS is defined
+ - 'file_offset_bits_value' (int|None): Value of _FILE_OFFSET_BITS (None if not defined)
+
+ Example:
+ >>> parse_dump_config("_TIME_BITS=64;_FILE_OFFSET_BITS=64")
+ {
+ 'time_bits_defined': True,
+ 'time_bits_value': 64,
+ 'use_time_bits64_defined': False,
+ 'file_offset_bits_defined': True,
+ 'file_offset_bits_value': 64
+ }
+ """
+ result = {
+ 'time_bits_defined': False,
+ 'time_bits_value': None,
+ 'use_time_bits64_defined': False,
+ 'file_offset_bits_defined': False,
+ 'file_offset_bits_value': None
+ }
+
+ if not config_name:
+ return result
+
+ try:
+ # Check for _TIME_BITS=64 (correct value)
+ if re_flag_time_bits_64.search(config_name):
+ result['time_bits_defined'] = True
+ result['time_bits_value'] = Y2038_SAFE_TIME_BITS
+ else:
+ # Check for _TIME_BITS=other_value
+ match = re_flag_time_bits.search(config_name)
+ if match:
+ result['time_bits_defined'] = True
+ try:
+ result['time_bits_value'] = int(match.group(1))
+ except (ValueError, IndexError):
+ # Malformed _TIME_BITS value, treat as undefined
+ result['time_bits_defined'] = False
+ result['time_bits_value'] = None
+
+ # Check for _USE_TIME_BITS64
+ if re_flag_use_time_bits64.search(config_name):
+ result['use_time_bits64_defined'] = True
+
+ # Check for _FILE_OFFSET_BITS=64 (correct value)
+ if re_flag_file_offset_bits_64.search(config_name):
+ result['file_offset_bits_defined'] = True
+ result['file_offset_bits_value'] = Y2038_SAFE_FILE_OFFSET_BITS
+ else:
+ # Check for _FILE_OFFSET_BITS=other_value
+ match = re_flag_file_offset_bits.search(config_name)
+ if match:
+ result['file_offset_bits_defined'] = True
+ try:
+ result['file_offset_bits_value'] = int(match.group(1))
+ except (ValueError, IndexError):
+ # Malformed _FILE_OFFSET_BITS value, treat as undefined
+ result['file_offset_bits_defined'] = False
+ result['file_offset_bits_value'] = None
+
+ except (AttributeError, TypeError, ValueError):
+ # If any unexpected error occurs during parsing, return empty result
+ # This ensures the addon continues to work even with malformed configurations
+ # Note: We catch specific exceptions rather than broad Exception for better debugging
+ pass
+
+ return result
+
+
def check_y2038_safe(dumpfile, quiet=False):
+ """
+ Main function to check Y2038 safety of C/C++ code from cppcheck dump files.
+
+ This function performs comprehensive Y2038 analysis including:
+ 1. Extraction of Y2038-related compiler flags from cppcheck dump file configuration
+ 2. Analysis of source code preprocessor directives
+ 3. Warning suppression when proper Y2038 configuration is detected
+ 4. Reporting of Y2038-unsafe symbols and configurations
+
+ The function implements a priority-based approach for Y2038 flag detection:
+ - Dump file configuration (from cppcheck's project parsing - highest priority)
+ - Source code #define directives (fallback)
+
+ Warning suppression occurs when both _TIME_BITS=64 AND _FILE_OFFSET_BITS=64
+ are detected from any source. When warnings are suppressed, an informational
+ message is displayed indicating the configuration source and suppression count.
+
+ Args:
+ dumpfile (str): Path to the cppcheck XML dump file (.dump extension)
+ quiet (bool, optional): If True, suppress informational messages. Defaults to False.
+
+ Returns:
+ bool: True if code is Y2038-safe, False if Y2038 issues were detected
+
+ Raises:
+ Exception: May raise exceptions from cppcheckdata parsing or file I/O operations
+
+ Example:
+ >>> check_y2038_safe("test.c.dump") # Normal operation
+ True
+ >>> check_y2038_safe("test.c.dump", quiet=True) # Suppress info messages
+ False
+ """
# Assume that the code is Y2038 safe until proven otherwise
y2038safe = True
# load XML from .dump file
data = cppcheckdata.CppcheckData(dumpfile)
srcfile = data.files[0]
+
for cfg in data.iterconfigurations():
if not quiet:
print('Checking %s, config %s...' % (srcfile, cfg.name))
@@ -162,56 +348,231 @@ def check_y2038_safe(dumpfile, quiet=False):
time_bits_defined = False
srclinenr = 0
+ # Priority-based flag detection: dump file configuration > source code directives
+ # 1. Check dump file configuration (from cppcheck's project parsing - highest priority)
+ dump_config_flags = parse_dump_config(cfg.name)
+ # Initialize effective flags with dump file configuration
+ effective_flags = {
+ 'time_bits_defined': dump_config_flags['time_bits_defined'],
+ 'time_bits_value': dump_config_flags['time_bits_value'],
+ 'use_time_bits64_defined': dump_config_flags['use_time_bits64_defined'],
+ 'file_offset_bits_defined': dump_config_flags['file_offset_bits_defined'],
+ 'file_offset_bits_value': dump_config_flags['file_offset_bits_value']
+ }
+
+ # Determine configuration source for reporting
+ config_source = None
+ has_dump_config = (dump_config_flags['time_bits_defined'] or
+ dump_config_flags['file_offset_bits_defined'] or
+ dump_config_flags['use_time_bits64_defined'])
+ if has_dump_config:
+ config_source = "cppcheck configuration"
+
+ # Track time_bits_defined for _USE_TIME_BITS64 validation
+ time_bits_defined = effective_flags['time_bits_defined']
+
+ # Check effective _TIME_BITS value (from dump file configuration)
+ if effective_flags['time_bits_defined']:
+ if effective_flags['time_bits_value'] != Y2038_SAFE_TIME_BITS:
+ fake_directive = type('FakeDirective', (), {
+ 'file': srcfile, 'linenr': 0, 'column': 0,
+ 'str': 'cppcheck configuration: _TIME_BITS=%s' % effective_flags['time_bits_value']
+ })()
+ cppcheckdata.reportError(fake_directive, 'error',
+ '_TIME_BITS must be defined equal to 64 (found in cppcheck configuration: _TIME_BITS=%s)' % effective_flags['time_bits_value'],
+ 'y2038',
+ 'type-bits-not-64')
+ y2038safe = False
+
+ # Check effective _FILE_OFFSET_BITS value (from dump file configuration)
+ if effective_flags['file_offset_bits_defined']:
+ if effective_flags['file_offset_bits_value'] != Y2038_SAFE_FILE_OFFSET_BITS:
+ fake_directive = type('FakeDirective', (), {
+ 'file': srcfile, 'linenr': 0, 'column': 0,
+ 'str': 'cppcheck configuration: _FILE_OFFSET_BITS=%s' % effective_flags['file_offset_bits_value']
+ })()
+ cppcheckdata.reportError(fake_directive, 'error',
+ '_FILE_OFFSET_BITS must be defined equal to 64 (found in cppcheck configuration: _FILE_OFFSET_BITS=%s)' % effective_flags['file_offset_bits_value'],
+ 'y2038',
+ 'file-offset-bits-not-64')
+ y2038safe = False
+
+ # Check effective _USE_TIME_BITS64 (from dump file configuration)
+ if effective_flags['use_time_bits64_defined']:
+ if not time_bits_defined:
+ # _USE_TIME_BITS64 defined without _TIME_BITS is problematic
+ fake_directive = type('FakeDirective', (), {
+ 'file': srcfile, 'linenr': 0, 'column': 0,
+ 'str': 'cppcheck configuration: _USE_TIME_BITS64'
+ })()
+ cppcheckdata.reportError(fake_directive, 'warning',
+ '_USE_TIME_BITS64 is defined in cppcheck configuration but _TIME_BITS was not',
+ 'y2038',
+ 'type-bits-undef')
+ y2038safe = False
+ else:
+ # _USE_TIME_BITS64 defined WITH _TIME_BITS - this is correct
+ safe = 0 # Start of file is safe
+
+ # 2. Fallback to source code directives when dump file configuration is not available
+ source_time_bits_defined = False # pylint: disable=unused-variable
+ source_file_offset_bits_defined = False # pylint: disable=unused-variable
+ source_file_offset_bits_value = None # pylint: disable=unused-variable
+ source_use_time_bits64_defined = False # pylint: disable=unused-variable
+
+ # Track which flags came from source code for mixed scenario reporting
+ source_flags_used = {
+ 'time_bits': False,
+ 'file_offset_bits': False,
+ 'use_time_bits64': False
+ }
for directive in cfg.directives:
# track source line number
if directive.file == srcfile:
srclinenr = directive.linenr
+
+ # Process source code directives as fallback when dump config is not available
# check for correct _TIME_BITS if present
if re_define_time_bits_64.match(directive.str):
- time_bits_defined = True
+ source_time_bits_defined = True
+ # Only use source directive if dump config doesn't define _TIME_BITS
+ if not effective_flags['time_bits_defined']:
+ effective_flags['time_bits_defined'] = True
+ effective_flags['time_bits_value'] = Y2038_SAFE_TIME_BITS
+ time_bits_defined = True
+ source_flags_used['time_bits'] = True
elif re_define_time_bits.match(directive.str):
- cppcheckdata.reportError(directive, 'error',
- '_TIME_BITS must be defined equal to 64',
- 'y2038',
- 'type-bits-not-64')
- time_bits_defined = False
- y2038safe = False
+ source_time_bits_defined = False
+ # Only use source directive if dump config doesn't define _TIME_BITS
+ if not effective_flags['time_bits_defined']:
+ source_flags_used['time_bits'] = True
+ cppcheckdata.reportError(directive, 'error',
+ '_TIME_BITS must be defined equal to 64',
+ 'y2038',
+ 'type-bits-not-64')
+ y2038safe = False
elif re_undef_time_bits.match(directive.str):
- time_bits_defined = False
+ source_time_bits_defined = False
+ # Only use source directive if dump config doesn't define _TIME_BITS
+ if not effective_flags['time_bits_defined']:
+ time_bits_defined = False
+ source_flags_used['time_bits'] = True
+ # check for correct _FILE_OFFSET_BITS if present
+ if re_define_file_offset_bits_64.match(directive.str):
+ source_file_offset_bits_defined = True
+ source_file_offset_bits_value = Y2038_SAFE_FILE_OFFSET_BITS
+ # Only use source directive if dump config doesn't define _FILE_OFFSET_BITS
+ if not effective_flags['file_offset_bits_defined']:
+ effective_flags['file_offset_bits_defined'] = True
+ effective_flags['file_offset_bits_value'] = Y2038_SAFE_FILE_OFFSET_BITS
+ source_flags_used['file_offset_bits'] = True
+ elif re_define_file_offset_bits.match(directive.str):
+ source_file_offset_bits_defined = False
+ # Only use source directive if dump config doesn't define _FILE_OFFSET_BITS
+ if not effective_flags['file_offset_bits_defined']:
+ source_flags_used['file_offset_bits'] = True
+ cppcheckdata.reportError(directive, 'error',
+ '_FILE_OFFSET_BITS must be defined equal to 64',
+ 'y2038',
+ 'file-offset-bits-not-64')
+ y2038safe = False
+ elif re_undef_file_offset_bits.match(directive.str):
+ source_file_offset_bits_defined = False
+ source_file_offset_bits_value = None
+ # Only use source directive if dump config doesn't define _FILE_OFFSET_BITS
+ if not effective_flags['file_offset_bits_defined']:
+ effective_flags['file_offset_bits_defined'] = False
+ effective_flags['file_offset_bits_value'] = None
+ source_flags_used['file_offset_bits'] = True
+
# check for _USE_TIME_BITS64 (un)definition
if re_define_use_time_bits64.match(directive.str):
safe = int(srclinenr)
- # warn about _TIME_BITS not being defined
- if not time_bits_defined:
- cppcheckdata.reportError(directive, 'warning',
- '_USE_TIME_BITS64 is defined but _TIME_BITS was not',
- 'y2038',
- 'type-bits-undef')
+ source_use_time_bits64_defined = True
+ # Only use source directive if dump config doesn't define _USE_TIME_BITS64
+ if not effective_flags['use_time_bits64_defined']:
+ effective_flags['use_time_bits64_defined'] = True
+ source_flags_used['use_time_bits64'] = True
+ # warn about _TIME_BITS not being defined (check effective flags)
+ if not time_bits_defined:
+ cppcheckdata.reportError(directive, 'warning',
+ '_USE_TIME_BITS64 is defined but _TIME_BITS was not',
+ 'y2038',
+ 'type-bits-undef')
elif re_undef_use_time_bits64.match(directive.str):
unsafe = int(srclinenr)
+ source_use_time_bits64_defined = False
+ # Only use source directive if dump config doesn't define _USE_TIME_BITS64
+ if not effective_flags['use_time_bits64_defined']:
+ source_flags_used['use_time_bits64'] = True
# do we have a safe..unsafe area?
- if unsafe > safe > 0:
+ if unsafe > safe >= 0:
safe_ranges.append((safe, unsafe))
safe = -1
# check end of source beyond last directive
if len(cfg.tokenlist) > 0:
unsafe = int(cfg.tokenlist[-1].linenr)
- if unsafe > safe > 0:
+ if unsafe > safe >= 0:
safe_ranges.append((safe, unsafe))
+ # Determine if Y2038 warnings should be suppressed
+ # Require BOTH _TIME_BITS=64 AND _FILE_OFFSET_BITS=64 for complete Y2038 safety
+ y2038_safe_config = (
+ effective_flags['time_bits_defined'] and
+ effective_flags['time_bits_value'] == Y2038_SAFE_TIME_BITS and
+ effective_flags['file_offset_bits_defined'] and
+ effective_flags['file_offset_bits_value'] == Y2038_SAFE_FILE_OFFSET_BITS
+ )
+
+ # Update config_source for suppression reporting based on mixed scenarios
+ if y2038_safe_config:
+ # Determine configuration source for mixed scenarios
+ dump_flags_count = sum([
+ dump_config_flags['time_bits_defined'],
+ dump_config_flags['file_offset_bits_defined'],
+ dump_config_flags['use_time_bits64_defined']
+ ])
+ source_flags_count = sum(source_flags_used.values())
+
+ if dump_flags_count > 0 and source_flags_count > 0:
+ # Mixed scenario: both dump config and source directives used
+ config_source = "mixed configuration (cppcheck configuration and source code directives)"
+ elif dump_flags_count > 0:
+ # Only dump config used
+ config_source = "cppcheck configuration"
+ elif source_flags_count > 0:
+ # Only source directives used
+ config_source = "source code directives"
+ else:
+ # Fallback (shouldn't happen if y2038_safe_config is True)
+ config_source = "configuration"
+
# go through all tokens
+ warnings_suppressed = 0
for token in cfg.tokenlist:
if token.str in id_Y2038:
- if not any(lower <= int(token.linenr) <= upper
- for (lower, upper) in safe_ranges):
- cppcheckdata.reportError(token, 'warning',
- token.str + ' is Y2038-unsafe',
- 'y2038',
- 'unsafe-call')
- y2038safe = False
+ is_in_safe_range = any(lower <= int(token.linenr) <= upper
+ for (lower, upper) in safe_ranges)
+
+ if not is_in_safe_range:
+ if y2038_safe_config:
+ # Count suppressed warnings but don't report them
+ warnings_suppressed += 1
+ else:
+ # Report the warning as before
+ cppcheckdata.reportError(token, 'warning',
+ token.str + ' is Y2038-unsafe',
+ 'y2038',
+ 'unsafe-call')
+ y2038safe = False
token = token.next
+ # Print suppression message if warnings were suppressed
+ if warnings_suppressed > 0 and config_source and not quiet:
+ print('Y2038 warnings suppressed: Found proper Y2038 configuration in %s (_TIME_BITS=%d and _FILE_OFFSET_BITS=%d)' % (config_source, Y2038_SAFE_TIME_BITS, Y2038_SAFE_FILE_OFFSET_BITS))
+ print('Suppressed %d Y2038-unsafe function warning(s)' % warnings_suppressed)
+
return y2038safe
diff --git a/cfg/boost.cfg b/cfg/boost.cfg
index d181860f0bc..b09d9ccd9e5 100644
--- a/cfg/boost.cfg
+++ b/cfg/boost.cfg
@@ -83,12 +83,12 @@
-
+
-
-
+
+
diff --git a/cfg/cairo.cfg b/cfg/cairo.cfg
index e077c2fc40d..d766abffc2e 100644
--- a/cfg/cairo.cfg
+++ b/cfg/cairo.cfg
@@ -21,6 +21,7 @@
+
diff --git a/cfg/googletest.cfg b/cfg/googletest.cfg
index 36dd8a40669..c32eef7274b 100644
--- a/cfg/googletest.cfg
+++ b/cfg/googletest.cfg
@@ -29,11 +29,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/cfg/gtk.cfg b/cfg/gtk.cfg
index 722efb6b76b..a1d7763670e 100644
--- a/cfg/gtk.cfg
+++ b/cfg/gtk.cfg
@@ -4,16 +4,30 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -78,6 +92,7 @@
+
@@ -112,6 +127,7 @@
+
@@ -234,6 +250,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
g_thread_new
g_thread_try_new
@@ -807,7 +903,6 @@
g_app_info_get_default_for_uri_scheme
g_application_new
g_application_get_dbus_connection
- g_application_get_default
g_buffered_input_stream_new
g_buffered_output_stream_new
g_cancellable_new
@@ -910,7 +1005,6 @@
g_zlib_decompressor_new
g_object_unref
- gtk_widget_destroy
g_tree_new
@@ -926,6 +1020,17 @@
g_file_attribute_matcher_unref
+
+ gtk_window_new
+ gtk_widget_destroy
+ gtk_window_destroy
+
+
+
+ false
+
+
+
true
@@ -2148,6 +2253,7 @@
+
false
@@ -6483,6 +6589,7 @@
+
false
@@ -8761,7 +8868,7 @@
false
-
+
@@ -9688,6 +9795,14 @@
false
+
+
+ false
+
+
+
+
false
@@ -21130,10 +21245,6 @@
false
-
-
- false
-
false
@@ -21790,6 +21901,13 @@
false
+
+ false
+
+
+
+
+
false
@@ -22967,6 +23085,13 @@
+
+
+
+
+
+
+
@@ -23079,4 +23204,8 @@
+
+
+
+
diff --git a/cfg/libcurl.cfg b/cfg/libcurl.cfg
index 381fbb237d7..949b6de0282 100644
--- a/cfg/libcurl.cfg
+++ b/cfg/libcurl.cfg
@@ -167,7 +167,7 @@
-
+
diff --git a/cfg/microsoft_gsl.cfg b/cfg/microsoft_gsl.cfg
new file mode 100644
index 00000000000..07fbfcb74a6
--- /dev/null
+++ b/cfg/microsoft_gsl.cfg
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cfg/posix.cfg b/cfg/posix.cfg
index 751142bacc1..e0de433e1f1 100644
--- a/cfg/posix.cfg
+++ b/cfg/posix.cfg
@@ -4600,6 +4600,142 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+ 0:2
+
+
+
+
+ false
+
+
+
+ 0:2
+
+
+
+
+
+
+
+ false
+
+
+
+ 0:2
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
@@ -6437,6 +6573,32 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cfg/qt.cfg b/cfg/qt.cfg
index cf0727f1c7e..95dc022cf57 100644
--- a/cfg/qt.cfg
+++ b/cfg/qt.cfg
@@ -410,7 +410,6 @@
-
@@ -2319,10 +2318,28 @@
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+ false
+
+
+
-
+
false
@@ -2338,6 +2355,68 @@
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
false
@@ -2346,8 +2425,9 @@
-
+
false
+
@@ -2356,17 +2436,11 @@
-
-
- false
-
-
-
-
false
+
@@ -2375,6 +2449,34 @@
+
+
+ false
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+ false
+
+
+
+
@@ -2737,6 +2839,7 @@
+
@@ -3293,7 +3396,7 @@
-
+
@@ -3304,7 +3407,7 @@
-
+
@@ -3320,7 +3423,7 @@
false
-
+
@@ -3328,10 +3431,10 @@
false
-
+
-
+
@@ -3368,10 +3471,10 @@
false
-
+
-
+
@@ -3381,7 +3484,7 @@
false
-
+
@@ -5259,7 +5362,7 @@
-
+
@@ -5417,7 +5520,7 @@
-
+
@@ -5427,6 +5530,8 @@
+
+
@@ -5451,6 +5556,11 @@
+
+
+
+
+
diff --git a/cfg/selinux.cfg b/cfg/selinux.cfg
index e2d7ac34dc3..31a48c6da5e 100644
--- a/cfg/selinux.cfg
+++ b/cfg/selinux.cfg
@@ -219,7 +219,7 @@
false
-
+
diff --git a/cfg/std.cfg b/cfg/std.cfg
index 84cffb79828..6c434b8715c 100644
--- a/cfg/std.cfg
+++ b/cfg/std.cfg
@@ -3,16 +3,16 @@
-
-
+
+
-
-
-
+
+
+
-
-
+
+
@@ -1665,7 +1665,7 @@
false
-
+
@@ -1929,7 +1929,7 @@
false
-
+
@@ -2255,7 +2255,7 @@
false
-
+
@@ -3989,11 +3989,11 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+ arg1
false
-
+
@@ -4010,7 +4010,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+ arg1
false
@@ -4056,7 +4056,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
-
+ arg1
@@ -4077,7 +4077,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
-
+ arg1
@@ -4100,7 +4100,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
-
+
@@ -4118,10 +4118,10 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+ arg1
false
-
+
@@ -4136,7 +4136,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+ arg1
false
@@ -4411,7 +4411,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+
@@ -4444,7 +4444,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+
@@ -4812,7 +4812,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+ arg1
false
@@ -4828,9 +4828,9 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+
-
+ arg1
false
@@ -4861,7 +4861,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
-
+
@@ -4911,7 +4911,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
-
+
@@ -4942,7 +4942,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+ arg1
false
@@ -5044,7 +5044,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
-
+
@@ -5057,7 +5057,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+ arg1
false
@@ -5123,10 +5123,10 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+
false
-
+ arg1
@@ -5373,7 +5373,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
-
+ arg1
false
@@ -5433,7 +5433,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
-
+
@@ -7130,6 +7130,16 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
+
+
+
+
+
+
+
+
+ false
+
@@ -7137,6 +7147,13 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
false
+
+
+
+
+
+ false
+
@@ -8326,9 +8343,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
-
-
-
+
false
@@ -8734,7 +8749,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
false
-
+
@@ -8742,7 +8757,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
false
-
+
@@ -8797,6 +8812,12 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
+
+
+
+ true
+
+
malloc,std::malloc
calloc,std::calloc
@@ -9009,6 +9030,16 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
+
+
+
+
+
+
+
+
+
+
diff --git a/cfg/windows.cfg b/cfg/windows.cfg
index 343e12b3906..b2251900d42 100644
--- a/cfg/windows.cfg
+++ b/cfg/windows.cfg
@@ -1331,6 +1331,11 @@
AllocateAndInitializeSid
FreeSid
+
+ _create_locale
+ _wcreate_locale
+ _free_locale
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
arg1
false
-
+
@@ -5963,7 +6000,7 @@ HFONT CreateFont(
-
+
@@ -6009,7 +6046,7 @@ HFONT CreateFont(
-
+
@@ -7191,7 +7228,7 @@ HFONT CreateFont(
-
+
@@ -13345,9 +13382,9 @@ HFONT CreateFont(
-
-
-
+
+
+
diff --git a/cfg/wxwidgets.cfg b/cfg/wxwidgets.cfg
index 685750f7ff2..9dea60761d1 100644
--- a/cfg/wxwidgets.cfg
+++ b/cfg/wxwidgets.cfg
@@ -109,6 +109,8 @@
+
+
@@ -7251,6 +7253,15 @@
This function is deprecated, use 'wxPGProperty::GetValueAsString()' instead.
+
+
+
+ false
+
+
+
+
+
@@ -10350,6 +10361,14 @@
+
+
+ false
+
+
+
+
+
false
@@ -11382,6 +11401,12 @@
+
+
+ false
+
+
+
@@ -11678,7 +11703,8 @@
-
+
+
false
@@ -12501,7 +12527,8 @@
-
+
+
false
@@ -15805,7 +15832,8 @@ wxItemKind kind = wxITEM_NORMAL) -->
-
+
+
false
@@ -16095,6 +16123,30 @@ wxItemKind kind = wxITEM_NORMAL) -->
+
+
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+
+
false
@@ -16113,7 +16165,9 @@ wxItemKind kind = wxITEM_NORMAL) -->
-
+
+
+
false
@@ -17021,12 +17075,28 @@ wxItemKind kind = wxITEM_NORMAL) -->
+
-
+
+
false
+
+
+
+ false
+
+
+
+
+
+
+
+ false
+
+
diff --git a/clang-tidy.md b/clang-tidy.md
index 59d28dbaa3d..f00a39cde12 100644
--- a/clang-tidy.md
+++ b/clang-tidy.md
@@ -33,7 +33,6 @@ These are coding guidelines we do not follow. Some of the checks might be explic
`readability-braces-around-statements`
`readability-isolate-declaration`
-`modernize-use-trailing-return-type`
`readability-uppercase-literal-suffix`
`readability-identifier-length`
@@ -112,7 +111,11 @@ Also reports a false positive about templates which deduce the array length: htt
`misc-include-cleaner`
-We run this separately via `clang-include-cleaner` in the `iwyu.yml` workflow as the findings of the include checkers still need to be reviewed manually before applying them.
+We run this separately via `clang-include-cleaner` in the `iwyu.yml` workflow as the findings of the include checkers still need to be reviewed manually before applying them.
+
+`readability-use-concise-preprocessor-directives`
+
+Does not improve the readability.
`bugprone-branch-clone`
`modernize-return-braced-init-list`
@@ -126,6 +129,11 @@ We run this separately via `clang-include-cleaner` in the `iwyu.yml` workflow as
`readability-avoid-nested-conditional-operator`
`modernize-use-designated-initializers`
`readability-enum-initial-value`
+`modernize-use-trailing-return-type`
+`misc-unconventional-assign-operator`
+`bugprone-throwing-static-initialization`
+`bugprone-command-processor`
+`misc-multiple-inheritance`
To be evaluated (need to remove exclusion).
@@ -144,9 +152,30 @@ To be evaluated (need to enable explicitly).
`modernize-type-traits`
`modernize-use-nodiscard`
+`modernize-use-scoped-lock`
These apply to codebases which use later standards then C++11 (C++17 is used when building with Qt6) so we cannot simply apply them.
+`portability-avoid-pragma-once`
+
+We are not interested in this.
+
+`readability-redundant-parentheses`
+
+Reports false positives - see https://github.com/llvm/llvm-project/issues/164125.
+
+`readability-inconsistent-ifelse-braces`
+
+The suggestions are too intrusive.
+
+`modernize-avoid-c-style-cast`
+
+Currently flags functional casts - see https://github.com/llvm/llvm-project/issues/186784.
+
+`misc-use-internal-linkage.AnalyzeTypes`
+
+Adding anonymous namespaces requires identation which is too instrusive right now. Would require changes to our fomatting configuration.
+
### Disabled for performance reasons
`portability-std-allocator-const`
@@ -171,7 +200,7 @@ We are currently using our own `naming.json` to enforce naming schemes. Also dis
`portability-simd-intrinsics`
-We are not using SIMD instructions and it suggests to use `std::experiemental::` features which might not be commonly available. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132.
+We are not using SIMD instructions and it suggests to use `std::experimental::` features which might not be commonly available. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132.
`modernize-macro-to-enum`
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
index dc13dba1403..52103bdb8ec 100644
--- a/cli/CMakeLists.txt
+++ b/cli/CMakeLists.txt
@@ -1,54 +1,28 @@
-if (BUILD_CLI)
-
- file(GLOB hdrs "*.h")
- file(GLOB srcs "*.cpp")
- file(GLOB mainfile "main.cpp")
- list(REMOVE_ITEM srcs ${mainfile})
+file(GLOB hdrs "*.h")
+file(GLOB srcs "*.cpp")
+file(GLOB mainfile "main.cpp")
+list(REMOVE_ITEM srcs ${mainfile})
- add_library(cli_objs OBJECT ${hdrs} ${srcs})
- target_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/lib/)
- if(USE_BUNDLED_TINYXML2)
- target_externals_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/tinyxml2/)
- else()
- target_include_directories(cli_objs SYSTEM PRIVATE ${tinyxml2_INCLUDE_DIRS})
- endif()
- target_externals_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/picojson/)
- target_externals_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/simplecpp/)
- if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
- target_precompile_headers(cli_objs PRIVATE precompiled.h)
- endif()
- if (BUILD_CORE_DLL)
- target_compile_definitions(cli_objs PRIVATE CPPCHECKLIB_IMPORT TINYXML2_IMPORT)
- endif()
+add_library(cli ${hdrs} ${srcs})
+target_include_directories(cli PUBLIC .)
+target_link_libraries(cli PRIVATE cppcheck-core frontend tinyxml2 simplecpp picojson)
+if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
+ target_precompile_headers(cli PRIVATE precompiled.h)
+endif()
- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 13)
- # false positive warning in Clang 13 - caused by FD_ZERO macro
- set_source_files_properties(processexecutor.cpp PROPERTIES COMPILE_FLAGS -Wno-reserved-identifier)
- endif()
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 13)
+ # false positive warning in Clang 13 - caused by FD_ZERO macro
+ set_source_files_properties(processexecutor.cpp PROPERTIES COMPILE_FLAGS -Wno-reserved-identifier)
+endif()
- list(APPEND cppcheck_SOURCES ${hdrs} ${mainfile} $)
- if (NOT BUILD_CORE_DLL)
- list(APPEND cppcheck_SOURCES $)
- list(APPEND cppcheck_SOURCES $)
- if(USE_BUNDLED_TINYXML2)
- list(APPEND cppcheck_SOURCES $)
- endif()
- endif()
+if (BUILD_CLI)
+ list(APPEND cppcheck_SOURCES ${hdrs} ${mainfile})
if (WIN32)
list(APPEND cppcheck_SOURCES version.rc)
endif()
add_executable(cppcheck ${cppcheck_SOURCES})
- target_include_directories(cppcheck PRIVATE ${PROJECT_SOURCE_DIR}/lib/)
- if(USE_BUNDLED_TINYXML2)
- target_externals_include_directories(cppcheck PRIVATE ${PROJECT_SOURCE_DIR}/externals/tinyxml2/)
- else()
- target_include_directories(cppcheck SYSTEM PRIVATE ${tinyxml2_INCLUDE_DIRS})
- endif()
- target_externals_include_directories(cppcheck PRIVATE ${PROJECT_SOURCE_DIR}/externals/simplecpp/)
- if (HAVE_RULES)
- target_link_libraries(cppcheck ${PCRE_LIBRARY})
- endif()
+ target_link_libraries(cppcheck cppcheck-core cli tinyxml2 simplecpp)
if (WIN32 AND NOT BORLAND)
if(NOT MINGW)
target_link_libraries(cppcheck Shlwapi.lib)
@@ -56,13 +30,7 @@ if (BUILD_CLI)
target_link_libraries(cppcheck shlwapi)
endif()
endif()
- if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
- target_link_libraries(cppcheck ${tinyxml2_LIBRARIES})
- endif()
target_link_libraries(cppcheck ${CMAKE_THREAD_LIBS_INIT})
- if (BUILD_CORE_DLL)
- target_link_libraries(cppcheck cppcheck-core)
- endif()
add_dependencies(cppcheck copy_cfg)
add_dependencies(cppcheck copy_addons)
@@ -72,27 +40,32 @@ if (BUILD_CLI)
endif()
install(TARGETS cppcheck
- RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT applications)
install(PROGRAMS ${CMAKE_SOURCE_DIR}/htmlreport/cppcheck-htmlreport
- DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT applications)
+ # TODO: leverage CMAKE_INSTALL_DATAROOTDIR (share)?
+
install(FILES ${addons_py}
- DESTINATION ${FILESDIR_DEF}/addons
+ DESTINATION ${FILESDIR_INSTALL}/addons
COMPONENT headers)
install(FILES ${addons_json}
- DESTINATION ${FILESDIR_DEF}/addons
+ DESTINATION ${FILESDIR_INSTALL}/addons
COMPONENT headers)
install(FILES ${cfgs}
- DESTINATION ${FILESDIR_DEF}/cfg
+ DESTINATION ${FILESDIR_INSTALL}/cfg
COMPONENT headers)
install(FILES ${platforms}
- DESTINATION ${FILESDIR_DEF}/platforms
+ DESTINATION ${FILESDIR_INSTALL}/platforms
COMPONENT headers)
+ # TODO: install manpage into CMAKE_INSTALL_MANDIR
+ # TODO: install documentation into CMAKE_INSTALL_DOCDIR?
+
endif()
diff --git a/cli/cli.vcxproj b/cli/cli.vcxproj
index 3178f4319d2..05d1cf2916d 100644
--- a/cli/cli.vcxproj
+++ b/cli/cli.vcxproj
@@ -85,11 +85,11 @@
- ..\lib;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)
+ ..\lib;..\frontend;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)
true
ProgramDatabase
Disabled
- CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)
+ CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)
MultiThreadedDebugDLL
Level4
4018;4127;4146;4244;4251;4267;4389;4701;4706;4800;4805
@@ -114,11 +114,11 @@
- ..\lib;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)
+ ..\lib;..\frontend;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)
true
ProgramDatabase
Disabled
- CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)
+ CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)
MultiThreadedDebugDLL
Level4
4018;4127;4146;4244;4251;4267;4389;4701;4706;4800;4805
@@ -143,10 +143,10 @@
- ..\lib;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)
+ ..\lib;..\frontend;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)
false
MaxSpeed
- CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)
+ CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)
MultiThreadedDLL
Level4
AnySuitable
@@ -181,10 +181,10 @@
- ..\lib;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)
+ ..\lib;..\frontend;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)
false
MaxSpeed
- CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)
+ CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)
MultiThreadedDLL
Level4
AnySuitable
@@ -231,6 +231,7 @@
+
@@ -254,6 +255,7 @@
+
diff --git a/cli/cli.vcxproj.filters b/cli/cli.vcxproj.filters
index 2320255e6b5..5d3bd1c86cc 100644
--- a/cli/cli.vcxproj.filters
+++ b/cli/cli.vcxproj.filters
@@ -23,9 +23,6 @@
Header Files
-
- Header Files
-
Header Files
@@ -44,6 +41,12 @@
Header Files
+
+ Header Files
+
+
+ Header Files
+
@@ -55,9 +58,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -79,6 +79,12 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp
index 1e43930ddb1..f2d2254f833 100644
--- a/cli/cmdlineparser.cpp
+++ b/cli/cmdlineparser.cpp
@@ -1,6 +1,6 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
- * Copyright (C) 2007-2025 Cppcheck team.
+ * Copyright (C) 2007-2026 Cppcheck team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
#include "addoninfo.h"
#include "check.h"
+#include "checks.h"
#include "checkers.h"
#include "color.h"
#include "config.h"
@@ -36,12 +37,12 @@
#include "settings.h"
#include "standards.h"
#include "suppressions.h"
-#include "timer.h"
#include "utils.h"
+#include "frontend.h"
+
#include
#include
-#include
#include
#include // EXIT_FAILURE
#include
@@ -55,8 +56,13 @@
#include
#ifdef HAVE_RULES
+#include "regex.h"
+#include "rule.h"
+
// xml is used for rules
#include "xml.h"
+
+#include
#endif
static bool addFilesToList(const std::string& fileList, std::vector& pathNames)
@@ -72,9 +78,7 @@ static bool addFilesToList(const std::string& fileList, std::vector
files = &infile;
}
std::string fileName;
- // cppcheck-suppress accessMoved - FP
while (std::getline(*files, fileName)) { // next line
- // cppcheck-suppress accessMoved - FP
if (!fileName.empty()) {
pathNames.emplace_back(std::move(fileName));
}
@@ -88,7 +92,6 @@ static bool addIncludePathsToList(const std::string& fileList, std::list& ignored = getIgnoredPaths();
+ const std::vector& ignored = mIgnoredPaths;
const bool warn = std::any_of(ignored.cbegin(), ignored.cend(), [](const std::string& i) {
return Path::isHeader(i);
});
@@ -189,23 +198,23 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[])
mLogger.printMessage("Please use --suppress for ignoring results from the header files.");
}
- const std::vector& pathnamesRef = getPathNames();
- const std::list& fileSettingsRef = getFileSettings();
+ const std::vector& pathnamesRef = mPathNames;
+ const std::list& fileSettingsRef = mFileSettings;
// the inputs can only be used exclusively - CmdLineParser should already handle this
assert(!(!pathnamesRef.empty() && !fileSettingsRef.empty()));
if (!fileSettingsRef.empty()) {
- // TODO: de-duplicate
-
std::list fileSettings;
if (!mSettings.fileFilters.empty()) {
// filter only for the selected filenames from all project files
+ PathMatch filtermatcher(mSettings.fileFilters, Path::getCurrentPath());
std::copy_if(fileSettingsRef.cbegin(), fileSettingsRef.cend(), std::back_inserter(fileSettings), [&](const FileSettings &fs) {
- return matchglobs(mSettings.fileFilters, fs.filename());
+ return filtermatcher.match(fs.filename());
});
if (fileSettings.empty()) {
- mLogger.printError("could not find any files matching the filter.");
+ for (const std::string& f: mSettings.fileFilters)
+ mLogger.printError("could not find any files matching the filter:" + f);
return false;
}
}
@@ -213,42 +222,11 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[])
fileSettings = fileSettingsRef;
}
- mFileSettings.clear();
+ // TODO: de-duplicate
- if (mSettings.enforcedLang != Standards::Language::None)
- {
- // apply enforced language
- for (auto& fs : fileSettings)
- {
- if (mSettings.library.markupFile(fs.filename()))
- continue;
- fs.file.setLang(mSettings.enforcedLang);
- }
- }
- else
- {
- // identify files
- for (auto& fs : fileSettings)
- {
- if (mSettings.library.markupFile(fs.filename()))
- continue;
- assert(fs.file.lang() == Standards::Language::None);
- bool header = false;
- fs.file.setLang(Path::identify(fs.filename(), mSettings.cppHeaderProbe, &header));
- // unknown extensions default to C++
- if (!header && fs.file.lang() == Standards::Language::None)
- fs.file.setLang(Standards::Language::CPP);
- }
- }
+ mFileSettings.clear();
- // enforce the language since markup files are special and do not adhere to the enforced language
- for (auto& fs : fileSettings)
- {
- if (mSettings.library.markupFile(fs.filename())) {
- assert(fs.file.lang() == Standards::Language::None);
- fs.file.setLang(Standards::Language::C);
- }
- }
+ frontend::applyLang(fileSettings, mSettings, mEnforcedLang);
// sort the markup last
std::copy_if(fileSettings.cbegin(), fileSettings.cend(), std::back_inserter(mFileSettings), [&](const FileSettings &fs) {
@@ -267,16 +245,9 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[])
if (!pathnamesRef.empty()) {
std::list filesResolved;
- // TODO: this needs to be inlined into PathMatch as it depends on the underlying filesystem
-#if defined(_WIN32)
- // For Windows we want case-insensitive path matching
- const bool caseSensitive = false;
-#else
- const bool caseSensitive = true;
-#endif
// Execute recursiveAddFiles() to each given file parameter
// TODO: verbose log which files were ignored?
- const PathMatch matcher(ignored, caseSensitive);
+ const PathMatch matcher(ignored, Path::getCurrentPath());
for (const std::string &pathname : pathnamesRef) {
const std::string err = FileLister::recursiveAddFiles(filesResolved, Path::toNativeSeparators(pathname), mSettings.library.markupExtensions(), matcher, mSettings.debugignore);
if (!err.empty()) {
@@ -293,24 +264,12 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[])
return false;
}
- // de-duplicate files
- {
- auto it = filesResolved.begin();
- while (it != filesResolved.end()) {
- const std::string& name = it->path();
- // TODO: log if duplicated files were dropped
- filesResolved.erase(std::remove_if(std::next(it), filesResolved.end(), [&](const FileWithDetails& entry) {
- return entry.path() == name;
- }), filesResolved.end());
- ++it;
- }
- }
-
std::list files;
if (!mSettings.fileFilters.empty()) {
files = filterFiles(mSettings.fileFilters, filesResolved);
if (files.empty()) {
- mLogger.printError("could not find any files matching the filter.");
+ for (const std::string& f: mSettings.fileFilters)
+ mLogger.printError("could not find any files matching the filter:" + f);
return false;
}
}
@@ -318,40 +277,20 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[])
files = std::move(filesResolved);
}
- if (mSettings.enforcedLang != Standards::Language::None)
- {
- // apply enforced language
- for (auto& f : files)
- {
- if (mSettings.library.markupFile(f.path()))
- continue;
- f.setLang(mSettings.enforcedLang);
- }
- }
- else
+ // de-duplicate files
{
- // identify remaining files
- for (auto& f : files)
- {
- if (f.lang() != Standards::Language::None)
- continue;
- if (mSettings.library.markupFile(f.path()))
- continue;
- bool header = false;
- f.setLang(Path::identify(f.path(), mSettings.cppHeaderProbe, &header));
- // unknown extensions default to C++
- if (!header && f.lang() == Standards::Language::None)
- f.setLang(Standards::Language::CPP);
+ auto it = files.begin();
+ while (it != files.end()) {
+ const std::string& absname = it->abspath();
+ // TODO: log if duplicated files were dropped
+ files.erase(std::remove_if(std::next(it), files.end(), [&](const FileWithDetails& entry) {
+ return entry.abspath() == absname;
+ }), files.end());
+ ++it;
}
}
- // enforce the language since markup files are special and do not adhere to the enforced language
- for (auto& f : files)
- {
- if (mSettings.library.markupFile(f.path())) {
- f.setLang(Standards::Language::C);
- }
- }
+ frontend::applyLang(files, mSettings, mEnforcedLang);
// sort the markup last
std::copy_if(files.cbegin(), files.cend(), std::inserter(mFiles, mFiles.end()), [&](const FileWithDetails& entry) {
@@ -377,9 +316,41 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
{
mSettings.exename = Path::getCurrentExecutablePath(argv[0]);
+ bool xmlOptionProvided = false;
+ bool outputFormatOptionProvided = false;
+
// default to --check-level=normal from CLI for now
mSettings.setCheckLevel(Settings::CheckLevel::normal);
+ // read --debug-lookup early so the option is available for the cppcheck.cfg loading
+ for (int i = 1; i < argc; i++) {
+ // Show debug warnings for lookup for configuration files
+ if (std::strcmp(argv[i], "--debug-lookup") == 0)
+ mSettings.debuglookup = true;
+
+ else if (std::strncmp(argv[i], "--debug-lookup=", 15) == 0) {
+ const std::string lookup = argv[i] + 15;
+ if (lookup == "all")
+ mSettings.debuglookup = true;
+ else if (lookup == "addon")
+ mSettings.debuglookupAddon = true;
+ else if (lookup == "config")
+ mSettings.debuglookupConfig = true;
+ else if (lookup == "library")
+ mSettings.debuglookupLibrary = true;
+ else if (lookup == "platform")
+ mSettings.debuglookupPlatform = true;
+ else
+ {
+ mLogger.printError("unknown lookup '" + lookup + "'");
+ return Result::Fail;
+ }
+ }
+ }
+
+ if (!loadCppcheckCfg())
+ return Result::Fail;
+
if (argc <= 1) {
printHelp();
return Result::Exit;
@@ -391,9 +362,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
if (std::strcmp(argv[i], "--doc") == 0) {
std::ostringstream doc;
// Get documentation..
- for (const Check * it : Check::instances()) {
- const std::string& name(it->name());
- const std::string info(it->classInfo());
+ for (const Check * const c : CheckInstances::get()) {
+ const std::string& name(c->name());
+ const std::string info(c->classInfo());
if (!name.empty() && !info.empty())
doc << "## " << name << " ##\n"
<< info << "\n";
@@ -405,8 +376,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
// print all possible error messages..
if (std::strcmp(argv[i], "--errorlist") == 0) {
- if (!loadCppcheckCfg())
- return Result::Fail;
{
XMLErrorMessagesLogger xmlLogger;
std::cout << ErrorMessage::getXMLHeader(mSettings.cppcheckCfgProductName, 2);
@@ -430,21 +399,27 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
}
if (std::strcmp(argv[i], "--version") == 0) {
- if (!loadCppcheckCfg())
- return Result::Fail;
const std::string version = getVersion();
mLogger.printRaw(version); // TODO: should not include newline
return Result::Exit;
}
}
- bool def = false;
- bool maxconfigs = false;
+ bool debug = false;
+ bool inputAsFilter = false; // set by: --file-filter=+
ImportProject::Type projectType = ImportProject::Type::NONE;
ImportProject project;
std::string vsConfig;
+ std::string platform;
+ char defaultSign = '\0';
+
+ std::vector lookupPaths{
+ Path::getCurrentPath(), // TODO: do we want to look in CWD?
+ Path::getPathFromFilename(mSettings.exename),
+ };
+
bool executorAuto = true;
for (int i = 1; i < argc; i++) {
@@ -478,8 +453,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
if (!mSettings.userDefines.empty())
mSettings.userDefines += ";";
mSettings.userDefines += define;
-
- def = true;
}
// -E
@@ -544,8 +517,10 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
else if (std::strncmp(argv[i],"--addon-python=", 15) == 0)
mSettings.addonPython.assign(argv[i]+15);
- else if (std::strcmp(argv[i],"--analyze-all-vs-configs") == 0)
+ else if (std::strcmp(argv[i],"--analyze-all-vs-configs") == 0) {
mSettings.analyzeAllVsConfigs = true;
+ mAnalyzeAllVsConfigsSetOnCmdLine = true;
+ }
// Check configuration
else if (std::strcmp(argv[i], "--check-config") == 0)
@@ -645,6 +620,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mSettings.cppHeaderProbe = true;
}
+ else if (std::strcmp(argv[i], "--debug-analyzerinfo") == 0)
+ mSettings.debugainfo = true;
+
else if (std::strcmp(argv[i], "--debug-ast") == 0)
mSettings.debugast = true;
@@ -656,33 +634,19 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
else if (std::strcmp(argv[i], "--debug-ignore") == 0)
mSettings.debugignore = true;
+ else if (std::strcmp(argv[i], "--debug-ipc") == 0)
+ mSettings.debugipc = true;
+
// Show --debug output after the first simplifications
else if (std::strcmp(argv[i], "--debug") == 0 ||
std::strcmp(argv[i], "--debug-normal") == 0)
- mSettings.debugnormal = true;
+ debug = true;
- // Show debug warnings for lookup for configuration files
else if (std::strcmp(argv[i], "--debug-lookup") == 0)
- mSettings.debuglookup = true;
+ continue; // already handled above
- else if (std::strncmp(argv[i], "--debug-lookup=", 15) == 0) {
- const std::string lookup = argv[i] + 15;
- if (lookup == "all")
- mSettings.debuglookup = true;
- else if (lookup == "addon")
- mSettings.debuglookupAddon = true;
- else if (lookup == "config")
- mSettings.debuglookupConfig = true;
- else if (lookup == "library")
- mSettings.debuglookupLibrary = true;
- else if (lookup == "platform")
- mSettings.debuglookupPlatform = true;
- else
- {
- mLogger.printError("unknown lookup '" + lookup + "'");
- return Result::Fail;
- }
- }
+ else if (std::strncmp(argv[i], "--debug-lookup=", 15) == 0)
+ continue; // already handled above
// Flag used for various purposes during debugging
else if (std::strcmp(argv[i], "--debug-simplified") == 0)
@@ -794,6 +758,15 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
}
}
+ else if (std::strncmp(argv[i], "--exitcode-suppress=", 20) == 0) {
+ const std::string suppression = argv[i]+20;
+ const std::string errmsg(mSuppressions.nofail.addSuppressionLine(suppression));
+ if (!errmsg.empty()) {
+ mLogger.printError(errmsg);
+ return Result::Fail;
+ }
+ }
+
// Filter errors
else if (std::strncmp(argv[i], "--exitcode-suppressions=", 24) == 0) {
// exitcode-suppressions=filename.txt
@@ -819,6 +792,8 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mLogger.printError("Failed: --file-filter=-");
return Result::Fail;
}
+ } else if (std::strcmp(filter, "+") == 0) {
+ inputAsFilter = true;
} else {
mSettings.fileFilters.emplace_back(filter);
}
@@ -835,14 +810,16 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
}
// Force checking of files that have "too many" configurations
- else if (std::strcmp(argv[i], "-f") == 0 || std::strcmp(argv[i], "--force") == 0)
+ else if (std::strcmp(argv[i], "-f") == 0 || std::strcmp(argv[i], "--force") == 0) {
mSettings.force = true;
+ mSettings.maxConfigsOption = Settings::maxConfigsNotAssigned;
+ }
else if (std::strcmp(argv[i], "--fsigned-char") == 0)
- mSettings.platform.defaultSign = 's';
+ defaultSign = 's';
else if (std::strcmp(argv[i], "--funsigned-char") == 0)
- mSettings.platform.defaultSign = 'u';
+ defaultSign = 'u';
// Ignored paths
else if (std::strncmp(argv[i], "-i", 2) == 0) {
@@ -977,9 +954,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
}
if (str == "c")
- mSettings.enforcedLang = Standards::Language::C;
+ mEnforcedLang = Standards::Language::C;
else if (str == "c++")
- mSettings.enforcedLang = Standards::Language::CPP;
+ mEnforcedLang = Standards::Language::CPP;
else {
mLogger.printError("unknown language '" + str + "' enforced.");
return Result::Fail;
@@ -1008,9 +985,8 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
return Result::Fail;
}
- mSettings.maxConfigs = tmp;
+ mSettings.maxConfigsOption = tmp;
mSettings.force = false;
- maxconfigs = true;
}
// max ctu depth
@@ -1030,8 +1006,10 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
return Result::Fail;
}
- else if (std::strcmp(argv[i],"--no-analyze-all-vs-configs") == 0)
+ else if (std::strcmp(argv[i],"--no-analyze-all-vs-configs") == 0) {
mSettings.analyzeAllVsConfigs = false;
+ mAnalyzeAllVsConfigsSetOnCmdLine = true;
+ }
else if (std::strcmp(argv[i], "--no-check-headers") == 0)
mSettings.checkHeaders = false;
@@ -1048,11 +1026,18 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mSettings.cppHeaderProbe = false;
}
+ else if (std::strcmp(argv[i], "--no-safety") == 0)
+ mSettings.safety = false;
+
// Write results in file
else if (std::strncmp(argv[i], "--output-file=", 14) == 0)
mSettings.outputFile = Path::simplifyPath(argv[i] + 14);
else if (std::strncmp(argv[i], "--output-format=", 16) == 0) {
+ if (xmlOptionProvided) {
+ outputFormatOptionMixingError();
+ return Result::Fail;
+ }
const std::string format = argv[i] + 16;
// plist can not be handled here because it requires additional data
if (format == "text")
@@ -1061,11 +1046,18 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mSettings.outputFormat = Settings::OutputFormat::sarif;
else if (format == "xml")
mSettings.outputFormat = Settings::OutputFormat::xml;
- else {
- mLogger.printError("argument to '--output-format=' must be 'text', 'sarif' or 'xml'.");
+ else if (format == "xmlv2") {
+ mSettings.outputFormat = Settings::OutputFormat::xml;
+ mSettings.xml_version = 2;
+ } else if (format == "xmlv3") {
+ mSettings.outputFormat = Settings::OutputFormat::xml;
+ mSettings.xml_version = 3;
+ } else {
+ mLogger.printError("argument to '--output-format=' must be 'text', 'sarif', 'xml' (deprecated), 'xmlv2' or 'xmlv3'.");
return Result::Fail;
}
mSettings.plistOutput = "";
+ outputFormatOptionProvided = true;
}
@@ -1088,22 +1080,12 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
// Specify platform
else if (std::strncmp(argv[i], "--platform=", 11) == 0) {
- const std::string platform(11+argv[i]);
-
- std::string errstr;
- const std::vector paths = {argv[0]};
- if (!mSettings.platform.set(platform, errstr, paths, mSettings.debuglookup || mSettings.debuglookupPlatform)) {
- mLogger.printError(errstr);
+ std::string p = 11 + argv[i];
+ if (p.empty()) {
+ mLogger.printError("empty platform specified.");
return Result::Fail;
}
-
- // TODO: remove
- // these are loaded via external files and thus have Settings::PlatformFile set instead.
- // override the type so they behave like the regular platforms.
- if (platform == "unix32-unsigned")
- mSettings.platform.type = Platform::Type::Unix32;
- else if (platform == "unix64-unsigned")
- mSettings.platform.type = Platform::Type::Unix64;
+ platform = std::move(p);
}
// Write results in results.plist
@@ -1129,21 +1111,26 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
}
// Special Cppcheck Premium options
- else if ((std::strncmp(argv[i], "--premium=", 10) == 0 || std::strncmp(argv[i], "--premium-", 10) == 0) && isCppcheckPremium()) {
+ else if ((std::strncmp(argv[i], "--premium=", 10) == 0 || std::strncmp(argv[i], "--premium-", 10) == 0) && mSettings.premium) {
// valid options --premium=..
const std::set valid{
"autosar",
"cert-c-2016",
"cert-c++-2016",
"cert-cpp-2016",
+ "cert-c",
+ "cert-c++",
+ "metrics",
"misra-c-2012",
"misra-c-2023",
+ "misra-c-2025",
"misra-c++-2008",
"misra-cpp-2008",
"misra-c++-2023",
"misra-cpp-2023",
"bughunting",
- "safety",
+ "safety", // TODO: deprecate in favor of the regular --safety/--no-safety
+ "safety-profiles",
"debug-progress"};
// valid options --premium-..=
const std::set valid2{
@@ -1161,12 +1148,22 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mSettings.premiumArgs += " ";
const std::string p(argv[i] + 10);
const std::string p2(p.find('=') != std::string::npos ? p.substr(0, p.find('=')) : "");
- if (!valid.count(p) && !valid2.count(p2)) {
+ const bool isCodingStandard = startsWith(p, "autosar") || startsWith(p,"cert-") || startsWith(p,"misra-") || p == "safety-profiles";
+ const std::string p3(endsWith(p,":all") && isCodingStandard ? p.substr(0,p.rfind(':')) : p);
+ if (!valid.count(p3) && !valid2.count(p2)) {
mLogger.printError("invalid --premium option '" + (p2.empty() ? p : p2) + "'.");
return Result::Fail;
}
- mSettings.premiumArgs += "--" + p;
- if (startsWith(p, "autosar") || startsWith(p, "cert") || startsWith(p, "misra")) {
+ if (p2 == "cert-c-int-precision") {
+ int tmp;
+ if (!parseNumberArg(argv[i], 31, tmp, true))
+ return Result::Fail;
+ }
+ if (p.find(' ') != std::string::npos)
+ mSettings.premiumArgs += "\"--" + p + "\"";
+ else
+ mSettings.premiumArgs += "--" + p;
+ if (isCodingStandard) {
// All checkers related to the coding standard should be enabled. The coding standards
// do not all undefined behavior or portability issues.
mSettings.addEnabled("warning");
@@ -1182,7 +1179,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
return Result::Fail;
}
- mSettings.checkAllConfigurations = false; // Can be overridden with --max-configs or --force
std::string projectFile = argv[i]+10;
projectType = project.import(projectFile, &mSettings, &mSuppressions);
if (projectType == ImportProject::Type::CPPCHECK_GUI) {
@@ -1192,17 +1188,11 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
const auto& excludedPaths = project.guiProject.excludedPaths;
std::copy(excludedPaths.cbegin(), excludedPaths.cend(), std::back_inserter(mIgnoredPaths));
- std::string platform(project.guiProject.platform);
+ if (!project.guiProject.platform.empty())
+ platform = project.guiProject.platform;
- // keep existing platform from command-line intact
- if (!platform.empty()) {
- std::string errstr;
- const std::vector paths = {projectFile, argv[0]};
- if (!mSettings.platform.set(platform, errstr, paths, mSettings.debuglookup || mSettings.debuglookupPlatform)) {
- mLogger.printError(errstr);
- return Result::Fail;
- }
- }
+ // look for external files relative to project first
+ lookupPaths.insert(lookupPaths.cbegin(), Path::getPathFromFilename(projectFile));
const auto& projectFileGui = project.guiProject.projectFile;
if (!projectFileGui.empty()) {
@@ -1215,9 +1205,15 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
}
}
}
- if (projectType == ImportProject::Type::VS_SLN || projectType == ImportProject::Type::VS_VCXPROJ) {
+ if (projectType == ImportProject::Type::COMPILE_DB)
+ mSettings.maxConfigsProject = 1;
+ if (projectType == ImportProject::Type::VS_SLN ||
+ projectType == ImportProject::Type::VS_SLNX ||
+ projectType == ImportProject::Type::VS_VCXPROJ) {
mSettings.libraries.emplace_back("windows");
}
+ for (const auto &error : project.errors)
+ mLogger.printError(error);
if (projectType == ImportProject::Type::MISSING) {
mLogger.printError("failed to open project '" + projectFile + "'. The file does not exist.");
return Result::Fail;
@@ -1239,7 +1235,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mLogger.printError("--project-configuration parameter is empty.");
return Result::Fail;
}
- if (projectType != ImportProject::Type::VS_SLN && projectType != ImportProject::Type::VS_VCXPROJ) {
+ if (projectType != ImportProject::Type::VS_SLN &&
+ projectType != ImportProject::Type::VS_SLNX &&
+ projectType != ImportProject::Type::VS_VCXPROJ) {
mLogger.printError("--project-configuration has no effect - no Visual Studio project provided.");
return Result::Fail;
}
@@ -1291,8 +1289,12 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mSettings.reportType = ReportType::certC;
} else if (typeStr == "cert-cpp-2016") {
mSettings.reportType = ReportType::certCpp;
- } else if (typeStr == "misra-c-2012" || typeStr == "misra-c-2023") {
- mSettings.reportType = ReportType::misraC;
+ } else if (typeStr == "misra-c-2012") {
+ mSettings.reportType = ReportType::misraC2012;
+ } else if (typeStr == "misra-c-2023") {
+ mSettings.reportType = ReportType::misraC2023;
+ } else if (typeStr == "misra-c-2025") {
+ mSettings.reportType = ReportType::misraC2025;
} else if (typeStr == "misra-cpp-2008") {
mSettings.reportType = ReportType::misraCpp2008;
} else if (typeStr == "misra-cpp-2023") {
@@ -1306,7 +1308,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
// Rule given at command line
else if (std::strncmp(argv[i], "--rule=", 7) == 0) {
#ifdef HAVE_RULES
- Settings::Rule rule;
+ Rule rule;
rule.pattern = 7 + argv[i];
if (rule.pattern.empty()) {
@@ -1314,6 +1316,13 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
return Result::Fail;
}
+ std::string regex_err;
+ auto regex = Regex::create(rule.pattern, Regex::Engine::Pcre, regex_err);
+ if (!regex) {
+ mLogger.printError("failed to compile rule pattern '" + rule.pattern + "' (" + regex_err + ").");
+ return Result::Fail;
+ }
+ rule.regex = std::move(regex);
mSettings.rules.emplace_back(std::move(rule));
#else
mLogger.printError("Option --rule cannot be used as Cppcheck has not been built with rules support.");
@@ -1335,7 +1344,8 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
if (node && strcmp(node->Value(), "rules") == 0)
node = node->FirstChildElement("rule");
for (; node && strcmp(node->Value(), "rule") == 0; node = node->NextSiblingElement()) {
- Settings::Rule rule;
+ Rule rule;
+ Regex::Engine regexEngine = Regex::Engine::Pcre;
for (const tinyxml2::XMLElement *subnode = node->FirstChildElement(); subnode; subnode = subnode->NextSiblingElement()) {
const char * const subname = subnode->Name();
@@ -1365,6 +1375,16 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
}
}
}
+ else if (std::strcmp(subname, "engine") == 0) {
+ const char * const engine = empty_if_null(subtext);
+ if (std::strcmp(engine, "pcre") == 0) {
+ regexEngine = Regex::Engine::Pcre;
+ }
+ else {
+ mLogger.printError(std::string("unknown regex engine '") + engine + "'.");
+ return Result::Fail;
+ }
+ }
else {
mLogger.printError("unable to load rule-file '" + ruleFile + "' - unknown element '" + subname + "' encountered in 'rule'.");
return Result::Fail;
@@ -1391,6 +1411,14 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
return Result::Fail;
}
+ std::string regex_err;
+ auto regex = Regex::create(rule.pattern, regexEngine, regex_err);
+ if (!regex) {
+ mLogger.printError("unable to load rule-file '" + ruleFile + "' - pattern '" + rule.pattern + "' failed to compile (" + regex_err + ").");
+ return Result::Fail;
+ }
+ rule.regex = std::move(regex);
+
if (rule.severity == Severity::none) {
mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule has an invalid severity.");
return Result::Fail;
@@ -1416,27 +1444,23 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
else if (std::strncmp(argv[i], "--showtime=", 11) == 0) {
const std::string showtimeMode = argv[i] + 11;
if (showtimeMode == "file")
- mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE;
+ mSettings.showtime = Settings::ShowTime::FILE;
else if (showtimeMode == "file-total")
- mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL;
+ mSettings.showtime = Settings::ShowTime::FILE_TOTAL;
else if (showtimeMode == "summary")
- mSettings.showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY;
- else if (showtimeMode == "top5") {
- mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
- mLogger.printMessage("--showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead.");
- }
+ mSettings.showtime = Settings::ShowTime::SUMMARY;
else if (showtimeMode == "top5_file")
- mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
+ mSettings.showtime = Settings::ShowTime::TOP5_FILE;
else if (showtimeMode == "top5_summary")
- mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY;
+ mSettings.showtime = Settings::ShowTime::TOP5_SUMMARY;
else if (showtimeMode == "none")
- mSettings.showtime = SHOWTIME_MODES::SHOWTIME_NONE;
+ mSettings.showtime = Settings::ShowTime::NONE;
else if (showtimeMode.empty()) {
mLogger.printError("no mode provided for --showtime");
return Result::Fail;
}
else {
- mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary.");
+ mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5_file, top5_summary.");
return Result::Fail;
}
}
@@ -1550,11 +1574,20 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
// Write results in results.xml
else if (std::strcmp(argv[i], "--xml") == 0) {
+ if (outputFormatOptionProvided) {
+ outputFormatOptionMixingError();
+ return Result::Fail;
+ }
mSettings.outputFormat = Settings::OutputFormat::xml;
+ xmlOptionProvided = true;
}
// Define the XML file version (and enable XML output)
else if (std::strncmp(argv[i], "--xml-version=", 14) == 0) {
+ if (outputFormatOptionProvided) {
+ outputFormatOptionMixingError();
+ return Result::Fail;
+ }
int tmp;
if (!parseNumberArg(argv[i], 14, tmp))
return Result::Fail;
@@ -1567,6 +1600,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mSettings.xml_version = tmp;
// Enable also XML if version is set
mSettings.outputFormat = Settings::OutputFormat::xml;
+ xmlOptionProvided = true;
}
else {
@@ -1578,9 +1612,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
}
}
- if (!loadCppcheckCfg())
- return Result::Fail;
-
// TODO: bail out?
if (!executorAuto && mSettings.useSingleJob())
mLogger.printMessage("'--executor' has no effect as only a single job will be used.");
@@ -1592,26 +1623,42 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mSettings.templateLocation = "{bold}{file}:{line}:{column}: {dim}note:{reset} {info}\\n{code}";
}
// replace static parts of the templates
- substituteTemplateFormatStatic(mSettings.templateFormat);
- substituteTemplateLocationStatic(mSettings.templateLocation);
-
- if (mSettings.force || maxconfigs)
- mSettings.checkAllConfigurations = true;
-
- if (mSettings.force)
- mSettings.maxConfigs = INT_MAX;
+ substituteTemplateFormatStatic(mSettings.templateFormat, !mSettings.outputFile.empty());
+ substituteTemplateLocationStatic(mSettings.templateLocation, !mSettings.outputFile.empty());
- else if ((def || mSettings.preprocessOnly) && !maxconfigs)
- mSettings.maxConfigs = 1U;
+ if (debug) {
+ mSettings.debugnormal = true;
+ mSettings.debugvalueflow = true;
+ if (mSettings.verbose) {
+ mSettings.debugast = true;
+ mSettings.debugsymdb = true;
+ }
+ }
if (mSettings.jobs > 1 && mSettings.buildDir.empty()) {
// TODO: bail out instead?
if (mSettings.checks.isEnabled(Checks::unusedFunction))
+ {
mLogger.printMessage("unusedFunction check requires --cppcheck-build-dir to be active with -j.");
+ mSettings.checks.disable(Checks::unusedFunction);
+ // TODO: is there some later logic to remove?
+ }
// TODO: enable
//mLogger.printMessage("whole program analysis requires --cppcheck-build-dir to be active with -j.");
}
+ if (!mSettings.checks.isEnabled(Checks::unusedFunction))
+ mSettings.unmatchedSuppressionFilters.emplace_back("unusedFunction");
+ if (!mSettings.addons.count("misra"))
+ mSettings.unmatchedSuppressionFilters.emplace_back("misra-*");
+ if (!mSettings.premium)
+ mSettings.unmatchedSuppressionFilters.emplace_back("premium-*");
+
+ if (inputAsFilter) {
+ mSettings.fileFilters.insert(mSettings.fileFilters.end(), mPathNames.cbegin(), mPathNames.cend());
+ mPathNames.clear();
+ }
+
if (!mPathNames.empty() && projectType != ImportProject::Type::NONE) {
mLogger.printError("--project cannot be used in conjunction with source files.");
return Result::Fail;
@@ -1623,14 +1670,30 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
project.ignoreOtherConfigs(vsConfig);
}
- if (!mSettings.analyzeAllVsConfigs) {
- if (projectType != ImportProject::Type::VS_SLN && projectType != ImportProject::Type::VS_VCXPROJ) {
- mLogger.printError("--no-analyze-all-vs-configs has no effect - no Visual Studio project provided.");
+ if (!platform.empty())
+ {
+ std::string errstr;
+ if (!mSettings.platform.set(platform, errstr, lookupPaths, mSettings.debuglookup || mSettings.debuglookupPlatform)) {
+ mLogger.printError(errstr);
return Result::Fail;
}
+ }
- // TODO: bail out when this does nothing
- project.selectOneVsConfig(mSettings.platform.type);
+ if (defaultSign != '\0')
+ mSettings.platform.defaultSign = defaultSign;
+
+ if (!mSettings.analyzeAllVsConfigs) {
+ if (projectType != ImportProject::Type::VS_SLN &&
+ projectType != ImportProject::Type::VS_SLNX &&
+ projectType != ImportProject::Type::VS_VCXPROJ) {
+ if (mAnalyzeAllVsConfigsSetOnCmdLine) {
+ mLogger.printError("--no-analyze-all-vs-configs has no effect - no Visual Studio project provided.");
+ return Result::Fail;
+ }
+ } else {
+ // TODO: bail out when this does nothing
+ project.selectOneVsConfig(mSettings.platform.type);
+ }
}
if (!mSettings.buildDir.empty() && !Path::isDirectory(mSettings.buildDir)) {
@@ -1648,19 +1711,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
for (auto& path : mIgnoredPaths)
{
path = Path::removeQuotationMarks(std::move(path));
- path = Path::simplifyPath(std::move(path));
-
- bool isdir = false;
- if (!Path::exists(path, &isdir) && mSettings.debugignore) {
- // FIXME: this is misleading because we match from the end of the path so it does not require to exist
- //std::cout << "path to ignore does not exist: " << path << std::endl;
- }
- // TODO: this only works when it exists
- if (isdir) {
- // If directory name doesn't end with / or \, add it
- if (!endsWith(path, '/'))
- path += '/';
- }
+ path = Path::fromNativeSeparators(std::move(path));
}
if (!project.guiProject.pathNames.empty())
@@ -1691,11 +1742,8 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
void CmdLineParser::printHelp() const
{
- const std::string manualUrl(isCppcheckPremium() ?
- "https://cppcheck.sourceforge.io/manual.pdf" :
- "https://files.cppchecksolutions.com/manual.pdf");
-
std::ostringstream oss;
+ // TODO: display product name
oss << "Cppcheck - A tool for static C/C++ code analysis\n"
"\n"
"Syntax:\n"
@@ -1747,9 +1795,9 @@ void CmdLineParser::printHelp() const
" be considered for evaluation.\n"
" --config-excludes-file=\n"
" A file that contains a list of config-excludes\n"
- " --disable= Disable individual checks.\n"
- " Please refer to the documentation of --enable=\n"
- " for further details.\n"
+ " --disable= Disable checks with the given severity.\n"
+ " Please refer to the documentation of --enable for\n"
+ " further details.\n"
" --dump Dump xml data for each translation unit. The dump\n"
" files have the extension .dump and contain ast,\n"
" tokenlist, symboldatabase, valueflow.\n"
@@ -1759,44 +1807,42 @@ void CmdLineParser::printHelp() const
" Example: '-DDEBUG=1 -D__cplusplus'.\n"
" -E Print preprocessor output on stdout and don't do any\n"
" further processing.\n"
- " --enable= Enable additional checks. The available ids are:\n"
- " * all\n"
- " Enable all checks. It is recommended to only\n"
- " use --enable=all when the whole program is\n"
- " scanned, because this enables unusedFunction.\n"
+ " --enable= Enable additional checks grouped by severity. The available\n"
+ " severities are:\n"
" * warning\n"
- " Enable warning messages\n"
- " * style\n"
- " Enable all coding style checks. All messages\n"
- " with the severities 'style', 'warning',\n"
- " 'performance' and 'portability' are enabled.\n"
" * performance\n"
- " Enable performance messages\n"
" * portability\n"
- " Enable portability messages\n"
" * information\n"
- " Enable information messages\n"
+ " * style\n"
+ " Enable checks with severities 'style', 'warning',\n"
+ " 'performance' and 'portability'.\n"
" * unusedFunction\n"
" Check for unused functions. It is recommended\n"
" to only enable this when the whole program is\n"
" scanned.\n"
" * missingInclude\n"
- " Warn if there are missing includes.\n"
- " Several ids can be given if you separate them with\n"
- " commas. See also --std\n"
+ " Check for missing include files.\n"
+ " * all\n"
+ " Enable all checks.\n"
+ " Pass multiple severities as a comma-separated list.\n"
" --error-exitcode= If errors are found, integer [n] is returned instead of\n"
" the default '0'. '" << EXIT_FAILURE << "' is returned\n"
" if arguments are not valid or if no input files are\n"
" provided. Note that your operating system can modify\n"
" this value, e.g. '256' can become '0'.\n"
" --errorlist Print a list of all the error messages in XML format.\n"
+ " --exitcode-suppress=\n"
+ " Used to specify an error ID which should not result in\n"
+ " a non-zero exitcode."
" --exitcode-suppressions=\n"
" Used when certain messages should be displayed but\n"
" should not cause a non-zero exitcode.\n"
- " --file-filter= Analyze only those files matching the given filter str\n"
- " Can be used multiple times\n"
+ " --file-filter= Analyze only those files matching the given filter str.\n"
+ " Can be used multiple times. When str is '-', the file\n"
+ " filter will be read from standard input. When str is '+',\n"
+ " given files on CLI will be treated as file filters.\n"
" Example: --file-filter=*bar.cpp analyzes only files\n"
- " that end with bar.cpp.\n"
+ " that end with bar.cpp.\n"
" --file-list= Specify the files to check in a text file. Add one\n"
" filename per line. When file is '-,' the file list will\n"
" be read from standard input.\n"
@@ -1818,10 +1864,13 @@ void CmdLineParser::printHelp() const
" this is not needed.\n"
" --include=\n"
" Force inclusion of a file before the checked file.\n"
- " -i Give a source file or source file directory to exclude\n"
- " from the check. This applies only to source files so\n"
- " header files included by source files are not matched.\n"
- " Directory name is matched to all parts of the path.\n"
+ " -i Ignore files that match . can be a filename\n"
+ " or directory and can contain *,**,?. A file that is\n"
+ " ignored will not be checked directly (the whole\n"
+ " translation unit is skipped completely). Header files\n"
+ " are checked indirectly when they are #include'd.\n"
+ " Note: If you want to prevent warnings in some headers,\n"
+ " use suppressions instead.\n"
" --inconclusive Allow that Cppcheck reports even though the analysis is\n"
" inconclusive.\n"
" There are false positives with this option. Each result\n"
@@ -1857,7 +1906,9 @@ void CmdLineParser::printHelp() const
" Specify the output format. The available formats are:\n"
" * text\n"
" * sarif\n"
- " * xml\n"
+ " * xml (deprecated)\n"
+ " * xmlv2\n"
+ " * xmlv3\n"
" --platform=, --platform=\n"
" Specifies platform specific types and sizes. The\n"
" available builtin platforms are:\n"
@@ -1893,33 +1944,43 @@ void CmdLineParser::printHelp() const
" --plist-output=\n"
" Generate Clang-plist output files in folder.\n";
- if (isCppcheckPremium()) {
+ if (mSettings.premium) {
oss <<
" --premium=