diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 00000000000..b83436861bd
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,94 @@
+---
+Checks: >
+ *,
+ -abseil-*,
+ -altera-*,
+ -android-*,
+ -boost-*,
+ -cert-*,
+ -cppcoreguidelines-*,
+ -darwin-*,
+ -fuchsia-*,
+ -google-*,
+ -hicpp-*,
+ -linuxkernel-*,
+ -llvm-*,
+ -llvmlibc-*,
+ -mpi-*,
+ -objc-*,
+ -openmp-*,
+ -zircon-*,
+ 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,
+ -misc-const-correctness,
+ -misc-no-recursion,
+ -misc-non-private-member-variables-in-classes,
+ -misc-throw-by-value-catch-by-reference,
+ -misc-use-anonymous-namespace,
+ -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,
+ -modernize-replace-auto-ptr,
+ -modernize-return-braced-init-list,
+ -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,
+ -readability-braces-around-statements,
+ -readability-container-data-pointer,
+ -readability-enum-initial-value,
+ -readability-function-cognitive-complexity,
+ -readability-function-size,
+ -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-use-concise-preprocessor-directives,
+ -misc-unconventional-assign-operator
+WarningsAsErrors: '*'
+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/.codacy.yml b/.codacy.yml
new file mode 100644
index 00000000000..dcfec8e5c10
--- /dev/null
+++ b/.codacy.yml
@@ -0,0 +1,8 @@
+exclude_paths:
+ - addons/test/**
+ - addons/y2038/test/*.c
+ - htmlreport/example.cc
+ - samples/**/bad.c
+ - samples/**/bad.cpp
+ - test/cfg/*.c
+ - test/cfg/*.cpp
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000000..ed782473718
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,19 @@
+## standard default enconding
+* text=auto
+
+## UNIX specific files
+*.sh text eol=lf
+
+## Windows specific files
+*.bat text eol=crlf
+*.cmd text eol=crlf
+*.ps1 text eol=crlf
+*.vcxproj text eol=crlf
+*.vcxproj.filters text eol=crlf
+*.sln text eol=crlf
+*.wixproj text eol=crlf
+*.wxi text eol=crlf
+*.wxs text eol=crlf
+
+## Binary resources
+*.pdf binary
\ No newline at end of file
diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml
new file mode 100644
index 00000000000..6b0ad2cc5bd
--- /dev/null
+++ b/.github/workflows/CI-cygwin.yml
@@ -0,0 +1,62 @@
+# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
+# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
+name: CI-cygwin
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+defaults:
+ run:
+ shell: cmd
+
+jobs:
+ # TODO: add CMake build
+ build_cygwin:
+ strategy:
+ matrix:
+ # only use the latest windows-* as the installed toolchain is identical
+ os: [windows-2025]
+ platform: [x86_64]
+ include:
+ - platform: 'x86_64'
+ packages: |
+ gcc-g++
+ python3
+ fail-fast: false
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Set up Cygwin
+ 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% CXXOPTS="-Werror" test
+
+ - name: Extra test for misra
+ run: |
+ cd %GITHUB_WORKSPACE%\addons\test
+ ..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64
+ python3 ..\misra.py -verify misra\misra-test.c.dump
+ ..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c
+
diff --git a/.github/workflows/CI-mingw.yml b/.github/workflows/CI-mingw.yml
new file mode 100644
index 00000000000..f308cfa5110
--- /dev/null
+++ b/.github/workflows/CI-mingw.yml
@@ -0,0 +1,75 @@
+# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
+# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
+name: CI-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
+ mingw-w64-x86_64-ccache
+ make
+ mingw-w64-x86_64-gcc
+
+ - name: ccache
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
+
+ - name: Build cppcheck
+ run: |
+ export PATH="/mingw64/lib/ccache/bin:$PATH"
+ # set RDYNAMIC to work around broken MinGW detection
+ # 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
+ # 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
+ # 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
new file mode 100644
index 00000000000..adf4a74c81b
--- /dev/null
+++ b/.github/workflows/CI-unixish-docker.yml
@@ -0,0 +1,150 @@
+# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
+# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
+name: CI-unixish-docker
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ build_cmake:
+
+ strategy:
+ matrix:
+ include:
+ - image: "ubuntu:24.04"
+ 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
+
+ # TODO: is this actually applied to the guest?
+ env:
+ # TODO: figure out why there are cache misses with PCH enabled
+ CCACHE_SLOPPINESS: pch_defines,time_macros
+
+ container:
+ image: ${{ matrix.image }}
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Install missing software on ubuntu
+ if: contains(matrix.image, 'ubuntu')
+ run: |
+ apt-get update
+ apt-get install -y cmake g++ make libxml2-utils libpcre3-dev
+
+ - name: Install missing software (gui) on latest ubuntu
+ 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
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ matrix.image }}
+
+ - name: Run CMake
+ run: |
+ 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
+ if: matrix.full_build
+ run: |
+ cmake --build cmake.output -- -j$(nproc)
+
+ - name: Run CMake test
+ run: |
+ cmake --build cmake.output --target check -- -j$(nproc)
+
+ build_make:
+
+ strategy:
+ matrix:
+ image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"]
+ fail-fast: false # Prefer quick result
+
+ runs-on: ubuntu-22.04
+
+ container:
+ image: ${{ matrix.image }}
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Install missing software on ubuntu
+ if: contains(matrix.image, 'ubuntu')
+ run: |
+ 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
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ matrix.image }}
+
+ # /usr/lib/ccache/bin - Alpine Linux
+
+ - name: Build cppcheck
+ run: |
+ 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/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) HAVE_RULES=yes test
+
+ # requires python3
+ - name: Run extra tests
+ run: |
+ test/scripts/generate_and_run_more_tests.sh
+
+ # requires which
+ - name: Validate
+ run: |
+ make -j$(nproc) checkCWEEntries validateXML
+
+ - name: Test addons
+ run: |
+ ./cppcheck --addon=threadsafety addons/test/threadsafety
+ ./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml
new file mode 100644
index 00000000000..9bac980c853
--- /dev/null
+++ b/.github/workflows/CI-unixish.yml
@@ -0,0 +1,750 @@
+# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
+# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
+name: CI-unixish
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ build_cmake_tinyxml2:
+
+ strategy:
+ matrix:
+ os: [ubuntu-22.04, macos-15]
+ 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: Install missing software on ubuntu
+ if: contains(matrix.os, 'ubuntu')
+ run: |
+ sudo apt-get update
+ sudo apt-get install libxml2-utils libtinyxml2-dev
+ # 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 tinyxml2 pcre
+
+ - name: CMake build on ubuntu (with GUI / system tinyxml2)
+ if: contains(matrix.os, 'ubuntu')
+ run: |
+ 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 -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)
+ run: |
+ cmake --build cmake.output.tinyxml2 --target check -- -j$(nproc)
+
+ build_cmake:
+
+ strategy:
+ matrix:
+ os: [ubuntu-22.04, macos-15]
+ 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 }}
+
+ # TODO: move latest compiler to separate step
+ # TODO: bail out on warnings with latest GCC
+ - name: Set up GCC
+ uses: egor-tensin/setup-gcc@v2
+ if: false # matrix.os == 'ubuntu-22.04'
+ with:
+ version: 13
+ platform: x64
+
+ - name: Select compiler
+ if: false # matrix.os == 'ubuntu-22.04'
+ run: |
+ echo "CXX=g++-13" >> $GITHUB_ENV
+
+ - 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 -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 -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: |
+ cmake --build cmake.output -- -j$(nproc)
+
+ - name: Run CMake test
+ run: |
+ cmake --build cmake.output --target check -- -j$(nproc)
+
+ - name: Run CTest
+ run: |
+ pushd cmake.output
+ ctest --output-on-failure -j$(nproc)
+
+ - 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-15]
+ fail-fast: false # Prefer quick result
+
+ runs-on: ${{ matrix.os }}
+
+ 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 }}
+
+ # coreutils contains "nproc"
+ - name: Install missing software on macos
+ if: contains(matrix.os, 'macos')
+ run: |
+ brew install coreutils
+
+ - name: Build with Unsigned char
+ run: |
+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
+ make -j$(nproc) CXXOPTS="-Werror -funsigned-char" testrunner
+
+ - name: Test with Unsigned char
+ run: |
+ ./testrunner
+
+ build_mathlib:
+
+ strategy:
+ matrix:
+ os: [ubuntu-22.04, macos-15]
+ fail-fast: false # Prefer quick result
+
+ runs-on: ${{ matrix.os }}
+
+ 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 }}
+
+ # coreutils contains "nproc"
+ - name: Install missing software on macos
+ if: contains(matrix.os, 'macos')
+ run: |
+ brew install coreutils
+
+ - name: Build with TEST_MATHLIB_VALUE
+ run: |
+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
+ make -j$(nproc) CXXOPTS="-Werror" CPPOPTS=-DTEST_MATHLIB_VALUE all
+
+ - name: Test with TEST_MATHLIB_VALUE
+ run: |
+ make -j$(nproc) test
+
+ check_nonneg:
+
+ strategy:
+ matrix:
+ os: [ubuntu-22.04, macos-15]
+ fail-fast: false # Prefer quick result
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ # coreutils contains "g++" (default is "c++") and "nproc"
+ - name: Install missing software on macos
+ if: contains(matrix.os, 'macos')
+ run: |
+ brew install coreutils
+
+ - name: Check syntax with NONNEG
+ run: |
+ 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-15]
+ include:
+ - xdist_n: auto
+ # 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@v6
+ with:
+ persist-credentials: false
+
+ - name: ccache
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
+
+ - name: Install missing software on ubuntu
+ if: contains(matrix.os, 'ubuntu')
+ run: |
+ sudo apt-get update
+ sudo apt-get install libxml2-utils
+
+ # packages for strict cfg checks
+ - name: Install missing software on ubuntu 22.04 (cfg)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ sudo apt-get install libcairo2-dev libcurl4-openssl-dev liblua5.3-dev libssl-dev libsqlite3-dev libcppunit-dev libsigc++-2.0-dev libgtk-3-dev libboost-all-dev libselinux-dev libwxgtk3.0-gtk3-dev xmlstarlet qtbase5-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 pcre gnu-sed
+
+ - name: Install missing Python packages on ubuntu
+ if: contains(matrix.os, 'ubuntu')
+ 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
+
+ # 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) CXXOPTS="-Werror" HAVE_RULES=yes
+
+ - name: Build test
+ run: |
+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
+ make -j$(nproc) CXXOPTS="-Werror" HAVE_RULES=yes testrunner
+
+ - name: Run test
+ run: |
+ make -j$(nproc) HAVE_RULES=yes test
+
+ # requires "gnu-sed" installed on macos
+ - name: Run extra tests
+ run: |
+ test/scripts/generate_and_run_more_tests.sh
+
+ - name: Run test/cli
+ run: |
+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
+
+ # TODO: use the step below instead
+ # do not use pushd in this step since we go below the working directory
+ - name: Run test/cli (symlink)
+ run: |
+ cd ..
+ ln -s cppcheck 'cpp check'
+ cd 'cpp check/test/cli'
+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }}
+
+ # FIXME: proj2_test.py fails because of the relative path cleanups in ImportProject::setRelativePaths()
+ # It fails because the application path used as base path has its symlink resolved by getcwd().
+ - name: Run test/cli (symlink)
+ if: false
+ run: |
+ ln -s . 'cpp check'
+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} 'cpp check/test/cli'
+
+ - name: Run test/cli (-j2)
+ run: |
+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
+ env:
+ TEST_CPPCHECK_INJECT_J: 2
+
+ - name: Run test/cli (--clang)
+ if: false
+ run: |
+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
+ env:
+ TEST_CPPCHECK_INJECT_CLANG: clang
+
+ - name: Run test/cli (--cppcheck-build-dir)
+ run: |
+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
+ env:
+ TEST_CPPCHECK_INJECT_BUILDDIR: injected
+
+ - name: Run cfg tests
+ if: matrix.os != 'ubuntu-22.04'
+ run: |
+ make -j$(nproc) checkcfg
+
+ - name: Run cfg tests (strict)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ make -j$(nproc) checkcfg
+ env:
+ STRICT: 1
+
+ - name: Run --dump test
+ run: |
+ ./cppcheck test/testpreprocessor.cpp --dump
+ xmllint --noout test/testpreprocessor.cpp.dump
+
+ - name: Validate
+ run: |
+ make -j$(nproc) checkCWEEntries validateXML
+
+ - name: Test install
+ run: |
+ # this is only to test the "install" target - since we did not build with FILESDIR it would not work as intended
+ make DESTDIR=cppcheck-make-install FILESDIR=/share/Cppcheck install
+ rm -rf cppcheck-make-install
+
+ - name: Test Signalhandler
+ run: |
+ 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* .
+ python3 -m pytest -Werror --strict-markers -vv test/signal/test-signalhandler.py
+ rm test-signalhandler
+
+ # no unix backtrace support on MacOs
+ - name: Test Stacktrace
+ if: contains(matrix.os, 'ubuntu')
+ run: |
+ 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* .
+ python3 -m pytest -Werror --strict-markers -vv test/signal/test-stacktrace.py
+ rm test-stacktrace
+
+ # TODO: move to scriptcheck.yml so these are tested with all Python versions?
+ - name: Test addons
+ run: |
+ set -x
+ ./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety addons/test/threadsafety
+ ./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety --std=c++03 addons/test/threadsafety
+ ./cppcheck --error-exitcode=1 --inline-suppr --addon=misra addons/test/misra/crash*.c
+ ./cppcheck --error-exitcode=1 --inline-suppr --addon=misra --enable=information addons/test/misra/config*.c
+
+ ./cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
+ pushd addons/test
+ # We'll force C89 standard to enable an additional verification for
+ # rules 5.4 and 5.5 which have standard-dependent options.
+ ../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64
+ python3 ../misra.py -verify misra/misra-test.c.dump
+ # Test slight MISRA differences in C11 standard
+ ../../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
+ # TODO: do we need to verify something here?
+ ../../cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.h
+ ../../cppcheck --dump misra/misra-test.cpp
+ python3 ../misra.py -verify misra/misra-test.cpp.dump
+ python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_ascii.txt -verify misra/misra-test.cpp.dump
+ python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_utf8.txt -verify misra/misra-test.cpp.dump
+ python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_windows1250.txt -verify misra/misra-test.cpp.dump
+ ../../cppcheck --addon=misra --enable=style --platform=avr8 --error-exitcode=1 misra/misra-test-avr8.c
+ ../../cppcheck --dump misc-test.cpp
+ python3 ../misc.py -verify misc-test.cpp.dump
+ ../../cppcheck --dump naming_test.c
+ python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
+ ../../cppcheck --dump naming_test.cpp
+ python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
+
+ # TODO: run with "-n auto" when misra_test.py can be run in parallel
+ - name: test addons (Python)
+ if: matrix.os != 'ubuntu-22.04'
+ run: |
+ python3 -m pytest -Werror --strict-markers -vv -n 1 addons/test
+ env:
+ PYTHONPATH: ./addons
+
+ # TODO: run with "-n auto" when misra_test.py can be run in parallel
+ # we cannot specify -Werror since xml/etree/ElementTree.py in Python 3.10 contains an unclosed file
+ - name: test addons (Python)
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ python3 -m pytest --strict-markers -vv -n 1 addons/test
+ env:
+ PYTHONPATH: ./addons
+
+ - name: Build democlient
+ if: matrix.os == 'ubuntu-22.04'
+ run: |
+ 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: |
+ git ls-files --others --ignored --exclude-standard
+
+ - name: Check for changed and unversioned files
+ run: |
+ # TODO: how to do this with a single command?
+ git status --ignored=no
+ git status --ignored=no | grep -q 'working tree clean'
+
+ selfcheck:
+ needs: build # wait for all tests to be successful first
+
+ runs-on: ubuntu-22.04 # run on the latest image only
+
+ 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: Install missing software on ubuntu
+ run: |
+ sudo apt-get update
+ # 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
+ sudo apt-get install libboost-container-dev
+
+ - name: Self check (build)
+ run: |
+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
+ # compile with verification and ast matchers
+ make -j$(nproc) CXXOPTS="-Werror -g -O2" CPPOPTS="-DCHECK_INTERNAL -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
+
+ - name: CMake
+ run: |
+ 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: |
+ # make sure auto-generated GUI files exist
+ make -C cmake.output autogen
+ make -C cmake.output gui-build-deps triage-build-ui-deps
+
+ - name: Self check
+ run: |
+ ./selfcheck.sh
diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml
new file mode 100644
index 00000000000..66858c7afbe
--- /dev/null
+++ b/.github/workflows/CI-windows.yml
@@ -0,0 +1,338 @@
+# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
+# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
+name: CI-windows
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+defaults:
+ run:
+ shell: cmd
+
+jobs:
+
+ build_qt:
+ strategy:
+ matrix:
+ os: [windows-2022, windows-2025]
+ qt_ver: [6.10.0]
+ 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: Install Qt ${{ matrix.qt_ver }}
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: ${{ matrix.qt_ver }}
+ modules: 'qtcharts'
+ setup-python: 'false'
+ cache: true
+
+ - name: Run CMake
+ run: |
+ 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: Build GUI
+ run: |
+ cmake --build build --config Debug --target cppcheck-gui || exit /b !errorlevel!
+
+ # TODO: can this be done in CMake?
+ - name: Deploy GUI
+ run: |
+ 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: |
+ 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:
+ matrix:
+ os: [windows-2022, windows-2025]
+ config: [debug, release]
+ fail-fast: false
+
+ runs-on: ${{ matrix.os }}
+
+ env:
+ # see https://www.pcre.org/original/changelog.txt
+ PCRE_VERSION: 8.45
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Set up Python
+ if: matrix.config == 'release'
+ uses: actions/setup-python@v6
+ with:
+ python-version: '3.14'
+ check-latest: true
+
+ - name: Set up Visual Studio environment
+ uses: ilammy/msvc-dev-cmd@v1
+ with:
+ arch: x64
+
+ - name: Cache PCRE
+ id: cache-pcre
+ uses: actions/cache@v5
+ with:
+ path: |
+ externals\pcre.h
+ externals\pcre.lib
+ externals\pcre64.lib
+ key: pcre-${{ env.PCRE_VERSION }}-x64-bin-win
+
+ - name: Download PCRE
+ if: steps.cache-pcre.outputs.cache-hit != 'true'
+ run: |
+ curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
+
+ - name: Install PCRE
+ if: steps.cache-pcre.outputs.cache-hit != 'true'
+ run: |
+ @echo on
+ 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 -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!
+ env:
+ CL: /MP
+
+ - name: Install missing Python packages
+ if: matrix.config == 'release'
+ run: |
+ python -m pip install pip --upgrade || exit /b !errorlevel!
+ python -m pip install pytest || exit /b !errorlevel!
+ python -m pip install pytest-custom_exit_code || exit /b !errorlevel!
+ python -m pip install pytest-timeout || exit /b !errorlevel!
+ python -m pip install pytest-xdist || exit /b !errorlevel!
+ python -m pip install psutil || exit /b !errorlevel!
+
+ - name: Build CLI debug configuration using MSBuild
+ if: matrix.config == 'debug'
+ run: |
+ :: cmake --build build --target check --config Debug || exit /b !errorlevel!
+ msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel!
+ env:
+ _CL_: /WX
+
+ - name: Run Debug test
+ if: matrix.config == 'debug'
+ run: .\bin\debug\testrunner.exe -t || exit /b !errorlevel!
+
+ - name: Build CLI release configuration using MSBuild
+ if: matrix.config == 'release'
+ run: |
+ :: cmake --build build --target check --config Release || exit /b !errorlevel!
+ msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel!
+ env:
+ _CL_: /WX
+
+ - name: Run Release test
+ if: matrix.config == 'release'
+ run: .\bin\testrunner.exe || exit /b !errorlevel!
+
+ - name: Prepare test/cli
+ if: matrix.config == 'release'
+ run: |
+ :: since FILESDIR is not set copy the binary to the root so the addons are found
+ :: copy .\build\bin\Release\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
+ copy .\bin\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
+ copy .\bin\cppcheck-core.dll .\cppcheck-core.dll || exit /b !errorlevel!
+
+ - name: Run test/cli
+ if: matrix.config == 'release'
+ run: |
+ python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
+
+ - name: Run test/cli (-j2)
+ if: matrix.config == 'release'
+ run: |
+ python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
+ env:
+ TEST_CPPCHECK_INJECT_J: 2
+
+ # TODO: install clang
+ - name: Run test/cli (--clang)
+ if: false # matrix.config == 'release'
+ run: |
+ python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
+ env:
+ TEST_CPPCHECK_INJECT_CLANG: clang
+
+ - name: Run test/cli (--cppcheck-build-dir)
+ if: matrix.config == 'release'
+ run: |
+ python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
+ env:
+ TEST_CPPCHECK_INJECT_BUILDDIR: injected
+
+ # TODO: test with Release configuration?
+ - name: Test SEH wrapper
+ if: matrix.config == 'release'
+ run: |
+ 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!
+ python3 -m pytest -Werror --strict-markers -vv test/seh/test-sehwrapper.py || exit /b !errorlevel!
+ del test-sehwrapper.exe || exit /b !errorlevel!
+
+ - name: Test addons
+ if: matrix.config == 'release'
+ run: |
+ echo on
+ .\cppcheck --addon=threadsafety addons\test\threadsafety || exit /b !errorlevel!
+ .\cppcheck --addon=threadsafety --std=c++03 addons\test\threadsafety || exit /b !errorlevel!
+ .\cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c || exit /b !errorlevel!
+ cd addons\test
+ rem We'll force C89 standard to enable an additional verification for
+ rem rules 5.4 and 5.5 which have standard-dependent options.
+ ..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 || exit /b !errorlevel!
+ python3 ..\misra.py -verify misra\misra-test.c.dump || exit /b !errorlevel!
+ rem Test slight MISRA differences in C11 standard
+ ..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test-c11.c --std=c11 --platform=unix64 || exit /b !errorlevel!
+ python3 ..\misra.py -verify misra\misra-test-c11.c.dump || exit /b !errorlevel!
+ rem TODO: do we need to verify something here?
+ ..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra\misra-test.h || exit /b !errorlevel!
+ ..\..\cppcheck --dump misra\misra-test.cpp || exit /b !errorlevel!
+ python3 ..\misra.py -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
+ python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_ascii.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
+ python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_utf8.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
+ python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_windows1250.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
+ ..\..\cppcheck --addon=misra --enable=style --platform=avr8 --error-exitcode=1 misra\misra-test-avr8.c || exit /b !errorlevel!
+ ..\..\cppcheck --dump misc-test.cpp || exit /b !errorlevel!
+ python3 ..\misc.py -verify misc-test.cpp.dump || exit /b !errorlevel!
+ ..\..\cppcheck --dump naming_test.c || exit /b !errorlevel!
+ rem TODO: fix this - does not fail on Linux
+ rem python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump || exit /b !errorlevel!
+ ..\..\cppcheck --dump naming_test.cpp || exit /b !errorlevel!
+ python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump || exit /b !errorlevel!
+
+ # TODO: run with "-n auto" when misra_test.py can be run in parallel
+ - name: test addons (Python)
+ if: matrix.config == 'release'
+ run: |
+ python -m pytest -Werror --strict-markers -vv -n 1 addons/test || exit /b !errorlevel!
+ env:
+ PYTHONPATH: ./addons
+
+ - name: Check Windows test syntax
+ if: matrix.config == 'debug'
+ run: |
+ cd test\cfg
+ cl.exe windows.cpp -DUNICODE=1 -D_UNICODE=1 /Zs || exit /b !errorlevel!
+ cl.exe mfc.cpp /EHsc /Zs || exit /b !errorlevel!
+
+ - name: Show all ignored files
+ if: false # TODO: currently lists all the contents of ignored folders - we only need what actually matched
+ run: |
+ git ls-files --others --ignored --exclude-standard || exit /b !errorlevel!
+
+ - name: Check for changed and unversioned files
+ run: |
+ :: TODO: how to do this with a single command?
+ git status --ignored=no
+ :: TODO: make this work
+ :: git status --ignored=no | grep -q 'working tree clean'
diff --git a/.github/workflows/buildman.yml b/.github/workflows/buildman.yml
new file mode 100644
index 00000000000..e84cf4bffd9
--- /dev/null
+++ b/.github/workflows/buildman.yml
@@ -0,0 +1,65 @@
+# 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: Build manual
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ convert_via_pandoc:
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - run: |
+ mkdir output
+
+ - uses: docker://pandoc/latex:3.6.3
+ with:
+ args: --output=output/manual.html man/manual.md
+
+ - uses: docker://pandoc/latex:3.6.3
+ with:
+ args: --output=output/manual.pdf man/manual.md
+
+ - uses: docker://pandoc/latex:3.6.3
+ with:
+ args: --output=output/manual-premium.pdf man/manual-premium.md
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: output
+ path: output
+
+ manpage:
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Install missing software on ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y xsltproc docbook-xsl
+
+ - name: build manpage
+ run: |
+ make man
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: cppcheck.1
+ path: cppcheck.1
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml
new file mode 100644
index 00000000000..400fb929786
--- /dev/null
+++ b/.github/workflows/cifuzz.yml
@@ -0,0 +1,34 @@
+# 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: CIFuzz
+
+on: [pull_request]
+
+permissions:
+ contents: read
+
+jobs:
+ Fuzzing:
+ runs-on: ubuntu-latest
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
+ steps:
+ - name: Build Fuzzers
+ id: build
+ uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'cppcheck'
+ dry-run: false
+ language: c++
+ - name: Run Fuzzers
+ uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'cppcheck'
+ fuzz-seconds: 300
+ dry-run: false
+ language: c++
+ - name: Upload Crash
+ uses: actions/upload-artifact@v7
+ if: failure() && steps.build.outcome == 'success'
+ with:
+ name: artifacts
+ path: ./out/artifacts
diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml
new file mode 100644
index 00000000000..4f2db4ab113
--- /dev/null
+++ b/.github/workflows/clang-tidy.yml
@@ -0,0 +1,93 @@
+# 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: clang-tidy
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+ schedule:
+ - cron: '0 0 * * 0'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-22.04
+
+ env:
+ QT_VERSION: 6.10.0
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Install missing software
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y cmake make
+ sudo apt-get install -y libpcre3-dev
+ sudo apt-get install -y libgl-dev # fixes missing dependency for Qt in CMake
+
+ - 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 22
+ sudo apt-get install -y clang-tidy-22
+
+ - name: Install Qt ${{ env.QT_VERSION }}
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: ${{ env.QT_VERSION }}
+ modules: 'qtcharts'
+ setup-python: 'false'
+ install-deps: false
+ cache: true
+
+ - name: Verify clang-tidy configuration
+ run: |
+ clang-tidy-22 --verify-config
+
+ - name: Prepare CMake
+ run: |
+ 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-22
+ CXX: clang++-22
+
+ - name: Prepare CMake dependencies
+ run: |
+ # make sure the auto-generated GUI sources exist
+ make -C cmake.output autogen
+ # make sure the precompiled headers exist
+ make -C cmake.output/cli cmake_pch.hxx.pch
+ make -C cmake.output/gui cmake_pch.hxx.pch
+ make -C cmake.output/lib cmake_pch.hxx.pch
+ make -C cmake.output/test cmake_pch.hxx.pch
+
+ - name: Clang-Tidy
+ if: ${{ github.event.schedule == '' && github.event_name != 'workflow_dispatch' }}
+ run: |
+ cmake --build cmake.output --target run-clang-tidy 2> /dev/null
+
+ - name: Clang Static Analyzer
+ if: ${{ github.event.schedule != '' || github.event_name == 'workflow_dispatch' }}
+ run: |
+ cmake --build cmake.output --target run-clang-tidy-csa 2> /dev/null
+
+ - uses: actions/upload-artifact@v7
+ if: success() || failure()
+ with:
+ name: Compilation Database
+ path: ./cmake.output/compile_commands.json
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 00000000000..84d37423d2e
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,52 @@
+# 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: "CodeQL"
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-22.04
+ permissions:
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ # Override automatic language detection by changing the below list
+ # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
+ language: ['cpp', 'python']
+ # Learn more...
+ # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v4
+ with:
+ languages: ${{ matrix.language }}
+
+ - name: Build cppcheck
+ if: matrix.language == 'cpp'
+ run: |
+ make -j$(nproc) CXXOPTS="-Werror" HAVE_RULES=yes CPPCHK_GLIBCXX_DEBUG= cppcheck
+
+ - name: Perform CodeQL Analysis
+ 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
new file mode 100644
index 00000000000..b5e496adcf6
--- /dev/null
+++ b/.github/workflows/coverage.yml
@@ -0,0 +1,71 @@
+# 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: Coverage
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-22.04
+
+ 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 libxml2-utils lcov
+
+ - name: Install missing Python packages on ubuntu
+ run: |
+ python -m pip install pip --upgrade
+ python -m pip install lcov_cobertura
+
+ - name: Compile instrumented
+ run: |
+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
+ make -j$(nproc) CXXOPTS="-Werror -g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes CPPCHK_GLIBCXX_DEBUG= all
+
+ - name: Run instrumented tests
+ run: |
+ ./testrunner
+ test/cfg/runtests.sh
+
+ - name: Generate coverage report
+ run: |
+ gcov lib/*.cpp -o lib/
+ lcov --directory ./ --capture --output-file lcov_tmp.info -b ./
+ lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info
+ genhtml lcov.info -o coverage_report --frame --legend --demangle-cpp
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: Coverage results
+ path: coverage_report
+
+ - uses: codecov/codecov-action@v5
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ # file: ./coverage.xml # optional
+ flags: unittests # optional
+ name: ${{ github.repository }} # optional
+ fail_ci_if_error: true # optional (default = false):
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
new file mode 100644
index 00000000000..4c62971e4c4
--- /dev/null
+++ b/.github/workflows/coverity.yml
@@ -0,0 +1,41 @@
+# 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: Coverity
+
+on:
+ schedule:
+ - cron: "0 0 * * *"
+
+permissions:
+ contents: read
+
+jobs:
+ scan:
+ runs-on: ubuntu-latest
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+ - name: Install missing software on ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev libboost-container-dev
+ - name: Download Coverity build tool
+ run: |
+ wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=cppcheck" -O coverity_tool.tar.gz
+ mkdir coverity_tool
+ tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool
+ - name: Build with Coverity build tool
+ run: |
+ export PATH=`pwd`/coverity_tool/bin:$PATH
+ cov-build --dir cov-int make CPPCHK_GLIBCXX_DEBUG=
+ - name: Submit build result to Coverity Scan
+ run: |
+ tar czvf cov.tar.gz cov-int
+ curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
+ --form email=daniel.marjamaki@gmail.com \
+ --form file=@cov.tar.gz \
+ --form version="Commit $GITHUB_SHA" \
+ --form description="Development" \
+ https://scan.coverity.com/builds?project=cppcheck
diff --git a/.github/workflows/cppcheck-premium.yml b/.github/workflows/cppcheck-premium.yml
new file mode 100644
index 00000000000..b99cccd69da
--- /dev/null
+++ b/.github/workflows/cppcheck-premium.yml
@@ -0,0 +1,72 @@
+# 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: cppcheck-premium
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+ workflow_dispatch:
+ inputs:
+ premium_version:
+ description: 'Cppcheck Premium version'
+
+permissions:
+ contents: read
+ security-events: write
+
+jobs:
+
+ build:
+ runs-on: ubuntu-24.04 # run on the latest image only
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Download cppcheckpremium release
+ run: |
+ premium_version=${{ inputs.premium_version }}
+ if [ -z $premium_version ]; then
+ 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
+ wget https://files.cppchecksolutions.com/$premium_version/ubuntu-24.04/cppcheckpremium-$premium_version-amd64.tar.gz -O cppcheckpremium.tar.gz
+ fi
+ tar xzf cppcheckpremium.tar.gz
+ mv cppcheckpremium-$premium_version cppcheckpremium
+
+ - name: Generate a license file
+ run: |
+ echo cppcheck > cppcheck.lic
+ echo 261231 >> cppcheck.lic
+ echo 80000 >> 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 --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
new file mode 100644
index 00000000000..4ec72f935fd
--- /dev/null
+++ b/.github/workflows/format.yml
@@ -0,0 +1,55 @@
+# 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: format
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-22.04
+
+ env:
+ UNCRUSTIFY_VERSION: 0.80.1
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Cache uncrustify
+ uses: actions/cache@v5
+ id: cache-uncrustify
+ with:
+ path: |
+ ~/uncrustify
+ key: ${{ runner.os }}-uncrustify-${{ env.UNCRUSTIFY_VERSION }}
+
+ - name: build uncrustify
+ if: steps.cache-uncrustify.outputs.cache-hit != 'true'
+ run: |
+ set -x
+ wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-${{ env.UNCRUSTIFY_VERSION }}.tar.gz
+ tar xzvf uncrustify-${{ env.UNCRUSTIFY_VERSION }}.tar.gz
+ cd uncrustify-uncrustify-${{ env.UNCRUSTIFY_VERSION }}
+ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
+ cmake --build build -- -j$(nproc) -s
+ mkdir ~/uncrustify
+ cp build/uncrustify ~/uncrustify/
+
+ - name: Uncrustify check
+ run: |
+ 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
new file mode 100644
index 00000000000..2e54b92541e
--- /dev/null
+++ b/.github/workflows/iwyu.yml
@@ -0,0 +1,269 @@
+# 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: include-what-you-use
+
+on:
+ schedule:
+ - cron: '0 0 * * 0'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ iwyu:
+
+ strategy:
+ matrix:
+ # "opensuse/tumbleweed:latest" / "fedora:rawhide" / "debian:unstable" / "archlinux:latest"
+ include:
+ - os: ubuntu-22.04
+ image: "fedora:rawhide"
+ stdlib: libstdc++
+ - os: ubuntu-22.04
+ image: "fedora:rawhide"
+ stdlib: libc++
+ - 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 == 'cppcheck-opensource' }}
+
+ container:
+ image: ${{ matrix.image }}
+
+ env:
+ QT_VERSION: 6.10.0
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Install missing software on debian/ubuntu
+ if: contains(matrix.image, 'debian')
+ run: |
+ apt-get update
+ apt-get install -y cmake clang make libpcre3-dev
+ apt-get install -y libgl-dev # fixes missing dependency for Qt in CMake
+ apt-get install -y iwyu
+
+ - name: Install missing software on archlinux
+ if: contains(matrix.image, 'archlinux')
+ run: |
+ set -x
+ pacman -Sy
+ pacman -S cmake make clang pcre --noconfirm
+ pacman -S libglvnd --noconfirm # fixes missing dependency for Qt in CMake
+ pacman-key --init
+ pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
+ pacman-key --lsign-key 3056513887B78AEB
+ pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm
+ echo "[chaotic-aur]" >> /etc/pacman.conf
+ echo "Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf
+ pacman -Sy
+ pacman -S include-what-you-use --noconfirm
+ ln -s iwyu-tool /usr/sbin/iwyu_tool
+
+ - name: Install missing software on Fedora
+ if: contains(matrix.image, 'fedora')
+ run: |
+ 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
+
+ - name: Install missing software on Fedora (libc++)
+ if: contains(matrix.image, 'fedora') && matrix.stdlib == 'libc++'
+ run: |
+ dnf install -y libcxx-devel
+
+ - name: Install missing software on OpenSUSE
+ if: contains(matrix.image, 'opensuse')
+ run: |
+ zypper install -y cmake clang pcre-devel
+ zypper install -y include-what-you-use-tools
+ ln -s iwyu_tool.py /usr/bin/iwyu_tool
+
+ # coreutils contains "nproc"
+ - name: Install missing software on macOS
+ if: contains(matrix.os, 'macos')
+ run: |
+ brew install include-what-you-use pcre coreutils
+ # 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: ${{ contains(matrix.os, 'macos') }}
+ install-deps: false
+ cache: true
+
+ - name: Generate macOS mappings
+ if: contains(matrix.os, 'macos')
+ run: |
+ set -x
+
+ wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-apple-libc.py
+ python3 iwyu-mapgen-apple-libc.py $(xcrun --show-sdk-path)/usr/include > macos.imp
+
+ - name: Prepare CMake
+ run: |
+ # 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++
+
+ # Fails on Debian:
+ # /__w/cppcheck/Qt/6.7.0/gcc_64/libexec/rcc: error while loading shared libraries: libglib-2.0.so.0: cannot open shared object file: No such file or directory
+ - name: Prepare CMake dependencies
+ run: |
+ # make sure the auto-generated GUI sources exist
+ make -C cmake.output autogen
+ # make sure the precompiled headers exist
+ #make -C cmake.output/cli cmake_pch.hxx.pch
+ #make -C cmake.output/gui cmake_pch.hxx.pch
+ #make -C cmake.output/lib cmake_pch.hxx.pch
+ #make -C cmake.output/test cmake_pch.hxx.pch
+ # make sure the auto-generated GUI dependencies exist
+ make -C cmake.output gui-build-deps
+ make -C cmake.output triage-build-ui-deps
+
+ - name: iwyu_tool
+ run: |
+ 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@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@v7
+ if: ${{ contains(matrix.os, 'macos') && (success() || failure()) }}
+ with:
+ name: macOS Mappings
+ path: |
+ ./iwyu-mapgen-apple-libc.py
+ ./macos.imp
+
+ - uses: actions/upload-artifact@v7
+ if: success() || failure()
+ with:
+ name: Logs (include-what-you-use - ${{ matrix.os }} ${{ matrix.stdlib }})
+ path: ./*.log
+
+ clang-include-cleaner:
+
+ strategy:
+ matrix:
+ stdlib: [libstdc++, libc++]
+ include:
+ - stdlib: libstdc++
+ use_libcxx: Off
+ - stdlib: libc++
+ use_libcxx: On
+ fail-fast: false
+
+ runs-on: ubuntu-22.04
+ if: ${{ github.repository_owner == 'cppcheck-opensource' }}
+
+ env:
+ QT_VERSION: 6.10.0
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Install missing software
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y cmake make libpcre3-dev
+ sudo apt-get install -y libgl-dev # missing dependency for using Qt in CMake
+
+ - 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 22
+ sudo apt-get install -y clang-tools-22
+
+ - name: Install libc++
+ if: matrix.stdlib == 'libc++'
+ run: |
+ sudo apt-get install -y libc++-22-dev
+
+ - name: Install Qt ${{ env.QT_VERSION }}
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: ${{ env.QT_VERSION }}
+ modules: 'qtcharts'
+ setup-python: 'false'
+ install-deps: false
+ cache: true
+
+ - name: Prepare CMake
+ run: |
+ # 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-22
+ CXX: clang++-22
+
+ - name: Prepare CMake dependencies
+ run: |
+ # make sure the auto-generated GUI sources exist
+ make -C cmake.output autogen
+ # make sure the precompiled headers exist
+ #make -C cmake.output/cli cmake_pch.hxx.pch
+ #make -C cmake.output/gui cmake_pch.hxx.pch
+ #make -C cmake.output/lib cmake_pch.hxx.pch
+ #make -C cmake.output/test cmake_pch.hxx.pch
+ # make sure the auto-generated GUI dependencies exist
+ make -C cmake.output gui-build-deps
+
+ - 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-22 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1
+
+ - 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@v7
+ if: success() || failure()
+ with:
+ name: Logs (clang-include-cleaner - ${{ matrix.stdlib }})
+ path: ./*.log
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
new file mode 100644
index 00000000000..aa467d7b875
--- /dev/null
+++ b/.github/workflows/release-windows.yml
@@ -0,0 +1,215 @@
+# 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
+
+on:
+ push:
+ tags:
+ - '2.*'
+ schedule:
+ - cron: '0 0 * * *'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+defaults:
+ run:
+ shell: cmd
+
+jobs:
+
+ build:
+
+ runs-on: windows-2025
+ 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.10.0
+ BOOST_MINOR_VERSION: 89
+
+ steps:
+ - 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
+
+ - name: Download PCRE
+ run: |
+ curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
+
+ - name: Install PCRE
+ run: |
+ @echo on
+ 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 . -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
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: ${{ env.QT_VERSION }}
+ modules: 'qtcharts'
+ setup-python: 'false'
+ tools: 'tools_opensslv3_x64'
+
+ # 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 -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
+ - name: Deploy app
+ 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!
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: deploy
+ path: build\bin\Release
+
+ - name: Matchcompiler
+ run: python tools\matchcompiler.py --write-dir lib || exit /b !errorlevel!
+
+ # TODO: build with multiple threads
+ - name: Build CLI x64 release configuration using MSBuild
+ 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@v7
+ with:
+ name: bin
+ path: bin
+
+ - name: Install missing Python packages
+ run: |
+ pip install -U pyinstaller || exit /b !errorlevel!
+
+ # TODO: include in installer?
+ - name: Compile misra.py executable
+ run: |
+ cd addons || exit /b !errorlevel!
+ pyinstaller --hidden-import xml --hidden-import xml.etree --hidden-import xml.etree.ElementTree misra.py || exit /b !errorlevel!
+ del *.spec || exit /b !errorlevel!
+
+ # TODO: include in installer?
+ - name: Compile cppcheck-htmlreport executable
+ run: |
+ cd htmlreport || exit /b !errorlevel!
+ pyinstaller cppcheck-htmlreport || exit /b !errorlevel!
+ del *.spec || exit /b !errorlevel!
+
+ # TODO: test the compiled Python files
+
+ - name: Collect files
+ run: |
+ @echo on
+ move build\bin\Release win_installer\files || exit /b !errorlevel!
+ copy AUTHORS win_installer\files\authors.txt || 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!
+ copy externals\tinyxml2\LICENSE win_installer\files\tinyxml2-license.txt || exit /b !errorlevel!
+ copy addons\dist\misra\*.* win_installer\files\addons || exit /b !errorlevel!
+ copy bin\cppcheck.exe win_installer\files || exit /b !errorlevel!
+ copy bin\cppcheck-core.dll win_installer\files || exit /b !errorlevel!
+ :: mkdir win_installer\files\help || exit /b !errorlevel!
+ xcopy /s gui\help win_installer\files\help || exit /b !errorlevel!
+ copy gui\help\online-help.qhc win_installer\files\ || exit /b !errorlevel!
+ copy gui\help\online-help.qch win_installer\files\ || exit /b !errorlevel!
+ del win_installer\files\cfg\*.rng || exit /b !errorlevel!
+ del win_installer\files\platforms\*.rng || exit /b !errorlevel!
+ del win_installer\files\translations\*.qm || exit /b !errorlevel!
+ move build\gui\*.qm win_installer\files\translations || exit /b !errorlevel!
+ copy htmlreport\dist\cppcheck-htmlreport\*.* win_installer\files || exit /b !errorlevel!
+ :: 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@v7
+ with:
+ name: collect
+ path: win_installer\files
+
+ - name: Build Installer
+ run: |
+ cd win_installer || exit /b !errorlevel!
+ :: Read ProductVersion
+ for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a
+ :: Remove double quotes
+ set PRODUCTVER=%PRODUCTVER:"=%
+ @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@v7
+ with:
+ name: installer
+ path: win_installer/Build/
+
+ - name: Clean up deploy
+ run: |
+ @echo on
+ :: del win_installer\files\addons\*.dll || exit /b !errorlevel!
+ del win_installer\files\addons\*.doxyfile || exit /b !errorlevel!
+ del win_installer\files\addons\*.md || exit /b !errorlevel!
+ :: del win_installer\files\addons\*.pyd || exit /b !errorlevel!
+ :: del win_installer\files\addons\base_library.zip || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\addons\test || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\addons\doc || exit /b !errorlevel!
+ :: rmdir /s /q win_installer\files\bearer || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\generic || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\help || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\iconengines || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\imageformats || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\networkinformation || exit /b !errorlevel!
+ :: rmdir /s /q win_installer\files\printsupport || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\sqldrivers || exit /b !errorlevel!
+ rmdir /s /q win_installer\files\tls || exit /b !errorlevel!
+ ren win_installer\files\translations lang || exit /b !errorlevel!
+ del win_installer\files\d3dcompiler_47.dll || exit /b !errorlevel!
+ del win_installer\files\dxcompiler.dll || exit /b !errorlevel!
+ del win_installer\files\dxil.dll || exit /b !errorlevel!
+ del win_installer\files\dmake.exe || exit /b !errorlevel!
+ del win_installer\files\dmake.pdb || exit /b !errorlevel!
+ :: del win_installer\files\libEGL.dll || exit /b !errorlevel!
+ :: del win_installer\files\libGLESv2.dll || exit /b !errorlevel!
+ del win_installer\files\opengl32sw.dll || exit /b !errorlevel!
+ del win_installer\files\Qt6Svg.dll || exit /b !errorlevel!
+ del win_installer\files\vc_redist.x64.exe || exit /b !errorlevel!
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: portable
+ path: win_installer\files
diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml
new file mode 100644
index 00000000000..6021d1237d2
--- /dev/null
+++ b/.github/workflows/sanitizers.yml
@@ -0,0 +1,168 @@
+# 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: sanitizers
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+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.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@v6
+ with:
+ persist-credentials: false
+
+ - name: ccache
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.sanitizer }}
+
+ - name: Set up Python
+ uses: actions/setup-python@v6
+ with:
+ python-version: '3.14'
+ 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 22
+
+ - 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 -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-22
+ CXX: clang++-22
+
+ - 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 -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)
+
+ - 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: ${{ matrix.inject_executor }}
+
+ - 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: matrix.run_selfcheck
+ 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: 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_san.sh ./cmake.output ${{ matrix.selfcheck_opts }}
diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml
new file mode 100644
index 00000000000..8cee3c5a5b4
--- /dev/null
+++ b/.github/workflows/scriptcheck.yml
@@ -0,0 +1,222 @@
+# 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: scriptcheck
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-22.04
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: ccache
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ github.workflow }}-${{ runner.os }}
+
+ - name: Cache Cppcheck
+ uses: actions/cache@v5
+ with:
+ path: cppcheck
+ key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }}
+
+ - name: build cppcheck
+ run: |
+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
+ make -j$(nproc) CXXOPTS="-Werror"
+ strip -s ./cppcheck
+
+ scriptcheck:
+
+ needs: build
+ runs-on: ubuntu-22.04
+ strategy:
+ matrix:
+ python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13', '3.14']
+ include:
+ - python-version: '3.14'
+ python-latest: true
+
+ fail-fast: false
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ # TODO: bailout on error
+ - name: Restore Cppcheck
+ 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@v6
+ with:
+ python-version: ${{ matrix.python-version }}
+ check-latest: true
+
+ - name: Install missing software on ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install tidy libxml2-utils
+
+ - name: Install missing software on ubuntu (Python 3)
+ run: |
+ # shellcheck cannot be installed via pip
+ # ERROR: Could not find a version that satisfies the requirement shellcheck (from versions: none)
+ # ERROR: No matching distribution found for shellcheck
+ sudo apt-get install shellcheck
+ python -m pip install pip --upgrade
+ python -m pip install natsort
+ python -m pip install pexpect
+ python -m pip install 'pylint<4.1.0'
+ python -m pip install unittest2
+ python -m pip install pytest
+ python -m pip install pytest-xdist
+ python -m pip install pygments
+ python -m pip install requests
+ python -m pip install psutil
+ python -m pip install setuptools
+
+ - name: run Shellcheck
+ if: matrix.python-latest
+ run: |
+ find . -name "*.sh" | xargs shellcheck --exclude SC2002,SC2013,SC2034,SC2035,SC2043,SC2046,SC2086,SC2089,SC2090,SC2129,SC2211,SC2231
+
+ - name: run pylint
+ if: matrix.python-latest
+ run: |
+ shopt -s globstar
+ pylint --jobs $(nproc) --py-version 3.7 addons/**/*.py htmlreport/cppcheck-htmlreport htmlreport/**/*.py test/**/*.py tools/**/*.py
+
+ - name: check .json files
+ if: matrix.python-latest
+ run: |
+ find . -name '*.json' | xargs -n 1 python -m json.tool > /dev/null
+
+ - name: Validate
+ if: matrix.python-latest
+ run: |
+ make -j$(nproc) validateCFG validatePlatforms validateRules
+
+ - name: check python syntax
+ run: |
+ shopt -s globstar
+ python -m py_compile addons/**/*.py
+ python -m py_compile htmlreport/cppcheck-htmlreport
+ python -m py_compile htmlreport/**/*.py
+ python -m py_compile test/**/*.py
+ python -m py_compile tools/**/*.py
+
+ - name: compile addons
+ run: |
+ python -m compileall ./addons
+
+ - name: test matchcompiler
+ run: |
+ python test/tools/test_matchcompiler.py
+ env:
+ PYTHONPATH: ./tools
+
+ # TODO: run with "-n auto" when misra_test.py can be run in parallel
+ # we cannot specify -Werror since xml/etree/ElementTree.py in Python 3.9/3.10 contains an unclosed file
+ - name: test addons
+ if: matrix.python-version == '3.9' || matrix.python-version == '3.10'
+ run: |
+ python -m pytest --strict-markers -vv -n 1 addons/test
+ env:
+ PYTHONPATH: ./addons
+
+ # TODO: run with "-n auto" when misra_test.py can be run in parallel
+ - name: test addons
+ if: matrix.python-version != '3.9' && matrix.python-version != '3.10'
+ run: |
+ python -m pytest -Werror --strict-markers -vv -n 1 addons/test
+ env:
+ PYTHONPATH: ./addons
+
+ - name: test htmlreport (standalone)
+ run: |
+ test/tools/htmlreport/test_htmlreport.py
+ test/tools/htmlreport/check.sh
+
+ - name: test htmlreport (pip)
+ run: |
+ python -m venv venv
+ source venv/bin/activate
+ python -m pip install -U pip
+ pip install ./htmlreport/
+ which cppcheck-htmlreport
+ PIP_PACKAGE_TEST=1 test/tools/htmlreport/test_htmlreport.py
+ # TODO: does not test the pip binary
+ test/tools/htmlreport/check.sh
+
+ - name: test reduce
+ run: |
+ python -m pytest -Werror --strict-markers -vv test/tools/reduce_test.py
+ env:
+ PYTHONPATH: ./tools
+
+ - name: test donate_cpu_lib
+ run: |
+ python -m pytest -Werror --strict-markers -vv test/tools/donate_cpu_lib_test.py
+ env:
+ PYTHONPATH: ./tools
+
+ - name: test donate_cpu_server
+ run: |
+ python -m pytest -Werror --strict-markers -vv test/tools/donate_cpu_server_test.py
+ # TODO: why is this file generated? also should be in a temporary folder if possible
+ rm -f test/tools/donate-cpu-server.log
+ env:
+ PYTHONPATH: ./tools
+
+ - name: Show all ignored files
+ if: false # TODO: currently lists all the contents of ignored folders - we only need what actually matched
+ run: |
+ git ls-files --others --ignored --exclude-standard
+
+ - name: Check for changed and unversioned files
+ run: |
+ # TODO: how to do this with a single command?
+ git status --ignored=no
+ git status --ignored=no | grep -q 'working tree clean'
+
+ dmake:
+ strategy:
+ matrix:
+ os: [ubuntu-22.04, macos-15, windows-2025]
+ fail-fast: false
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: run dmake
+ run: |
+ make -j3 CXXOPTS="-Werror" run-dmake
+
+ - name: check diff
+ run: |
+ git diff --exit-code
diff --git a/.github/workflows/selfcheck.yml b/.github/workflows/selfcheck.yml
new file mode 100644
index 00000000000..f16ce8d8332
--- /dev/null
+++ b/.github/workflows/selfcheck.yml
@@ -0,0 +1,234 @@
+# 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: selfcheck
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-22.04
+
+ env:
+ QT_VERSION: 6.10.0
+
+ 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
+ run: |
+ sudo apt-get update
+ sudo apt-get install clang-14
+ sudo apt-get install libboost-container-dev
+ sudo apt-get install valgrind
+ sudo apt-get install -y libgl-dev # fixes missing dependency for Qt in CMake
+
+ - name: Install Qt ${{ env.QT_VERSION }}
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: ${{ env.QT_VERSION }}
+ modules: 'qtcharts'
+ setup-python: 'false'
+ install-deps: false
+ cache: true
+
+ # TODO: cache this - perform same build as for the other self check
+ - name: Self check (build)
+ run: |
+ 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) CXXOPTS="-Werror -O2 -gdwarf-4" CPPOPTS="-DHAVE_BOOST -mllvm -inline-deferral" MATCHCOMPILER=yes CPPCHK_GLIBCXX_DEBUG=
+ env:
+ CC: clang-14
+ CXX: clang++-14
+
+ # unusedFunction - start
+ - name: CMake
+ run: |
+ 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: |
+ # make sure auto-generated GUI files exist
+ make -C cmake.output autogen
+ # make sure the precompiled headers exist
+ make -C cmake.output lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx
+ make -C cmake.output test/CMakeFiles/testrunner.dir/cmake_pch.hxx.cxx
+ # make sure the auto-generated GUI dependencies exist
+ make -C cmake.output gui-build-deps
+
+ - 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,information --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
+ env:
+ DISABLE_VALUEFLOW: 1
+ UNUSEDFUNCTION_ONLY: 1
+ # unusedFunction - end
+
+ # the following steps are duplicated from above since setting up the build node in a parallel step takes longer than the actual steps
+
+ # unusedFunction notest - start
+ - name: CMake (no test)
+ run: |
+ 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: |
+ # make sure auto-generated GUI files exist
+ make -C cmake.output.notest autogen
+ # make sure the precompiled headers exist
+ make -C cmake.output.notest lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx
+ # make sure the auto-generated GUI dependencies exist
+ make -C cmake.output.notest gui-build-deps
+
+ - 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,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
+ # unusedFunction notest - end
+
+ # unusedFunction notest nogui - start
+ - name: CMake (no test / no gui)
+ run: |
+ 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
+
+ - name: Self check (unusedFunction / no test / no gui)
+ run: |
+ 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
+ # unusedFunction notest nogui - end
+
+ # unusedFunction notest nocli - start
+ - name: CMake (no test / no cli)
+ run: |
+ 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: |
+ # make sure auto-generated GUI files exist
+ make -C cmake.output.notest_nocli autogen
+ # make sure the precompiled headers exist
+ make -C cmake.output.notest_nocli lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx
+ # make sure the auto-generated GUI dependencies exist
+ make -C cmake.output.notest_nocli gui-build-deps
+
+ - 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,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/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 -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: |
+ # make sure auto-generated GUI files exist
+ make -C cmake.output.corpus autogen
+ # make sure the precompiled headers exist
+ make -C cmake.output.corpus lib/CMakeFiles/lib_objs.dir/cmake_pch.hxx.cxx
+ # make sure the auto-generated GUI dependencies exist
+ make -C cmake.output.corpus gui-build-deps
+
+ - 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,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@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/valgrind.yml b/.github/workflows/valgrind.yml
new file mode 100644
index 00000000000..25ef4dd63a2
--- /dev/null
+++ b/.github/workflows/valgrind.yml
@@ -0,0 +1,71 @@
+# 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: valgrind
+
+on:
+ push:
+ branches:
+ - 'main'
+ - 'releases/**'
+ - '2.*'
+ tags:
+ - '2.*'
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-22.04
+
+ 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
+ run: |
+ sudo apt-get update
+ sudo apt-get install libxml2-utils
+ sudo apt-get install valgrind
+ sudo apt-get install libboost-container-dev
+ sudo apt-get install debuginfod
+
+ - name: Build cppcheck
+ run: |
+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
+ 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"
+ 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
+ # 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@v7
+ if: success() || failure()
+ with:
+ name: Logs
+ path: ./*.log
diff --git a/.gitignore b/.gitignore
index 6f31b8bfd63..a821204bf2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,56 +1,131 @@
-cppcheck
-cppcheck.exe
-testrunner
-testrunner.exe
-*.o
*.bak
*.gcno
-tools/dmake
-tools/extracttests
-dmake
+*.gch
+*.o
+*.a
+*.pyc
+/cppcheck
+/cppcheck.exe
+cppcheck-core.dll
+/dmake
+/dmake.exe
+reduce
+reduce.exe
+tags
+/testrunner
+/testrunner.exe
+tools/daca2*.html
tools/errmsg
+tools/extracttests
+.DS_Store
+
+# dump files generated by Cppcheck
+*.*.dump
+
+# CTU info files generated by Cppcheck
+*.*.ctu-info
+
# VS generated files
-*.obj
+*.aps
+*.idb
*.ncb
+*.obj
+*.opensdf
+*.orig
+*.pdb
+*.sdf
*.suo
*.user
-*.idb
-*.pdb
+/.vs/
+UpgradeLog*.htm
+
# VS build folders
+bin/
Build/
BuildTmp/
+/cli/temp/
+ipch/
+/lib/temp/
+/test/temp/
+
# XCode build folders and files
-build/
-*.pbxuser
*.mode[0-9]v[0-9]
-# GUI build folders
-gui/debug/
-gui/release/
-gui/temp/
+*.pbxuser
+build/
+
# Other (generated) GUI files
-gui/Makefile
-gui/Makefile.debug
-gui/Makefile.release
-gui/gui.sln
-gui/gui.vcproj
-gui/cppcheck-gui
-gui/qrc_gui.cpp
-gui/*.qm
+/gui/help/online-help.qch
+/gui/help/online-help.qhc
+
# Doxygen output folder
doxyoutput/
-# qmake generated
# Backup files and stuff from patches
-*.orig
*.rej
*~
# kdevelop 4.x
*.kdev4
-*.sdf
-ipch
-*.opensdf
-*.orig
+# Common cmake build directories
+build**/
-tags
+# Temporal files
+*.swp
+
+# Snapcraft build
+part
+prime
+parts
+stage
+*.snap
+/snap/.snapcraft
+
+# Manual folder
+/man/manual.log
+/man/manual.tex
+/man/*.pdf
+/man/*.html
+
+# CLion
+/.idea
+/.metadata/
+/cmake-build-*
+/.run
+
+# clang tooling temporary files
+/.clangd/
+/.cache/
+/compile_commands.json
+
+#vs code
+/.vscode
+
+# fuzzing output
+/oss-fuzz/corpus
+/oss-fuzz/corpus_
+/oss-fuzz/samples
+
+# Python
+/.venv/
+/venv/
+**/*.egg-info/
+
+# cppcheck-htmlreport auto files
+/htmlreport/cppcheck_htmlreport/run.py
+
+# GDB configuration
+.gdbinit
+
+# pyinstaller output
+/addons/dist
+/addons/misra.spec
+/htmlreport/cppcheck-htmlreport.spec
+/htmlreport/dist
+
+# ccache folder in CI
+/.ccache
+
+# PCRE Windows files
+/externals/pcre.h
+/externals/pcre64.lib
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 00000000000..6f42f4e47d5
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,49 @@
+Andreas Bießmann
+Andrew Martin acm4me
+Ankita Gupta Ankita-gupta
+Benjamin Goose
+Daniel Marjamäki
+Daniel Marjamäki
+Daniel Marjamäki Daniel Marjam�ki
+Daniel Marjamäki
+Daniel Marjamäki
+Deepak Gupta deepak gupta
+Ettl Martin Martin Ettl
+Ettl Martin
+Ettl Martin Martin Ettl
+Frank Zingsheim
+Gianluca Scacco
+Gianluca Scacco
+Henrik Nilsson
+Kimmo Varis Kimmo varis
+Kimmo Varis
+Kimmo Varis
+Kimmo Varis
+Kimmo Varis
+Kimmo Varis
+Kimmo Varis
+Leandro Penz Leandro Lisboa Penz
+Leandro Penz Leandro Lisboa Penz
+makulik unknown
+Nicolas Le Cam
+Pete Johns
+PKEuS Philipp K
+PKEuS Philipp Kloke
+PKEuS
+Reijo Tomperi
+Robert Reif
+Ryan Pavlik
+
+Sébastien Debrard seb777
+Sébastien Debrard S�bastien Debrard
+Sébastien Debrard Debrard Sébastien
+
+Stefan Weil
+Tim Gerundt
+Vesa Pikki
+XhmikosR
+Zachary Blair
+Zachary Blair
+Zachary Blair zblair
+
+
diff --git a/.pylintrc b/.pylintrc
new file mode 100644
index 00000000000..0ca3480c06f
--- /dev/null
+++ b/.pylintrc
@@ -0,0 +1,65 @@
+[MESSAGES CONTROL]
+disable=
+ # W start
+ redefined-builtin,
+ broad-exception-caught,
+ fixme,
+ bare-except,
+ redefined-outer-name,
+ attribute-defined-outside-init,
+ unspecified-encoding,
+ global-statement,
+ protected-access,
+ broad-exception-raised,
+ subprocess-popen-preexec-fn,
+ logging-not-lazy,
+ unknown-option-value,
+ unused-wildcard-import,
+ wildcard-import,
+ unused-argument,
+ pointless-string-statement,
+ arguments-renamed,
+ duplicate-string-formatting-argument,
+ # C start
+ consider-using-f-string,
+ invalid-name,
+ line-too-long,
+ missing-module-docstring,
+ missing-function-docstring,
+ import-outside-toplevel,
+ missing-class-docstring,
+ superfluous-parens,
+ too-many-lines,
+ trailing-newlines,
+ missing-final-newline,
+ use-implicit-booleaness-not-len,
+ wrong-import-order,
+ use-implicit-booleaness-not-comparison,
+ consider-using-enumerate,
+ unnecessary-lambda-assignment,
+ consider-using-dict-items,
+ consider-iterating-dictionary,
+ # R start
+ duplicate-code,
+ consider-using-with,
+ too-many-statements,
+ too-many-branches,
+ too-many-locals,
+ too-many-arguments,
+ too-few-public-methods,
+ too-many-return-statements,
+ consider-using-in,
+ too-many-nested-blocks,
+ too-many-public-methods,
+ chained-comparison,
+ too-many-instance-attributes,
+ too-many-boolean-expressions,
+ use-a-generator,
+ too-many-positional-arguments
+[REPORTS]
+reports=no
+[TYPECHECK]
+# See https://stackoverflow.com/questions/10300082/how-to-prevent-python-pylint-complaining-about-socket-class-sendall-method
+ignored-classes=SQLObject,_socketobject
+[MASTER]
+init-hook='import sys; sys.path.append("./addons")'
diff --git a/.selfcheck_suppressions b/.selfcheck_suppressions
new file mode 100644
index 00000000000..63d33fd2704
--- /dev/null
+++ b/.selfcheck_suppressions
@@ -0,0 +1,83 @@
+missingIncludeSystem
+# should not be reported - see #13387
+checkersReport
+
+# warnings in Qt generated code we cannot fix
+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
+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
+# 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
+noExplicitConstructor:externals/tinyxml2/tinyxml2.h
+missingOverride:externals/tinyxml2/tinyxml2.h
+invalidPrintfArgType_sint:externals/tinyxml2/tinyxml2.h
+naming-privateMemberVariable:externals/tinyxml2/tinyxml2.h
+functionStatic: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
new file mode 100644
index 00000000000..5da7c225dfa
--- /dev/null
+++ b/.selfcheck_unused_suppressions
@@ -0,0 +1,8 @@
+# should not be reported - see #13387
+checkersReport
+
+# we are not using all methods of their interfaces
+unusedFunction:externals/*/*
+
+# Q_OBJECT functions which are not called in our code
+unusedFunction:cmake.output.notest/gui/cppcheck-gui_autogen/*/moc_aboutdialog.cpp
diff --git a/.uncrustify.cfg b/.uncrustify.cfg
new file mode 100644
index 00000000000..81722ff7249
--- /dev/null
+++ b/.uncrustify.cfg
@@ -0,0 +1,170 @@
+# Uncrustify-0.80.1_f
+
+# The original size of tabs in the input.
+#
+# Default: 8
+input_tab_size = 4 # unsigned number
+
+# The size of tabs in the output (only used if align_with_tabs=true).
+#
+# Default: 8
+output_tab_size = 4 # unsigned number
+
+# Add or remove space between 'while' and '('.
+sp_while_paren_open = add # ignore/add/remove/force
+
+# Add or remove space around boolean operators '&&' and '||'.
+sp_bool = force # ignore/add/remove/force
+
+# Add or remove space inside '(' and ')'.
+sp_inside_paren = remove # ignore/add/remove/force
+
+# Add or remove space between nested parentheses, i.e. '((' vs. ') )'.
+sp_paren_paren = remove # ignore/add/remove/force
+
+# Add or remove space between ')' and '{'.
+sp_paren_brace = force # ignore/add/remove/force
+
+# Add or remove space between pointer stars '*'.
+sp_between_ptr_star = remove # ignore/add/remove/force
+
+# Add or remove space before '<'.
+sp_before_angle = remove # ignore/add/remove/force
+
+# Add or remove space inside '<' and '>'.
+sp_inside_angle = remove # ignore/add/remove/force
+
+# Add or remove space after '>'.
+sp_after_angle = add # ignore/add/remove/force
+
+# Add or remove space between '>' and '(' as found in 'new List(foo);'.
+sp_angle_paren = remove # ignore/add/remove/force
+
+# Add or remove space between '>' and a word as in 'List m;' or
+# 'template static ...'.
+sp_angle_word = add # ignore/add/remove/force
+
+# Add or remove space between '>' and '>' in '>>' (template stuff).
+#
+# Default: add
+sp_angle_shift = ignore # ignore/add/remove/force
+
+# (C++11) Permit removal of the space between '>>' in 'foo >'. Note
+# that sp_angle_shift cannot remove the space without this option.
+sp_permit_cpp11_shift = true # true/false
+
+# Add or remove space before '(' of control statements ('if', 'for', 'switch',
+# 'while', etc.).
+sp_before_sparen = force # ignore/add/remove/force
+
+# Add or remove space inside '(' and ')' of control statements.
+sp_inside_sparen = remove # ignore/add/remove/force
+
+# Add or remove space after ')' of control statements.
+sp_after_sparen = force # ignore/add/remove/force
+
+# Add or remove space between ')' and '{' of of control statements.
+sp_sparen_brace = force # ignore/add/remove/force
+
+# Add or remove space before ';' in non-empty 'for' statements.
+sp_before_semi_for = remove # ignore/add/remove/force
+
+# Add or remove space after the final semicolon of an empty part of a for
+# statement, as in 'for ( ; ; )'.
+sp_after_semi_for_empty = remove # ignore/add/remove/force
+
+# Add or remove space before '[]'.
+sp_before_squares = remove # ignore/add/remove/force
+
+# Add or remove space before C++17 structured bindings.
+sp_cpp_before_struct_binding = ignore # ignore/add/remove/force
+
+# Add or remove space inside a non-empty '[' and ']'.
+sp_inside_square = remove # ignore/add/remove/force
+
+# Add or remove space after class ':'.
+sp_after_class_colon = force # ignore/add/remove/force
+
+# Add or remove space before class ':'.
+sp_before_class_colon = force # ignore/add/remove/force
+
+# Add or remove space inside '{}'.
+sp_inside_braces_empty = remove # ignore/add/remove/force
+
+# Add or remove space between 'else' and '{' if on the same line.
+sp_else_brace = force # ignore/add/remove/force
+
+# Add or remove space between '}' and 'else' if on the same line.
+sp_brace_else = force # ignore/add/remove/force
+
+# Add or remove space before the '{' of a 'catch' statement, if the '{' and
+# 'catch' are on the same line, as in 'catch (decl) {'.
+sp_catch_brace = force # ignore/add/remove/force
+
+# Add or remove space between '}' and 'catch' if on the same line.
+sp_brace_catch = force # ignore/add/remove/force
+
+# The number of columns to indent per level. Usually 2, 3, 4, or 8.
+#
+# Default: 8
+indent_columns = 4 # unsigned number
+
+# How to use tabs when indenting code.
+#
+# 0: Spaces only
+# 1: Indent with tabs to brace level, align with spaces (default)
+# 2: Indent and align with tabs, using spaces when not on a tabstop
+#
+# Default: 1
+indent_with_tabs = 0 # unsigned number
+
+# Whether to indent the body of a 'namespace'.
+indent_namespace = true # true/false
+
+# Whether the 'class' body is indented.
+indent_class = true # true/false
+
+# How to indent access specifiers that are followed by a
+# colon.
+#
+# >0: Absolute column where 1 is the leftmost column
+# <=0: Subtract from brace indent
+#
+# Default: 1
+indent_access_spec = -4 # number
+
+# Whether to collapse empty blocks between '{' and '}' except for functions.
+# Use nl_collapse_empty_body_functions to specify how empty function braces
+# should be formatted.
+nl_collapse_empty_body = true # true/false
+
+# Whether to collapse empty blocks between '{' and '}' for functions only.
+# If true, overrides nl_inside_empty_func.
+nl_collapse_empty_body_functions = true # true/false
+
+# Whether to convert all tabs to spaces in comments. If false, tabs in
+# comments are left alone, unless used for indenting.
+cmt_convert_tab_to_spaces = true # true/false
+
+# An offset value that controls the indentation of the body of a multiline #define.
+# 'body' refers to all the lines of a multiline #define except the first line.
+# Requires 'pp_ignore_define_body = false'.
+#
+# <0: Absolute column: the body indentation starts off at the specified column
+# (ex. -3 ==> the body is indented starting from column 3)
+# >=0: Relative to the column of the '#' of '#define'
+# (ex. 3 ==> the body is indented starting 3 columns at the right of '#')
+#
+# Default: 8
+pp_multiline_define_body_indent = 4 # number
+
+# The value might be used twice:
+# - at the assignment
+# - at the opening brace
+#
+# To prevent the double use of the indentation value, use this option with the
+# value 'true'.
+#
+# true: indentation will be used only once
+# false: indentation will be used every time (default)
+indent_cpp_lambda_only_once = true # true/false
diff --git a/AUTHORS b/AUTHORS
index 4e89e26a812..e804ab53e16 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,22 +1,461 @@
The cppcheck team, in alphabetical order:
+0x41head
+Aaron Danen
+Abhijit Sawant
+Abhishek Bharadwaj
+Abigail Buccaneer
+Adam J Richter
+Adrien Chardon
+Ahti Legonkov
+Akhilesh Nema
+Akio Idehara
+Albert Aribaud
+Aleksandr Pikalev
+Aleksey Palazhchenko
+Alexander Alekseev
+Alexander Festini
+Alexander Gushchin
+Alexander Mai
+Alexander Tkachev
+Alexandre Chouvellon
+Alexey Eryomenko
+Alexey Zhikhartsev
+Alfi Maulana
+Ali Can Demiralp
+Alvin Che-Chia Chang
+Allen Winter
+Alon Alexander
+Alon Liberman
+Ameen Ali
+Andreas Bacher
+Andreas Bießmann
+Andreas Grob
+Andreas Lutsch
+Andreas Pokorny
+Andreas Rönnquist
+Andreas Vollenweider
+Andreas Wilhelm
+Andrei Karas
+Andrew C Aitchison
+Andrew C. Martin
+Andrew D. Bancroft
+Andy Holmes
+Andy Maloney
+Andy Mac Gregor
+Aneesh Azhakesan S
+Ankita Gupta
+anoymouserver
+Anton Lindqvist
+Antti Tuppurainen
+Anurag Garg
+Armin Müller
+Arpit Chaudhary
+Artemis Meursault Gerrard
+August Sodora
+Ayaz Salikhov
+Balázs Tóth
+Baris Demiray
+Bart vdr. Meulen
+Bartlomiej Grzeskowiak
+bbennetts
+Benjamin Bannier
+Benjamin Fovet
+Benjamin Goose
+Benjamin Kramer
+Benjamin Woester
+Benjamin Wolsey
+Ben T
+Bernd Buschinski
Bill Egert
+Björge Dijkstra
+Björn Blissing
+booga
+Boris Barbulovski
+Boris Egorov
+Boussaffa Walid
+Bo Rydberg
+bzgec
+Carl Michael Grüner Monzón
+Carl Morgan
+Carlo Marcelo Arenas Belón
+Carlos Gomes Martinho
+Carl-Oskar Larsson
+Cary Converse
+Cary R
+Caspar Kielwein
+Changkyoon Kim
+Chris Lalancette
+Christian Ehrlicher
+Christian Franke
+Christian Göttsche
+Christoph Grüninger
+Christoph Schmidt
+Christoph Strehle
+Chuck Larson
+Cilyan Olowen
+Claus Jensby Madsen
+Colomban Wendling
+Conrado Gouvea
+daisuke-chiba
+Daniel Friedrich
+David Korczynski
Daniel Marjamäki
+Daschle Newberry
+David Hallas
+David Korth
+Dávid Slivka
+Debrard Sebastien
+Deepak Gupta
+Degen's Regens
+dencat
+Devansh Varshney
+Diego de las Heras
+Dirk Jagdmann
+Dirk Mueller
+Dmitriy
+Dmitry Marakasov
+Dmitry-Me
+dsamo
+Duraffort
+Edoardo Prezioso
+Eivind Tagseth
+Elbert Pol
+Emmanuel Blot
+Eric Lemanissier
+Eric Malenfant
+Eric Sesterhenn
+Erik Hovland
+Erik Lax
+Ettl Martin
+Even Rouault
+Evgeny Mandrikov
+feelamee
+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
+gaurav kaushik
+Gennady Feldman
+Georgi D. Sotirov
+Georgy Komarov
+Gerbo Engels
+Gerhard Zlabinger
+Gerik Rhoden
+Gianfranco Costamagna
Gianluca Scacco
+Gilmar Santos Jr
+Gleydson Soares
+Goncalo Mao-Cheia
+Goran Džaferi
+Graham Whitted
Greg Hewgill
+Guillaume A.
+Guillaume Chauvel
+Guillaume Miossec
+Gustav Palmqvist
+Günther Makulik
+Haowei Hsu
+Harald Scheidl
+Heiko Bauke
+Heiko Eißfeldt
+Heinrich Schuchardt
+Henrik Nilsson
+He Yuqi
Hoang Tuan Su
+Igor Rondarev
+Igor Zhukov
+Ilya Shipitsin
+Ivan Maidanski
+Iván Matellanes
+Ivan Ryabov
+Ivar Bonsaksen
+Jakub Melka
+Jan Egil Ruud
+Jan Hellwig
+János Maros
+Jay Sigbrandt
+Jedrzej Klocek
+Jens Bäckman
+Jens Yllman
+Jérémy Lefaure
+Jes Ramsing
+Jesse Boswell
+Jim Kuhn
+Jim Zhou
+jlguardi
+Joel Johnson
+Johan Bertrand
+Johan Crone
+Johan Samuelson
+John Marshall
+John-Paul Ore
+John Smits
+Jonathan Clohessy
+Jonathan Haehne
+Jonathan Neuschäfer
+Jonathan Thackray
+Jonny Paton
+José Martins
+Jose Roquette
+Joshua Beck
+Joshua Rogers
+Julian Santander
+Julien Marrec
+Julien Peyregne
+Jure Menart
+Jussi Lehtola
+Jørgen Kvalsvik
+Kamil Dudka
+Kartik Bajaj
+Kefu Chai
+keinflue
+Ken-Patrick Lehrmann
+Ketil Skjerve
+Kevin Christian
+Kevin Kendzia
Kimmo Varis
-Leandro Penz
+Kitsios Konstantinos
+Kleber Tarcísio
+Konrad Grochowski
+Konrad Windszus
+Kumar Ashwani
+Kushal Chandar
+Kyle Chisholm
+Lars Even Almaas
+larudwer
+Lau bakman
+Lauri Nurmi
+Leander Schulten
+Leandro Lisboa Penz
+Leila F. Rahman
+Lena Herscheid
+Leon De Andrade
+Lieven de Cock
+lioncash
+Lionel Gimbert
+Lucas Manuel Rodriguez
+Ludvig Gunne Lindström
+Luis Díaz Más
+Luís Pereira
+Lukas Grützmacher
+Lukas Hiesmayr
+Lukasz Czajczyk
+Łukasz Jankowski
+Luxon Jean-Pierre
+Maarten van der Schrieck
+Maksim Derbasov
+Malcolm Parsons
+Marc-Antoine Perennou
+Marcel Petrick
+Marcel Raad
+Marco Trevisan
+Marek Zmysłowski
+Marian Klymov
+Mark de Wever
+Mark Hermeling
+Markus Elfring
+Martin Delille
Martin Ettl
+Martin Exner
+Martin Güthle
+Martin Herren
+Márton Csordás
+Masafumi Koba
+Massimo Paladin
+Mateusz Michalak
+Mateusz Patyk
+Mateusz Pusz
+Mathias De Maré
+Mathias Schmid
+Matthias Krüger
+Matthias Kuhn
+Matthias Schmieder
+Matt Johnson
+Maurice Gilden
+Mavik
+Melroy van den Berg
+Michael Drake
+Michael Løiten
+Miika-Petteri Matikainen
+Mika Attila
+Mike Tzou
+Milhan Kim
+Mil Tolstoy
+Mischa Aster Alff
+Mohit Mate
+Monika Lukow
+Moritz Barsnick
+Moritz Lipp
+Moshe Kaplan
+ms
+Neszt Tibor
Nguyen Duong Tuan
+Ni2c2k
+Nick Ridgway
+Nicolás Alvarez
Nicolas Le Cam
+Nilesh Kumar
+Ogawa KenIchi
+Ola Söder
+Oleksandr Labetskyi
+Oleksandr Redko
+Oliver Schode
+Oliver Stöneberg
+Olivier Croquette
+Patrick Oppenlander
+Paul Aitken
+Paul Bersee
+Paul Fultz II
+Pavel Bibergal
+Pavel Pimenov
+Pavel Roschin
+Pavel Skipenes
+Pavel Šimovec
+Pavol Misik
+Pete Johns
+Peter Pentchev
+Peter Schops
+Philip Chimento
+Philipp Kloke
+Pierre Schweitzer
+Pieter Duchi
+Piotr Idzik
+Pino Toscano
+Pranav Khanna
+Radek Jarecki
+Rainer Wiesenfarth
+Ramzan Bekbulatov
+Raphael Geissert
+Razvan Ioan Alexe
Reijo Tomperi
+Reshma V Kumar
+Rainer Wiesenfarth
+Riccardo Ghetta
+Richard A. Smith
+Richard Quirk
+Rick van der Sluijs
+Rikard Falkeborn
+rivdsl
+Robert Habrich
+Robert Morin
+Roberto Martelloni
Robert Reif
+Robin Getz
+rofl0r
+Roman Zaytsev Borisovich
+Ronald Hiemstra
+root
+Rosen Penev
+Rudi Danner
+Rudolf Grauberger
+Ryan M. Lederman
+Ryan Pavlik
+Samir Aguiar
+Sam Truscott
+Samuel Degrande
+Samuel Poláček
+Sandeep Dutta
+Savvas Etairidis
+Sayed Kaif
+Scott Ehlert
+Scott Furry
+Seafarix Ltd.
+Sebastian Held
+Sebastian Matuschka
Sébastien Debrard
+Sergei Chernykh
+Sergei Trofimovich
+Sergey Burgsdorf
+Shane Tapp
+Shohei YOSHIDA
+Simon Cornell
+Simon Kagstrom
+Simon Large
+Simon Martin
+Simon Shanks
Slava Semushin
-vBm
+Stas Cymbalov
+Stefan Beller
+Stefan Hagen
+Stefan Naewe
+Stefan van Kessel
+Stefan Weil
+Stéphane Michel
+Steve Browne
+Steve Duan
+Steve Mokris
+Steven Cook
+Steven Myint
+Sune Stolborg Vuorela
+Susi Lehtola
+Sven Wienand
+Swasti Shrivastava
+Sylvain Joubert
+Tam Do Thanh
+Teddy Didé
+Temuri Doghonadze
+Thomas Arnhold
+Tomasz Edward Posluszny
+Thomas Jarosch
+Thomas Niederberger
+Thomas Otto
+Thomas P. K. Healy
+Thomas Sondergaard
+Thorsten Sick
+Tim Blume
+Tim Gerundt
+tititiou36
+Tobias Weber
+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
+Veli-Matti Visuri
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
+Xuecheng Zhang
+Yichen Yan
+Yurii Putin
Zachary Blair
+Zhao Qifa
+Zhiyuan Zhang
+Zhu Lei
+Дмитрий Старцев
GUI graphics courtesy of Tango Desktop Project:
http://tango.freedesktop.org
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000000..b5857a8413a
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,119 @@
+cmake_minimum_required(VERSION 3.22)
+project(Cppcheck VERSION 2.21.99 LANGUAGES CXX)
+
+include(cmake/options.cmake)
+
+include(cmake/cxx11.cmake)
+use_cxx11()
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+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)
+ include(cmake/qtCompat.cmake)
+endif()
+include(cmake/printInfo.cmake)
+
+
+file(GLOB addons_py "addons/*.py")
+file(GLOB addons_json "addons/*.json")
+file(GLOB cfgs "cfg/*.cfg")
+file(GLOB platforms "platforms/*.xml")
+
+if(LIBXML2_XMLLINT_EXECUTABLE)
+ add_custom_target(validateCFG DEPENDS validateCFG-cmd)
+ add_custom_command(OUTPUT validateCFG-cmd
+ COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng)
+ foreach(cfg ${cfgs})
+ add_custom_command(OUTPUT validateCFG-cmd APPEND
+ COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng ${cfg})
+ endforeach()
+ # this is a symbolic name for a build rule and not an output file
+ set_source_files_properties(validateCFG-cmd PROPERTIES SYMBOLIC "true")
+
+ add_custom_target(validatePlatforms ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/platforms/cppcheck-platforms.rng)
+ foreach(platform ${platforms})
+ get_filename_component(platformname ${platform} NAME_WE)
+ add_custom_target(validatePlatforms-${platformname} ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/platforms/cppcheck-platforms.rng ${platform})
+ add_dependencies(validatePlatforms validatePlatforms-${platformname})
+ endforeach()
+
+ 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)
+ endif()
+
+ add_custom_target(createXMLExamples DEPENDS errorlist-xml example-xml)
+
+ if(Python_EXECUTABLE)
+ add_custom_target(checkCWEEntries ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/listErrorsWithoutCWE.py -F ${CMAKE_BINARY_DIR}/errorlist.xml
+ DEPENDS errorlist-xml)
+ endif()
+
+ add_custom_target(validateXML ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng
+ COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng ${CMAKE_BINARY_DIR}/errorlist.xml
+ COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng ${CMAKE_BINARY_DIR}/example.xml
+ DEPENDS createXMLExamples
+ )
+
+ add_custom_target(validateRules ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/rules/*.xml)
+endif()
+
+# TODO: add the following Makefile features:
+# - "man/cppcheck.1" target
+# - "tags" target
+# - Cygwin handling
+# - MinGW handling
+
+add_custom_target(copy_cfg ALL
+ ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/cfg"
+ "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/cfg"
+ COMMENT "Copying cfg files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
+
+# TODO: copy *.py and *.json only
+add_custom_target(copy_addons ALL
+ ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/addons"
+ "${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)
+ message(STATUS "Using bundled version of 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
+add_subdirectory(tools)
+add_subdirectory(man)
+
+include(cmake/clang_tidy.cmake)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000000..09e88f021e2
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,67 @@
+# Contributing To Cppcheck
+
+These are some guidelines *any* contributor should follow. They will help to make for better contributions which will most likely allow for them to be processed.
+
+(TODO: move daca@home section here?)
+
+## Code Changes
+
+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.
+
+Any kind of contribution is welcome but we might reject it. In that case we usually provide an explanation for the reasons but everything is always open to discussion.
+
+Changes in the `externals` folder need to be submitted to the respective upstream projects and will be pulled downstream with their next stable release (`picojson` is an exception because it is no longer maintained - the handling of such changes is not yet determined - see also https://trac.cppcheck.net/ticket/12233).
+
+Also after you filed a pull request please be ready to reply to questions and feedback. If you just "dump and leave" it might lower the chances of your change being accepted. This also applies after the PR was successfully merged as it might cause issues which were not exposed by the CI.
+
+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/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`.
+
+The CI is already doing a lot of work but there are certain parts it cannot ensure.
+
+(TODO: mention test_pr.py)
+
+The CI has an "always green" approach which means that failing tests are not allowed. Flakey tests might be acceptable depending on the frequency of their failures but they should be accompanied by ticket so they are being tracked. If introduce a test which is expected to fail you should use the `TODO_*` macros (C++) or `@pytest.mark.xfail(strict=False)` annotations.
+
+Note: Usually you can run the CI on your own fork to verify that it passes before even open an PR. Unfortunately some changes to avoid duplicated builds in our CI disabled this (TODO: file a ticket about this).
+
+### Targets
+
+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.
+
+[Detection Regressions](https://trac.cppcheck.net/query?status=accepted&status=assigned&status=new&status=reopened&keywords=~regression&component=Improve+check&col=id&col=summary&col=status&col=type&col=priority&col=milestone&col=component&order=priority)
+
+Changes might lead to fewer findings being reported. In very few cases this might be intentional but we should not regress in what findings are being reported.
+
+[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`.
+
+Several of these are not complete or might be out-of-date so contributions are welcome. We will also accept additional languages but such contributions should be complete.
+
+(TODO: provide more details)
diff --git a/Changelog b/Changelog
deleted file mode 100644
index 08d012fab6f..00000000000
--- a/Changelog
+++ /dev/null
@@ -1,35248 +0,0 @@
-2011-10-08 Daniel Marjamäki
-
- * cli/cppcheck.rc, cli/main.cpp, lib/cppcheck.cpp,
- win_installer/productInfo.wxi: 1.51: Updated versions
-
-2011-10-08 Daniel Marjamäki
-
- * lib/checknullpointer.cpp: Added todo comments to fix false
- negatives caused by my fix for #3128
-
-2011-10-07 Daniel Marjamäki
-
- * lib/checknullpointer.cpp, test/testnullpointer.cpp: Fixed #3128
- (False positive: null pointer dereference check does not handle
- complex boolean logic properly)
-
-2011-10-07 Daniel Marjamäki
-
- * man/manual.docbook: Fixed #3115 (note windows limitation to
- threading in the manual)
-
-2011-10-07 Kimmo Varis
-
- * gui/cppcheck_de.ts, gui/cppcheck_en.ts, gui/cppcheck_es.ts,
- gui/cppcheck_fi.ts, gui/cppcheck_fr.ts, gui/cppcheck_ja.ts,
- gui/cppcheck_nl.ts, gui/cppcheck_pl.ts, gui/cppcheck_ru.ts,
- gui/cppcheck_sr.ts, gui/cppcheck_sv.ts: GUI: Update translation
- files.
-
-2011-10-07 Robert Reif
-
- * lib/symboldatabase.cpp, lib/tokenize.cpp: fix tokenizer and symbol
- database to not mistake goto statement for variable declaration
-
-2011-10-06 Robert Reif
-
- * lib/tokenize.h: run astyle
-
-2011-10-07 Edoardo Prezioso
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed ticket #3176
- (cppcheck reports wrong unused variable) Label simplification didn't
- take count of the '(' parenthesis or the '&' and '*' operators
- inside or outside the parenthesis after the colon.
-
-2011-10-06 Edoardo Prezioso
-
- * lib/tokenize.cpp, lib/tokenize.h, test/testtokenize.cpp: Renamed
- the function 'removeRedundantCodeAfterReturn' with
- 'simplifyDeadCode'. This is a preparation in order to add new
- features to this function (see the @todo in the tokenize header
- file, ticket #3113 and #3175 for details).
-
-2011-10-06 Daniel Marjamäki
-
- * lib/checkother.cpp, lib/checkother.h, test/testother.cpp: Readded
- CheckOther::bitwiseOnBoolean as inconclusive check
-
-2011-10-06 Marek Zmysłowski
-
- * cli/cmdlineparser.cpp, lib/checkobsoletefunctions.cpp,
- lib/checkobsoletefunctions.h, lib/settings.h,
- test/testcmdlineparser.cpp, test/testobsoletefunctions.cpp: Fixed
- #3072 (improve check: deprecated function alloca)
-
-2011-10-05 Daniel Marjamäki
-
- * lib/checkother.cpp, lib/checkother.h, test/testother.cpp: Removed
- CheckOther::bitwiseOnBoolean check. The reasons can be seen in my
- comments in ticket #3062.
-
-2011-10-05 PKEuS
-
- * lib/checkother.cpp, lib/checkother.h, test/testother.cpp: Fixed
- #1877 (Be more strict about int vs. bool, part II)
-
-2011-10-05 Thomas Jarosch
-
- * lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h,
- test/testbufferoverrun.cpp: Fixed #3161 (Show buffers size info for
- snprintf() buffer overruns)
-
-2011-10-05 Edoardo Prezioso
-
- * : commit 3cfe7ca1a7176690174ed6fccb0d929d68eceef1 Author: Kimmo
- Varis Date: Wed Oct 5 20:44:00 2011 +0300
-
-2011-10-05 Edoardo Prezioso
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed ticket #3148
- (Analysis failed on "Modules/mathmodule.c") Fix: Do not handle code
- when 'return' is inside a macro. This is valid also for 'switch'
- code inside a macro.
-
-2011-10-05 Kimmo Varis
-
- * gui/platforms.cpp: GUI: Rename default platform to "Build-in". "default" as platform name/definition doesn't tell much and would
- only confuse users. "Build-in" is not perfect either but it is best
- I've can come with before the release. Ticket: #3156 (GUI: "default" platform needs proper name)
-
-2011-10-05 Kimmo Varis
-
- * gui/mainwindow.cpp: GUI: Fix enabling/disabling visibilities of
- errors When GUI was started not all the categories visibility statuses were
- not preserved. I.e. Ticket: #3087 (GUI does not show all reported files until a filter
- button state is changed)
-
-2011-10-04 Reijo Tomperi
-
- * man/cppcheck.1.xml: Update man page
-
-2011-10-04 Edoardo Prezioso
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #3146 "Analysis
- failed" error on softmagic.c: -Fixed: the code didn't check the
- rightness of the switch syntax if it was inside another switch;
- -Tweaked: removed the two bool variables, so now the conditions take
- count of indentation unsigned variables.
-
-2011-10-03 Edoardo Prezioso
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #3132 (Analysis
- failed. If the code is valid then please report this failure.)
-
-2011-10-03 Kimmo Varis
-
- * gui/platforms.cpp: GUI: Fix endless loop in previous commit. The iterator was not advanced in the loop. So the code worked when I
- ran it in Linux as the first item was matching. Thanks for Robert for spotting and reporting it.
-
-2011-10-02 Kimmo Varis
-
- * gui/mainwindow.cpp: GUI: In Windows platforms default to Win32
- ANSI. When running in Windows platforms, set the GUI's checked platform
- initially to Windows 32-bit ANSI. Other platforms are set initially
- to default/unspecified which means the type sizes are from the
- platform GUI was compiled on. This was suggested by Rober in ticket #3119.
-
-2011-10-02 Kimmo Varis
-
- * gui/gui.pro, gui/main.ui, gui/mainwindow.cpp, gui/mainwindow.h,
- gui/platforms.cpp, gui/platforms.h: GUI: Make platforms in GUI more
- dynamic. We have now one list for checked platforms, menu items are created
- dynamically based on that list. This makes it much easier to alter
- the platforms list later on.
-
-2011-10-02 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Fixed #3159
- (Uninitialized variable false positive)
-
-2011-10-02 Daniel Marjamäki
-
- * lib/checknullpointer.cpp, test/testnullpointer.cpp: Fixed #3125
- (FP: Possible null pointer dereference in conditional operator)
-
-2011-10-02 Daniel Marjamäki
-
- * lib/checknullpointer.cpp, test/testnullpointer.cpp: Fixed #3126
- (false positive: Null pointer dereference)
-
-2011-10-02 Kimmo Varis
-
- * cli/cppcheckexecutor.cpp: CLI: case-insensitive ignorepath
- matching in Windows.
-
-2011-10-02 Kimmo Varis
-
- * cli/pathmatch.cpp, cli/pathmatch.h, test/testpathmatch.cpp: CLI:
- Add support for ignoring case in PathMatch. In Windows (or in Windows code?) we want to ignore case in the
- paths. This patch implements the case ignore for the PathMatch-
- class.
-
-2011-10-01 Stefan Weil
-
- * htdocs/site/simplepie/simplepie.inc: htdocs: fix typo in error
- messages and php code (writeable -> writable)
-
-2011-09-30 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: fix #3153
- (false positive buffer access out-of-bounds)
-
-2011-09-30 Robert Reif
-
- * lib/checkclass.cpp, test/testclass.cpp: another variation of false
- negative from #3149
-
-2011-09-30 Stefan Weil
-
- * lib/settings.cpp: test _WIN64 before _WIN32 (64-bit compiler
- defines both macros)
-
-2011-09-30 Robert Reif
-
- * lib/checkclass.cpp, test/testclass.cpp: really fix #3149 (false
- negative: Technically the member function 'A::f' can be const.)
-
-2011-09-30 Kimmo Varis
-
- * test/testcmdlineparser.cpp: Disable fileListStdin test from
- testcmdlineparser. That test hangs the test run.
-
-2011-09-29 Robert Reif
-
- * lib/checkclass.cpp, test/testclass.cpp: fix #3149 (false negative:
- Technically the member function 'A::f' can be const.)
-
-2011-09-29 Robert Reif
-
- * lib/tokenize.cpp, test/testsimplifytokens.cpp: fix #3151 (missing
- portability warning for extra qualifier on destructor)
-
-2011-09-29 Robert Reif
-
- * test/testcmdlineparser.cpp: run astyle
-
-2011-09-29 Kimmo Varis
-
- * gui/common.h, gui/main.ui, gui/mainwindow.cpp, gui/mainwindow.h:
- GUI: Add menu-selection for the checked platform. This is quick and dirty patch to add the platform selection for the
- GUI. It is simple menu selection in Check-menu. It always defaults
- to "Default" at startup. And it forget the selection when the
- application is closed. Ticket: #3119 (GUI: add ability to specify platform type)
-
-2011-09-29 Kimmo Varis
-
- * : Merge pull request #37 from joshbeck/master Added support for reading file lists from stdin, correctly this time
-
-2011-09-28 Reijo Tomperi
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Fix #2813 (False
- negative: Uninitialized variable not found for realloc)
- http://sourceforge.net/apps/trac/cppcheck/ticket/2813 Patch provided
- by: marekzmyslowski
-
-2011-09-28 Robert Reif
-
- * lib/tokenize.cpp, lib/tokenize.h: refactor last commit to move
- unknown type output to seperate function
-
-2011-09-27 Robert Reif
-
- * lib/tokenize.cpp: show unknown variable types when debug-messages
- flag is set
-
-2011-09-27 Robert Reif
-
- * lib/checkclass.cpp, lib/checkclass.h, test/testclass.cpp: fix
- #3008 (New check: Order of initialisation list)
-
-2011-09-27 Joshua Beck
-
- * : Merge remote-tracking branch 'upstream/master'
-
-2011-09-27 Joshua Beck
-
- * cli/cmdlineparser.cpp, test/testcmdlineparser.cpp: Fix test and
- add info to -h output.
-
-2011-09-26 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: add support for Microsoft
- TCHAR character constants
-
-2011-09-26 Joshua Beck
-
- * man/cppcheck.1.xml, test/testcmdlineparser.cpp: Updated manual and
- added test for reading file list from stdin.
-
-2011-09-26 Robert Reif
-
- * lib/checkother.cpp, test/testother.cpp: reduce false negatives for
- checking for CheckOther::checkSignOfUnsignedVariable()
-
-2011-09-26 Joshua Beck
-
- * cli/cmdlineparser.cpp: Added support for reading file lists from
- stdin
-
-2011-09-26 Kimmo Varis
-
- * cppcheck.sln, cppcheck_vs2010.sln: Update VS solution files for
- test project name change.
-
-2011-09-26 Kimmo Varis
-
- * gui/cppcheck_de.ts, gui/cppcheck_en.ts, gui/cppcheck_es.ts,
- gui/cppcheck_fi.ts, gui/cppcheck_fr.ts, gui/cppcheck_ja.ts,
- gui/cppcheck_nl.ts, gui/cppcheck_pl.ts, gui/cppcheck_ru.ts,
- gui/cppcheck_sr.ts, gui/cppcheck_sv.ts: GUI: Update translation
- files.
-
-2011-09-26 Kimmo Varis
-
- * gui/statsdialog.cpp: GUI: Make statistics dialog text
- translatable. Refactor the code formatting statistics dialog content so that the
- strings are easier to translate. Old formatting with embedded HTML
- was practically impossible for translators to translate. New code
- isn't very beautiful either but at least translating is now
- possible. Ticket: #2726 (GUI: HTML-formatted statistics report text hard to
- translate)
-
-2011-09-25 Kimmo Varis
-
- * gui/project.cpp, gui/projectfile.ui, gui/projectfiledialog.cpp,
- gui/projectfiledialog.h: GUI: Rename functions related to excluding.
-
-2011-09-25 Kimmo Varis
-
- * gui/test/projectfile/testprojectfile.cpp: GUITESTS: Rename
- variable for consistency.
-
-2011-09-25 Kimmo Varis
-
- * gui/test/data/benchmark/simple.cpp: GUITESTS: Remove include lines
- from test data. The included files aren't found anyway so the lines are useless and
- can add more variance (filesystem access) to the results.
-
-2011-09-25 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: add some Windows TCHAR
- scanf and printf conversions
-
-2011-09-24 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: start adding Windows wide
- character support
-
-2011-09-24 Robert Reif
-
- * cli/cmdlineparser.cpp, lib/settings.cpp, lib/settings.h,
- lib/tokenize.cpp, lib/tokenize.h, test/testsimplifytokens.cpp,
- test/testtokenize.cpp: start adding Windows ASCII TCHAR conversion
- support
-
-2011-09-24 seb777
-
- * lib/checkobsoletefunctions.cpp, test/testobsoletefunctions.cpp:
- fix #3121 ([False Positive] Incorrect obsoleted functions)
-
-2011-09-23 Robert Reif
-
- * lib/tokenize.cpp, test/testsimplifytokens.cpp: add operator
- support to ertra qualification check
-
-2011-09-22 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: fix for
- loop false positives when zero length arrays present
-
-2011-09-22 Robert Reif
-
- * lib/tokenize.cpp, lib/tokenize.h, test/testsimplifytokens.cpp,
- test/testtokenize.cpp: add Microsoft memory function conversions to
- standard cstring functions
-
-2011-09-21 Robert Reif
-
- * lib/checkunusedfunctions.cpp, test/testunusedfunctions.cpp: fix
- #3127 ([False positive] _tmain function i VS 2010 project)
-
-2011-09-21 Robert Reif
-
- * test/testuninitvar.cpp: fix typo in last commit
-
-2011-09-21 Robert Reif
-
- * test/testuninitvar.cpp: add test case for false negatives
- introduced by fix for 3106
-
-2011-09-20 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: add some more windows
- type conversions
-
-2011-09-20 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Fixed #3106 (False
- positive: Uninitialized variable check has inconsistent behavior
- with ternary operator)
-
-2011-09-20 Johan Samuelson
-
- * lib/token.cpp: Fixed #3118 (Tokenizer: str*cmp() in hot spot code)
-
-2011-09-20 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: only simplify Microsoft
- MFC code when Windows platform is selected
-
-2011-09-19 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: add some common windows
- pointer type conversions to standard types
-
-2011-09-19 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: fix #3124
- (FP: Buffer access out-of-bounds when memset two dimension array
- (a[5][6]))
-
-2011-09-19 Robert Reif
-
- * cli/cmdlineparser.cpp: fix width of platform help text
-
-2011-09-18 Robert Reif
-
- * lib/settings.cpp: set windows platform type to type executable was
- compiled on
-
-2011-09-18 Robert Reif
-
- * lib/settings.cpp, lib/settings.h, lib/tokenize.cpp,
- test/testtokenize.cpp: start adding conversions from common Windows
- types to standard types
-
-2011-09-18 Robert Reif
-
- * lib/checkunusedfunctions.cpp: run astyle
-
-2011-09-18 Daniel Marjamäki
-
- * : Merge pull request #35 from simartin/ticket_3059 Ticket 3059: Report the correct line number in unused functions
- warnings
-
-2011-09-18 Robert Reif
-
- * lib/settings.cpp, test/testtokenize.cpp: fix sizeof long double
- for unix64 for #2888 (Allow defining sizes of base types)
-
-2011-09-18 Kimmo Varis
-
- * gui/test/benchmark/simple/benchmarksimple.cpp,
- gui/test/benchmark/simple/benchmarksimple.h: GUITESTS: Add benchmark
- for tokenize + simplify.
-
-2011-09-18 Simon Martin
-
- * lib/checkunusedfunctions.cpp, lib/checkunusedfunctions.h,
- test/testunusedfunctions.cpp: Ticket 3059: Report the correct line
- number in unused functions warnings
-
-2011-09-17 Robert Reif
-
- * cli/cmdlineparser.cpp, lib/settings.cpp, lib/settings.h,
- lib/tokenize.cpp, test/testtokenize.cpp: fix #2888 (Allow defining
- sizes of base types)
-
-2011-09-17 Kimmo Varis
-
- * : Merge pull request #34 from simartin/clang_build Make the build warning clean with clang++
-
-2011-09-17 Simon Martin
-
- * test/testcmdlineparser.cpp: Make the build warning clean with
- clang++
-
-2011-09-16 Robert Reif
-
- * lib/checkclass.cpp, test/testclass.cpp: fix wrong information
- about constness of function
-
-2011-09-16 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: fix a problem with Qt
- slots immediately followed by signals
-
-2011-09-14 Robert Reif
-
- * lib/checkclass.cpp: better fix for #3114 (infinite recursion when
- operator= is overloaded)
-
-2011-09-14 Robert Reif
-
- * lib/checkclass.cpp, test/testclass.cpp: quick fix for #3114
- (infinite recursion when operator= is overloaded)
-
-2011-09-13 Kimmo Varis
-
- * test/testcmdlineparser.cpp: Tests: Add more commandlineparser
- tests. Add commandlineparser tests for giving two suppressions. Giving two
- suppressions in one parameter is not yet supported so it is
- todo-test.
-
-2011-09-13 Edoardo Prezioso
-
- * lib/tokenize.cpp, lib/tokenize.h, test/testclass.cpp,
- test/testmemleak.cpp, test/testsimplifytokens.cpp,
- test/testtokenize.cpp: Fixed #3075 (False positive => Improve
- tokenizer: remove redundant code after a 'return' state)
-
-2011-09-12 Robert Reif
-
- * test/testother.cpp: add test for #3110 (false positve: style)
- Boolean result is used in bitwise operation. Clarify expression with
- parentheses)
-
-2011-09-12 seb777
-
- * test/testtokenize.cpp: Remove invalid test case. The code does
- not compile. In addition, it's a "todo test case".
-
-2011-09-12 Robert Reif
-
- * lib/checkother.cpp: fix #3110 (false positve: style) Boolean
- result is used in bitwise operation. Clarify expression with
- parentheses)
-
-2011-09-11 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: partial
- fix for #2960 (false negative: buffer access out of bounds)
-
-2011-09-11 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/symboldatabase.cpp,
- test/testbufferoverrun.cpp: add multi-dimension array support to
- second checkScope and use it for member arrays
-
-2011-09-11 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h,
- test/testbufferoverrun.cpp: use correct checkScope function in
- CheckBufferOverrun for single dimension member arrays
-
-2011-09-11 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: refactor
- to unify functionally identical code in
- CheckBufferOverrun::checkScope()
-
-2011-09-11 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h: refactor
- CheckBufferOverrun to only use multi-dimension array error messages
- and remove single dimension array message
-
-2011-09-11 Daniel Marjamäki
-
- * lib/checkother.cpp, test/testother.cpp: Fixed #3086 (false
- positive: Boolean result is used in bitwise operation.)
-
-2011-09-11 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testunusedvar.cpp: Fixed #3104 (unread
- despite modified and used in IF statement)
-
-2011-09-11 Daniel Marjamäki
-
- * lib/checkunusedvar.cpp: unused var: use 'else if' instead of 'if'
-
-2011-09-11 seb777
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Revert "The case
- statement requires constant-expression (C, C++, C# and Java." This reverts commit 5879fe419d72328d77ab9d6f717ffa81e4ab6e68.
-
-2011-09-10 seb777
-
- * lib/tokenize.cpp, test/testtokenize.cpp: The case statement
- requires constant-expression (C, C++, C# and Java. Needless to
- simplify the calculation of a piece of code that can not compile.
-
-2011-09-10 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h: refactor
- CheckBufferOverrun::checkScope to take an ArrayInfo parameter
-
-2011-09-10 Robert Reif
-
- * : commit 547a79d4feac46b7d3ba04a091838669618a9b20 Author: Robert
- Reif Date: Sat Sep 10 10:14:32 2011 -0400
-
-2011-09-10 Philipp Kloke
-
- * lib/checkother.cpp, test/testother.cpp: Fixed #1740 (Undefined
- Behavior: Divide by zero)
-
-2011-09-10 seb777
-
- * lib/tokenize.cpp, test/testtokenize.cpp: fix #3093 (Simplify code
- (math expression) with keywords 'return' and 'case')
-
-2011-09-09 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: better
- detection of variable sized structure in
- CheckBufferOverrun::checkStructVariable()
-
-2011-09-09 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: fix some
- CheckBufferOverrun::checkStructVariable() flase negatives for
- possible variable length structs
-
-2011-09-09 Robert Reif
-
- * : commit 16924c7c7ad77a53b41e90f17cfe2ff75411f3f3 Author: Robert
- Reif Date: Fri Sep 9 07:16:39 2011 -0400
-
-2011-09-09 Daniel Marjamäki
-
- * lib/checkmemoryleak.cpp, test/testmemleak.cpp: Fixed #3096 (false
- negative: memory leak not found when passing string to strtok)
-
-2011-09-08 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: fix one of
- the TODO testcases added for #3094 (Buffer access out-of-bounds in
- struct variable)
-
-2011-09-08 Robert Reif
-
- * test/testbufferoverrun.cpp: add soem test cases for #3094 (Buffer
- access out-of-bounds in struct variable)
-
-2011-09-08 Daniel Marjamäki
-
- * lib/checkmemoryleak.h, lib/path.h: fixed a few doxygen warnings
-
-2011-09-08 Daniel Marjamäki
-
- * lib/checkmemoryleak.cpp, lib/checkmemoryleak.h: updated comments
-
-2011-09-06 seb777
-
- * lib/checkother.cpp, test/testother.cpp: fix #195 Unusual shift
- operation - check this kind of code return x >> ! y ? 8 : 2;
-
-2011-09-05 Robert Reif
-
- * lib/checkbufferoverrun.cpp: fix some -Wconversion
- -Wsign-conversion warnings in checkbufferoverrun.cpp
-
-2011-09-05 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h,
- test/testbufferoverrun.cpp: warn when buffer is not zero terminated
- after memmove
-
-2011-09-05 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h,
- test/testbufferoverrun.cpp: warn when buffer is not zero terminated
- after memcpy
-
-2011-09-05 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h,
- test/testbufferoverrun.cpp: warn when buffer is not zero terminated
- after strncpy
-
-2011-09-05 Daniel Marjamäki
-
- * lib/checknullpointer.cpp, test/testuninitvar.cpp: Uninitialized
- vars: handle printf a little better. Ticket: #3050
-
-2011-09-05 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, lib/checkuninitvar.h,
- test/testuninitvar.cpp: uninitstring: fix false negatives when
- non-zero memset is used. Ticket: #3050
-
-2011-09-05 Robert Reif
-
- * lib/checkother.cpp: really fix #3079 (Spelling error in unsigned
- variable check 'never alwayw')
-
-2011-09-05 Robert Reif
-
- * lib/checkother.cpp: fix #3079 (Spelling error in unsigned variable
- check 'never alwayw')
-
-2011-09-04 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: fix #2528
- (false negative: buffer access out of bounds)
-
-2011-09-04 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: fix #2889
- (false negative: buffer access out of bounds on local struct member)
-
-2011-09-04 Daniel Marjamäki
-
- * lib/checkunusedvar.cpp, test/testunusedvar.cpp: Fixed #3078
- (vector::at using int causes false positive)
-
-2011-09-04 Kimmo Varis
-
- * test/testcmdlineparser.cpp: Tests: Add tests for new --enable
- flags. Adding tests for new --enable flafgs (performance, portability) to
- CommandLineParser tests.
-
-2011-09-04 Kimmo Varis
-
- * gui/mainwindow.cpp: GUI: Enable performance- and portability
- checks. The CLI/LIB change earlier added own enable-flag for performance-
- and portability-checks. This commit updates GUI to also enable those
- new enable-flags.
-
-2011-09-04 Robert Reif
-
- * test/testbufferoverrun.cpp: add some variable length array tests
-
-2011-09-04 Daniel Marjamäki
-
- * lib/check64bit.cpp, test/test64bit.cpp: Fixed #3073 (False
- positive: Assigning an integer (int/long/etc) to a pointer is not
- portable)
-
-2011-09-04 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Fixed #3060 (False
- positive: Uninitialized variable: fresh)
-
-2011-09-03 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: final fix
- for #3063 (false negative: multi dimensional arrays not well
- supported)
-
-2011-09-03 seb777
-
- * : commit 5c7ed46e0cb6ffeee17a9185d1ccaa9d9781b560 Author: seb777
- Date: Sat Sep 3 23:10:16 2011 +0200
-
-2011-09-03 seb777
-
- * lib/checkother.cpp, lib/tokenize.cpp, test/testother.cpp,
- test/testtokenize.cpp: Replace the keyword C99 _Bool the bool
- keyword in the process of tokenization See
-
- https://github.com/danmar/cppcheck/commit/f29b7f9f087779d789e8bdc24745930623f314ca
-
-2011-09-03 Daniel Marjamäki
-
- * lib/tokenize.cpp, lib/tokenize.h, test/testsimplifytokens.cpp:
- Fixed #3069 (False positive: Memory leak: data)
-
-2011-09-03 Daniel Marjamäki
-
- * lib/checknullpointer.cpp, test/testnullpointer.cpp: Fixed #3065
- (False positive: possible null pointer dereference: vi)
-
-2011-09-03 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Fixed #3058 (False
- positive: Uninitialized variable: data)
-
-2011-09-03 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/symboldatabase.cpp: move member
- variable lookup code from a check to the symbol database so it can
- be reused by other checks
-
-2011-09-03 Daniel Marjamäki
-
- * cli/cmdlineparser.cpp: CLI: --enable=style has always been the
- same as --enable=style,portability,performance so keep it that way.
- Ticket #3074
-
-2011-09-03 Daniel Marjamäki
-
- * cli/cmdlineparser.cpp, lib/check64bit.cpp,
- lib/checkbufferoverrun.cpp, lib/checknonreentrantfunctions.cpp,
- lib/checkother.cpp, lib/checkpostfixoperator.cpp, lib/checkstl.cpp,
- lib/settings.cpp, lib/tokenize.cpp, test/test64bit.cpp,
- test/testbufferoverrun.cpp, test/testnonreentrantfunctions.cpp,
- test/testother.cpp, test/testpostfixoperator.cpp,
- test/testsimplifytokens.cpp, test/teststl.cpp: enable: break out
- 'performance' and 'portability' from the 'style' id. Ticket: #3074
-
-2011-09-03 Daniel Marjamäki
-
- * man/manual.docbook: manual: document the 'portability' severity.
- Ticket #3074
-
-2011-09-02 Robert Reif
-
- * lib/checkbufferoverrun.cpp, lib/symboldatabase.cpp,
- lib/symboldatabase.h, test/testbufferoverrun.cpp: another partial
- fix for #3063 (false negative: multi dimensional arrays not well
- supported)
-
-2011-09-02 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: partial
- fix for #3063 (false negative: multi dimensional arrays not well
- supported)
-
-2011-09-02 Robert Reif
-
- * lib/checkother.cpp, lib/checkother.h, test/testother.cpp: fix
- #3062 (false negative: Boolean variable is used in bitwise
- operation)
-
-2011-09-02 Robert Reif
-
- * lib/checkautovariables.cpp, test/testautovariables.cpp: fix false
- positive introduced by previous false negative fix commit
-
-2011-09-01 Robert Reif
-
- * lib/checkautovariables.cpp, test/testautovariables.cpp: fix #3066
- (False positive: Inconclusive: Assigning address of local
- auto-variable to a function parameter.)
-
-2011-09-01 Robert Reif
-
- * lib/checkautovariables.cpp, test/testautovariables.cpp: fix line
- number in messagex for CheckAutoVariables::autoVariables
-
-2011-09-01 Robert Reif
-
- * lib/tokenize.cpp, test/testsimplifytokens.cpp: fix #3070 (Other:
- failed to parse a typedef string. Check continues anyway.)
-
-2011-09-01 Robert Reif
-
- * lib/checkautovariables.cpp, test/testautovariables.cpp: fix again
- #3064 (false negative: returning address of stack variable)
-
-2011-09-01 Robert Reif
-
- * lib/checkautovariables.cpp: better error message for #3064 (false
- negative: returning address of stack variable)
-
-2011-08-31 Robert Reif
-
- * lib/checkautovariables.cpp, lib/checkautovariables.h,
- test/testautovariables.cpp: fix #3064 (false negative: returning
- address of stack variable)
-
-2011-08-31 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #3058 (False
- positive: Uninitialized variable: data)
-
-2011-08-31 Robert Reif
-
- * lib/checkunusedvar.cpp, test/testunusedvar.cpp: add new (nothrow)
- support to CheckUnusedVar::checkFunctionVariableUsage
-
-2011-08-30 Robert Reif
-
- * lib/checkmemoryleak.cpp, test/testmemleak.cpp: add support for
- deallocating memory with realloc
-
-2011-08-30 Daniel Marjamäki
-
- * htmlreport/cppcheck-htmlreport: Fixed #3057 (cppcheck-htmlreport
- fails since 1.50)
-
-2011-08-30 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #3058 (False
- positive: Uninitialized variable: data)
-
-2011-08-29 Daniel Marjamäki
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: Fixed
- #3034 (Cppcheck crash on specific file (truecrypt).)
-
-2011-08-28 Robert Reif
-
- * lib/symboldatabase.cpp, lib/symboldatabase.h,
- test/testsymboldatabase.cpp: really fix multi-dimensional arrays
- with undefined size
-
-2011-08-28 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testpreprocessor.cpp: Fixed #3016
- (Preprocessor has incorrect precedence(?) for &&)
-
-2011-08-28 Robert Reif
-
- * lib/symboldatabase.cpp, test/testbufferoverrun.cpp: fix #3044
- (Symbol database: handle multidim array with unknown dimension 'char
- a[][4]')
-
-2011-08-28 Robert Reif
-
- * lib/checkclass.cpp, test/testclass.cpp: fix #3051 (False positive:
- operator= should return reference (when function takes pointer
- argument))
-
-2011-08-28 Robert Reif
-
- * lib/checkclass.cpp, test/testclass.cpp: fix #3052 (False Positive
- - Technically the member function 'Example::Clear' can be const.)
-
-2011-08-28 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: better
- message for strncpy zero-terminated check
-
-2011-08-28 Daniel Marjamäki
-
- * lib/checkmemoryleak.cpp, test/testmemleak.cpp: Fixed #3039 (False
- Positive: Memory Leak 'p = pop(p);')
-
-2011-08-27 Robert Reif