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 72707e76b8f..a821204bf2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,18 +1,29 @@
*.bak
*.gcno
+*.gch
*.o
+*.a
*.pyc
-cppcheck
-cppcheck.exe
-dmake
+/cppcheck
+/cppcheck.exe
+cppcheck-core.dll
+/dmake
+/dmake.exe
reduce
reduce.exe
tags
-testrunner
-testrunner.exe
-tools/dmake
+/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
*.aps
@@ -25,47 +36,96 @@ tools/extracttests
*.sdf
*.suo
*.user
+/.vs/
+UpgradeLog*.htm
# VS build folders
bin/
Build/
BuildTmp/
-cli/temp/
+/cli/temp/
ipch/
-lib/temp/
-test/temp/
+/lib/temp/
+/test/temp/
# XCode build folders and files
*.mode[0-9]v[0-9]
*.pbxuser
build/
-# GUI build folders
-gui/debug/
-gui/release/
-gui/temp/
-
# Other (generated) GUI files
-gui/*.qm
-gui/cppcheck-gui
-gui/gui.sln
-gui/gui.vcproj
-gui/Makefile
-gui/Makefile.debug
-gui/Makefile.release
-gui/qrc_gui.cpp
+/gui/help/online-help.qch
+/gui/help/online-help.qhc
# Doxygen output folder
doxyoutput/
-# qmake generated
-htmlreport/.tox/
-htmlreport/MANIFEST
-
# Backup files and stuff from patches
-*.orig
*.rej
*~
# kdevelop 4.x
*.kdev4
+
+# Common cmake build directories
+build**/
+
+# 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/.travis.yml b/.travis.yml
deleted file mode 100644
index cb4ef647f08..00000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: cpp
-compiler:
- - gcc
- - clang
-script:
- - make test
- - $CXX -o cppcheck -O2 cli/*.cpp lib/*.cpp -Ilib
- - ./cppcheck --error-exitcode=1 -Ilib --enable=style --suppress=duplicateBranch -q cli gui lib -igui/test
- - mkdir build
- - make test SRCDIR=build
-
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 1c96fce716c..e804ab53e16 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,26 +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
-Goran 'vBm' Džaferi
+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
+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 c4115d6b223..00000000000
--- a/Changelog
+++ /dev/null
@@ -1,47874 +0,0 @@
-2013-01-12 Daniel Marjamäki
-
- * cli/main.cpp, lib/cppcheck.cpp, lib/version.h,
- man/manual.docbook, win_installer/productInfo.wxi: 1.58: Set
- versions
-
-2013-01-12 Daniel Marjamäki
-
- * readme.txt: readme: tell about SRCDIR=build
-
-2013-01-12 Daniel Marjamäki
-
- * man/manual.docbook: Manual: Added chapter about --inconclusive
-
-2013-01-12 Daniel Marjamäki
-
- * man/manual.docbook: manual: updated date
-
-2013-01-12 Daniel Marjamäki
-
- * gui/test/translationhandler/testtranslationhandler.cpp: Fixed
- #4479 (GUI tests fail)
-
-2013-01-12 Daniel Marjamäki
-
- * man/manual.docbook: manual: removed recommendation to not include
- standard headers from the manual. I can't provide good reasons to
- not include the standard headers right now.
-
-2013-01-11 Daniel Marjamäki
-
- * man/manual.docbook: manual: updated the Severities chapter. No
- major changes, just tried to make it more clear.
-
-2013-01-11 Daniel Marjamäki
-
- * man/manual.docbook: manual: Removed chapter about exception safety
- checks. They are enabled by the normal --enable=all.
-
-2013-01-11 Daniel Marjamäki
-
- * man/manual.docbook: manual: don't write that threads can't be used
- in windows.
-
-2013-01-11 Daniel Marjamäki
-
- * man/manual.docbook: manual: use --include instead of --append in
- the custom leaks section
-
-2013-01-10 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testsimplifytokens.cpp: Fixed #4476
- (Tokenizer: wrong simplification of static anonymous-type struct
- array declaration)
-
-2013-01-10 Thomas Jarosch
-
- * tools/extracttests.py, tools/matchcompiler.py, tools/reduce.cpp:
- Add missing copyright header
-
-2013-01-09 Zachary Blair
-
- * lib/checknullpointer.cpp, test/testnullpointer.cpp: Fixed #4389
- (False positive: Possible null pointer dereference if the default
- parameter value is used)
-
-2013-01-09 Thomas Jarosch
-
- * .gitignore, tools/argparse.py: Add local copy of argparse module
- to support python 2.6 / python 3.0
-
-2013-01-09 Edoardo Prezioso
-
- * lib/token.cpp, test/testtoken.cpp, tools/matchcompiler.py:
- Token::Match: removed harmless special code for initial '!!foo'
- patterns.
-
-2013-01-09 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Add cmdline handling
-
-2013-01-09 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Workaround broken code
- generation for "!!foo" patterns This is just meant for the upcoming release.
-
-2013-01-09 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Be more user friendly on
- how to invoke it
-
-2013-01-09 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Create 'build' directory
- if needed
-
-2013-01-09 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Workaround broken
- optimizations in verify mode If the match compiler uses the 'verify' mode and we compile with
- -O2, some tests comparing the on-the-fly-parser to the compiled
- match fail. Small functions are inlined by the -O2 compile flag. If we disable
- function inlining and still compile with -O2, everything is back to
- normal. gdb didn't show anything useful during the mismatch since the needed
- variables are optimized out. Once we start printing them, the
- problem vanishes, too. -> Can only be diagnosed at the x86 assembly
- level. The problem vanished by switching the invocation order of
- Token::Match() and the compiled match, so just swap them. Also add commented out helper code to better diagnose mismatch
- problems.
-
-2013-01-09 Thomas Jarosch
-
- * lib/templatesimplifier.cpp: Revert "Change location of %op%
- operator in multicompare" It's no longer needed with the proper fix
- for Token::Match(). This reverts commit 8b2adf1391f5ae02040ecf1fdc6c2d422e87c343.
-
-2013-01-09 Thomas Jarosch
-
- * lib/token.cpp, lib/token.h, test/testtoken.cpp: Properly implement
- %op% for Token::multiCompare Use tok->isOp() instead of doing it "manually". This fixes false positives for the C++ template case since the
- brackets in "template < something >" are not comparison operators. Profiling showed using tok->isOp() is actually faster than before
- (-O2).
-
-2013-01-08 Thomas Jarosch
-
- * lib/templatesimplifier.cpp: Change location of %op% operator in
- multicompare When the %op% operator is the first element of a multicompare, it
- properly executes Token::isOp(). Otherwise it uses it's "internal
- implementation". Workaround inspired by Edoardo Prezioso.
-
-2013-01-08 Daniel Marjamäki
-
- * tools/reduce.cpp: tools/reduce: change default timeout to 5
- minutes no matter if --hang is used or not.
-
-2013-01-08 Thomas Jarosch
-
- * test/testtoken.cpp: Add another TODO test case for Token::Match
-
-2013-01-07 Thomas Jarosch
-
- * test/testtoken.cpp: Add TODO test case for a bug in Token::Match
- multicompare The result of the %op% operator is wrong in the multicompare case
- for C++ templates. Detected by comparing the output of the compiled
- matches with the on-the-fly match parser.
-
-2013-01-07 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Implement 'verify mode'
- for Token::Match Verify mode runs the same ::Match pattern on a token using the
- on-the-fly parser and the compiled match parser. The result is
- compared and we abort on mismatch. Already detected an error in our test suite, needs investigation.
-
-2013-01-07 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Split _replaceTokenMatch()
- into two small functions
-
-2013-01-07 Frank Zingsheim
-
- * lib/checkunusedvar.cpp, test/testunusedvar.cpp: Fixed #4385:
- lock_guard RAII throws unreadVariable
-
-2013-01-07 XhmikosR
-
- * lib/version.h: version.h: update copyright year
-
-2013-01-07 XhmikosR
-
- * gui/cppcheck_de.ts, gui/cppcheck_es.ts, gui/cppcheck_fi.ts,
- gui/cppcheck_fr.ts, gui/cppcheck_it.ts, gui/cppcheck_ja.ts,
- gui/cppcheck_ko.ts, gui/cppcheck_nl.ts, gui/cppcheck_ru.ts,
- gui/cppcheck_sr.ts, gui/cppcheck_sv.ts, gui/cppcheck_zh_CN.ts:
- update translations
-
-2013-01-07 Daniel Marjamäki
-
- * tools/reduce.cpp: reduce: rename stdout to print to avoid name
- clash
-
-2013-01-07 Daniel Marjamäki
-
- * lib/checkunusedvar.cpp, lib/tokenize.cpp,
- test/testsimplifytokens.cpp, test/testtokenize.cpp: Fixed #4381
- (Inline type declaration on statics causes warning)
-
-2013-01-05 Zachary Blair
-
- * lib/checkother.cpp, test/testother.cpp: Fixed #4405 (False
- positive: Memory in freed twice (throw))
-
-2013-01-05 PKEuS
-
- * lib/checkclass.cpp, test/testclass.cpp: Fixed #4460: Ensure that
- memset/memcpy is called on a pointer to a class instance.
-
-2013-01-05 Edoardo Prezioso
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Revert partially the
- previous commit: The two formulas are true iff 2n = 2 <=> n = 1.
-
-2013-01-04 Edoardo Prezioso
-
- * lib/tokenize.cpp: Related to the previous commit: Use bit operator '&' instead of modulo operator '%'.
-
-2013-01-04 Edoardo Prezioso
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Simplify some generalized
- math formulas: Now the 'sin^2+cos^2=1' and the 'sinh^2-cosh^2=-1' code can handle,
- for example: sin^4+cos^4=1, sinh^10-cosh^10=-1. Also, the arguments
- can be also multitokens, so that it's possible to simplify, for
- example: 'sin^2(k())+cos^2(k())=1'.
-
-2013-01-04 Edoardo Prezioso
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed wrong tokenization
- of some math formulas: The two formulas: sin^2+cos^2 = 1 and sinh^2-cosh^2 = -1 are true
- iff the two arguments are the same.
-
-2013-01-04 Robert Reif
-
- * lib/checkclass.cpp, lib/symboldatabase.cpp, test/testclass.cpp,
- test/testconstructors.cpp: Fixed #4458 (False positive:
- noCopyConstructor in template class)
-
-2013-01-04 Daniel Marjamäki
-
- * gui/gui.pro, gui/mainwindow.cpp, gui/selectfilesdialog.cpp,
- gui/selectfilesdialog.h, gui/selectfilesdialog.ui: GUI: removed my
- clumpsy selectfiles dialog. use the standard file selection dialog
- instead.
-
-2013-01-04 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Aggregate match functions
- with the same pattern / function call signature Reduces the number of generated functions from 2290 to 1916.
-
-2013-01-04 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Store matchFunctions and
- matchStrs in the class instead of passing it around
-
-2013-01-04 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Cosmetic changes after
- running pylint
-
-2013-01-04 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Turn code into a python
- class This will make passing around internal states a lot easier
-
-2013-01-04 Thomas Jarosch
-
- * lib/tokenize.cpp: Simple constification (needed by the match
- compiler)
-
-2013-01-04 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Inline generated pattern
- match code for Token::findmatch Verified the output in build/ stayed the same if Token::findmatch
- support is disabled.
-
-2013-01-03 Edoardo Prezioso
-
- * lib/symboldatabase.cpp, lib/symboldatabase.h: Use more Effective
- C++ code style in SymbolDatabase class: 1)The SymbolDatabase::findScope code is moved to the const-version.
- The non-const version is reimplemented as the combination with
- const_cast and static_cast. 2)Unrelated: change style of the
- declaration of some functions (the '*' is moved near the function
- name).
-
-2013-01-04 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Check varid on first use
- like Token::Match does
-
-2013-01-04 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Add support for
- Token::findmatch (still disabled for performance reasons)
-
-2013-01-03 Edoardo Prezioso
-
- * lib/token.cpp, lib/token.h, lib/tokenize.cpp: Use more Effective
- C++ code style in Token class: 1)The non-const version of Token::tokAt and Token::linkAt now will
- use a combination of const_cast and static_cast to remove duplicate
- code. 2)The non-const versions of Token::find(simple)match are
- added, in order to avoid the usage of const_cast outside the Token
- code. 3)As a consequence of 2), an useless const_cast applied to a
- call of Token::findsimplematch in Tokenizer code is removed.
-
-2013-01-03 Thomas Jarosch
-
- * .gitignore: Add reduce tool to .gitignore
-
-2013-01-03 Thomas Jarosch
-
- * Makefile, tools/dmake.cpp: Remove reduce tool in 'make clean'
-
-2013-01-03 Thomas Jarosch
-
- * tools/reduce.cpp: tools/reduce: Remove unused variable detected by
- cppcheck [reduce.cpp:475]: (style) Variable 'decl' is assigned a value that
- is never used.
-
-2012-12-31 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Compile
- Token::findsimplematch() calls Disabled for now as it runs slowers than before.
-
-2013-01-03 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #4409 (Cppcheck
- 1.58 dev hangs when checking mhz.c of lmbench3 (attached code))
-
-2013-01-03 Daniel Marjamäki
-
- * tools/reduce.cpp: tools/reduce: remove cast in function parameter
-
-2013-01-03 Daniel Marjamäki
-
- * tools/reduce.cpp: tools/reduce: improvements to make it possible
- to reduce code that hangs
-
-2013-01-03 Daniel Marjamäki
-
- * lib/tokenize.cpp: Tokenizer: add reportProgress to
- Tokenizer::simplifyKnownVariables. Ticket: #4409
-
-2013-01-03 Daniel Marjamäki
-
- * lib/templatesimplifier.cpp, test/testpreprocessor.cpp: Fixed #4456
- (std::string::compare(char const*) crash)
-
-2013-01-02 Daniel Marjamäki
-
- * tools/reduce.cpp: reduce: remove more stuff. unneeded #define ,
- unneeded constructors, unneeded #ifndef etc
-
-2013-01-02 Edoardo Prezioso
-
- * gui/cppcheck_de.ts, gui/cppcheck_es.ts, gui/cppcheck_fi.ts,
- gui/cppcheck_fr.ts, gui/cppcheck_it.ts, gui/cppcheck_ja.ts,
- gui/cppcheck_ko.ts, gui/cppcheck_nl.ts, gui/cppcheck_ru.ts,
- gui/cppcheck_sr.ts, gui/cppcheck_sv.ts, gui/cppcheck_zh_CN.ts:
- Update cppcheck translations.
-
-2013-01-02 Daniel Marjamäki
-
- * tools/reduce.cpp: reduce: remove more code blocks
-
-2013-01-02 Daniel Marjamäki
-
- * Makefile, tools/dmake.cpp: dmake: fixed reduce compilation
-
-2013-01-02 Daniel Marjamäki
-
- * Makefile, tools/dmake.cpp: dmake: fixed compilation of reduce
-
-2013-01-02 Daniel Marjamäki
-
- * lib/checkclass.cpp, test/testconstructors.cpp: Fixed #4454 (False
- positive: class member (POD) not initialized (when initialized to 0
- in initializer list))
-
-2013-01-02 Daniel Marjamäki
-
- * Makefile, tools/dmake.cpp: dmake: use 'make reduce' to compile the
- reduce program
-
-2013-01-01 Daniel Marjamäki
-
- * tools/reduce.cpp: tools/reduce: various improvements to remove
- more code
-
-2013-01-01 Reijo Tomperi
-
- * cli/cmdlineparser.cpp, cli/cmdlineparser.h,
- cli/cppcheckexecutor.cpp, cli/cppcheckexecutor.h,
- cli/filelister.cpp, cli/filelister.h, cli/main.cpp,
- cli/pathmatch.cpp, cli/pathmatch.h, cli/threadexecutor.cpp,
- cli/threadexecutor.h, gui/aboutdialog.cpp, gui/aboutdialog.h,
- gui/application.cpp, gui/application.h, gui/applicationdialog.cpp,
- gui/applicationdialog.h, gui/applicationlist.cpp,
- gui/applicationlist.h, gui/checkstatistics.cpp,
- gui/checkstatistics.h, gui/checkthread.cpp, gui/checkthread.h,
- gui/common.h, gui/csvreport.cpp, gui/csvreport.h,
- gui/erroritem.cpp, gui/erroritem.h, gui/filelist.cpp,
- gui/filelist.h, gui/fileviewdialog.cpp, gui/fileviewdialog.h,
- gui/logview.cpp, gui/logview.h, gui/main.cpp, gui/mainwindow.cpp,
- gui/mainwindow.h, gui/platforms.cpp, gui/platforms.h,
- gui/project.cpp, gui/project.h, gui/projectfile.cpp,
- gui/projectfile.h, gui/projectfiledialog.cpp,
- gui/projectfiledialog.h, gui/report.cpp, gui/report.h,
- gui/resultstree.cpp, gui/resultstree.h, gui/resultsview.cpp,
- gui/resultsview.h, gui/scratchpad.cpp, gui/scratchpad.h,
- gui/selectfilesdialog.cpp, gui/selectfilesdialog.h,
- gui/settingsdialog.cpp, gui/settingsdialog.h, gui/showtypes.cpp,
- gui/showtypes.h, gui/statsdialog.cpp, gui/statsdialog.h,
- gui/test/benchmark/simple/benchmarksimple.cpp,
- gui/test/benchmark/simple/benchmarksimple.h,
- gui/test/data/benchmark/simple.cpp,
- gui/test/filelist/testfilelist.cpp,
- gui/test/filelist/testfilelist.h,
- gui/test/projectfile/testprojectfile.cpp,
- gui/test/projectfile/testprojectfile.h,
- gui/test/translationhandler/testtranslationhandler.cpp,
- gui/test/translationhandler/testtranslationhandler.h,
- gui/test/xmlreport/testxmlreport.cpp,
- gui/test/xmlreport/testxmlreport.h,
- gui/test/xmlreportv1/testxmlreportv1.cpp,
- gui/test/xmlreportv1/testxmlreportv1.h,
- gui/test/xmlreportv2/testxmlreportv2.cpp,
- gui/test/xmlreportv2/testxmlreportv2.h, gui/threadhandler.cpp,
- gui/threadhandler.h, gui/threadresult.cpp, gui/threadresult.h,
- gui/translationhandler.cpp, gui/translationhandler.h,
- gui/txtreport.cpp, gui/txtreport.h, gui/xmlreport.cpp,
- gui/xmlreport.h, gui/xmlreportv1.cpp, gui/xmlreportv1.h,
- gui/xmlreportv2.cpp, gui/xmlreportv2.h, lib/check.h,
- lib/check64bit.cpp, lib/check64bit.h, lib/checkassignif.cpp,
- lib/checkassignif.h, lib/checkautovariables.cpp,
- lib/checkautovariables.h, lib/checkboost.cpp, lib/checkboost.h,
- lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h,
- lib/checkclass.cpp, lib/checkclass.h, lib/checkexceptionsafety.cpp,
- lib/checkexceptionsafety.h, lib/checkinternal.cpp,
- lib/checkinternal.h, lib/checkio.cpp, lib/checkio.h,
- lib/checkleakautovar.cpp, lib/checkleakautovar.h,
- lib/checkmemoryleak.cpp, lib/checkmemoryleak.h,
- lib/checknonreentrantfunctions.cpp,
- lib/checknonreentrantfunctions.h, lib/checknullpointer.cpp,
- lib/checknullpointer.h, lib/checkobsoletefunctions.cpp,
- lib/checkobsoletefunctions.h, lib/checkother.cpp, lib/checkother.h,
- lib/checkpostfixoperator.cpp, lib/checkpostfixoperator.h,
- lib/checkstl.cpp, lib/checkstl.h, lib/checkuninitvar.cpp,
- lib/checkuninitvar.h, lib/checkunusedfunctions.cpp,
- lib/checkunusedfunctions.h, lib/checkunusedvar.cpp,
- lib/checkunusedvar.h, lib/cppcheck.cpp, lib/cppcheck.h,
- lib/errorlogger.cpp, lib/errorlogger.h, lib/executionpath.cpp,
- lib/executionpath.h, lib/mathlib.cpp, lib/mathlib.h, lib/path.cpp,
- lib/path.h, lib/preprocessor.cpp, lib/preprocessor.h,
- lib/settings.cpp, lib/settings.h, lib/suppressions.cpp,
- lib/suppressions.h, lib/symboldatabase.cpp, lib/symboldatabase.h,
- lib/templatesimplifier.cpp, lib/templatesimplifier.h,
- lib/timer.cpp, lib/timer.h, lib/token.cpp, lib/token.h,
- lib/tokenize.cpp, lib/tokenize.h, lib/tokenlist.cpp,
- lib/tokenlist.h, man/cppcheck.1.xml, test/test64bit.cpp,
- test/testassignif.cpp, test/testautovariables.cpp,
- test/testboost.cpp, test/testbufferoverrun.cpp,
- test/testcharvar.cpp, test/testclass.cpp,
- test/testcmdlineparser.cpp, test/testconstructors.cpp,
- test/testcppcheck.cpp, test/testdivision.cpp,
- test/testerrorlogger.cpp, test/testexceptionsafety.cpp,
- test/testfilelister.cpp, test/testincompletestatement.cpp,
- test/testinternal.cpp, test/testio.cpp, test/testleakautovar.cpp,
- test/testmathlib.cpp, test/testmemleak.cpp,
- test/testnonreentrantfunctions.cpp, test/testnullpointer.cpp,
- test/testobsoletefunctions.cpp, test/testother.cpp,
- test/testpath.cpp, test/testpathmatch.cpp,
- test/testpostfixoperator.cpp, test/testpreprocessor.cpp,
- test/testrunner.cpp, test/testsimplifytokens.cpp, test/teststl.cpp,
- test/testsuite.cpp, test/testsuite.h, test/testsuppressions.cpp,
- test/testsymboldatabase.cpp, test/testthreadexecutor.cpp,
- test/testtimer.cpp, test/testtoken.cpp, test/testtokenize.cpp,
- test/testuninitvar.cpp, test/testunusedfunctions.cpp,
- test/testunusedprivfunc.cpp, test/testunusedvar.cpp,
- test/testutils.h, tools/dmake.cpp: Updating year 2012 -> 2013 to
- .cpp and .h files and man page.
-
-2013-01-01 Daniel Marjamäki
-
- * tools/reduce.cpp: tools/reduce: better handling of #include
-
-2013-01-01 Daniel Marjamäki
-
- * tools/reduce.cpp: tools/reduce: removing blocks of code that
- contain #if,#else,#endif
-
-2013-01-01 Daniel Marjamäki
-
- * tools/reduce.cpp: tools/reduce: speedup, terminate checking when
- error is found
-
-2013-01-01 Robert Reif
-
- * lib/checkclass.cpp, lib/checkclass.h, lib/symboldatabase.cpp,
- lib/symboldatabase.h, test/testconstructors.cpp: Fixed #4302 (Member
- variable not initialized in public delegate constructor)
-
-2012-12-31 Thomas Jarosch
-
- * tools/matchcompiler.py: MC: Split convertFile() function into
- smaller pieces Output of build/ stayed the same.
-
-2012-12-31 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Python syntax
- simplification Output in build/ stayed the same
-
-2012-12-31 Thomas Jarosch
-
- * AUTHORS: Add myself to AUTHORS
-
-2012-12-31 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Speed up Token comparison
- with string literals. Ticket #4451 "Cache" string literals as C++ std::string objects. The string
- length gets cached and so we don't need to call strlen() on the
- literals at runtime.
-
-2012-12-31 Edoardo Prezioso
-
- * lib/tokenize.cpp: Use 'simple' matching with normal patterns.
-
-2012-12-31 Daniel Marjamäki
-
- * tools/reduce.cpp: reduce: Added simple command line tool that
- reduces code for a false positive.
-
-2012-12-31 Daniel Marjamäki
-
- * lib/checkclass.cpp, lib/symboldatabase.cpp: Replaced %name% with
- %type%
-
-2012-12-30 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: Collect and cache plain
- C-strings Profiler runs with gperftools showed we were spending a lot of time
- in strlen() even with compiled match patterns. If you compare a std::string with a plain C-string, the comparison
- operator needs to calculate the length of the C-string via strlen(). We can avoid this by turning all C-strings into C++ strings, which
- cache the string length internally. The match compiler has been adapted to collect all C-strings during
- compilation and aggregate them. Benchmark on the 'rpm' code base on a Core i7 920 box: cppcheck without matchcompiler: real 0m30.977s cppcheck with previous matchcompiler: real 0m28.157s cppcheck with cached C-strings: real 0m17.823s
-
-2012-12-30 Thomas Jarosch
-
- * tools/matchcompiler.py: Match compiler: No need to handle %num%
- twice
-
-2012-12-29 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #4372 (Tokenizer
- misidentifying which function a variable belongs to)
-
-2012-12-29 Daniel Marjamäki
-
- * lib/checkunusedvar.cpp: astyle formatting
-
-2012-12-29 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #4316 (False
- positive: (constStatement) Redundant code)
-
-2012-12-29 Daniel Marjamäki
-
- * lib/checkunusedvar.cpp, test/testunusedvar.cpp: Fixed #4411
- (Variable is assigned a value that is never used.)
-
-2012-12-28 Daniel Marjamäki
-
- * : Merge pull request #126 from SimonKagstrom/for-upstream Misc fixes for the --include= option
-
-2012-12-29 Daniel Marjamäki
-
- * lib/symboldatabase.cpp, test/testsymboldatabase.cpp: Symbol
- database: Add support for unnamed array arguments to functions
- (#4444)
-
-2012-12-29 Robert Reif
-
- * lib/checkclass.cpp, test/testconstructors.cpp: Fixed #4449
- (segfault in CheckClass::initializeVarList())
-
-2012-12-28 Thomas Jarosch
-
- * lib/checkother.cpp, test/testother.cpp: Fix crash on empty
- brackets Relevant parts from the backtrace:
-
-2012-12-28 Daniel Marjamäki
-
- * lib/checkunusedvar.cpp, test/testunusedvar.cpp: Fixed #4022 (false
- positive: (style) Variable 'sort_entry' is assigned a value that is
- never used)
-
-2012-12-28 Robert Reif
-
- * lib/symboldatabase.cpp: Symbol database: Improved handling of
- array arguments (#4444)
-
-2012-12-28 Simon Kagstrom
-
- * lib/path.cpp, lib/path.h, lib/preprocessor.cpp, test/testpath.cpp:
- path: Add getPathFromFilename (returns the path part of a filename) E.g., /tmp/a.h -> /tmp/ a.h -> etc.
-
-2012-12-28 Simon Kagstrom
-
- * cli/cmdlineparser.cpp: Ticket 4408: cmdlineparser: Improve
- description of --include=
-
-2012-12-28 Simon Kagstrom
-
- * lib/preprocessor.cpp: preprocessor: Kill commented out code
-
-2012-12-28 Simon Kagstrom
-
- * cli/cmdlineparser.cpp: Ticket #4408: cmdlineparser: Don't force
- single configuration with --include=
-
-2012-12-28 Simon Kagstrom
-
- * lib/preprocessor.cpp: preprocessor: Don't access empty lists libc aborts with: /usr/include/c++/4.4/debug/list:256:error: attempt to access an
- element in an empty container. Objects involved in the operation: sequence "this" @ 0x0xbfffe5f0 { type = NSt7__debug4listISsSaISsEEE; } otherwise.
-
-2012-12-28 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Fixed #4426 (False
- positive: Unitialized variable warning when comparing addresses)
-
-2012-12-28 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp: Uninitialized variables: Added debug
- warning for bailout
-
-2012-12-28 Thomas Jarosch
-
- * lib/checkbufferoverrun.cpp: Fix comment about wrong magic number
-
-2012-12-28 Thomas Jarosch
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: Fixed
- #4444 (segmentation fault)
-
-2012-12-28 Robert Reif
-
- * lib/checkclass.cpp, lib/symboldatabase.cpp,
- test/testsymboldatabase.cpp: Fixed #4442 (crash of cppcheck while
- scanning gcc-testsuite (invalid code))
-
-2012-12-27 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: fixed false positives by bailing out when variable is
- conditionally initialized and then there is a conditional return.
-
-2012-12-27 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Tokenizer::setVarId:
- Fixed problem with initializer lists (#4436)
-
-2012-12-27 Robert Reif
-
- * lib/checkclass.cpp, lib/symboldatabase.cpp, test/testclass.cpp,
- test/testconstructors.cpp: Fixed #4419 (False positive: Class does
- not have a constructor)
-
-2012-12-27 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #4436 (FP: Member
- variable is not initialized in the constructor. (with two
- parameters))
-
-2012-12-27 Daniel Marjamäki
-
- * lib/preprocessor.cpp: Fixed Cppcheck self-check message
-
-2012-12-27 Daniel Marjamäki
-
- * lib/preprocessor.cpp: Preprocessor: Reduce variable scope
-
-2012-12-27 Daniel Marjamäki
-
- * lib/preprocessor.cpp: astyle formatting
-
-2012-12-27 Simon Kagstrom
-
- * cli/cmdlineparser.cpp, lib/preprocessor.cpp, lib/settings.h,
- lib/tokenlist.cpp, test/testtokenize.cpp: Fixed #4408 (Force
- inclusion of files (a la -include /.../ in GCC))
-
-2012-12-27 Daniel Marjamäki
-
- * lib/checkassignif.cpp, test/testassignif.cpp: Fixed #4434 (false
- positive: (style) Mismatching assignment and comparison, comparison
- 'pen!=-1' is always true.)
-
-2012-12-27 acm4me
-
- * cli/cmdlineparser.cpp, cli/threadexecutor.cpp,
- lib/checkmemoryleak.cpp, lib/checkuninitvar.cpp,
- lib/checkunusedvar.cpp, lib/mathlib.cpp, lib/path.cpp,
- lib/symboldatabase.cpp, lib/token.cpp, lib/token.h,
- lib/tokenize.cpp, lib/tokenlist.cpp: Support for Sun Studio C++
- compiler
-
-2012-12-26 Daniel Marjamäki
-
- * cli/cppcheckexecutor.cpp, lib/cppcheck.cpp, lib/cppcheck.h:
- Cppcheck: Show single 'too many configurations' message if
- --enable=information hasn't been used and there are too many
- configurations.
-
-2012-12-26 PKEuS
-
- * test/testbufferoverrun.cpp, test/testleakautovar.cpp: Fixed unit
- tests
-
-2012-12-26 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testsimplifytokens.cpp,
- test/testtokenize.cpp: Fixed #4433 (Wrong array size for string with
- \0)
-
-2012-12-26 Robert Reif
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: Fixed
- #4432 (Crash on parsing PHP interpreter)
-
-2012-12-25 Thomas Jarosch
-
- * tools/times.c: Silence cppcheck warning
-
-2012-12-25 Daniel Marjamäki
-
- * lib/checknullpointer.cpp, test/testnullpointer.cpp: Null pointer:
- Fixed FP when there are 'return p?p->x:0;'
-
-2012-12-25 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: fixed FP when there are function calls where type* is
- converted to unknown_type
-
-2012-12-25 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: fixed FP when there are suspicious function calls where
- type** is converted to type*
-
-2012-12-25 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: Fixed FP when using typeof on uninitialized data in
- return statement
-
-2012-12-25 Thomas Jarosch
-
- * tools/matchcompiler.py: Add execute permissions to
- matchcompiler.py on linux
-
-2012-12-25 Thomas Jarosch
-
- * tools/extracttests.py, tools/matchcompiler.py: Python 3
- compatibility for the helper scripts print() is a function in python 3. Works with pyhton 2.x, too.
-
-2012-12-25 Daniel Marjamäki
-
- * lib/checkstl.cpp, test/teststl.cpp: Fixed #4431 (FP: Erroneous
- 'Ineffective call of function empty()' in ?: test)
-
-2012-12-25 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: handle unsimplified labels better
-
-2012-12-25 Daniel Marjamäki
-
- * lib/token.cpp, lib/tokenize.cpp, test/testsimplifytokens.cpp:
- Tokenizer: Improved handling of '\0' in strings
-
-2012-12-24 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: Better value flow analysis. Fixed false positives.
-
-2012-12-24 Daniel Marjamäki
-
- * lib/checkother.cpp: Opposite inner conditions: Clean up
- copy/pasted code
-
-2012-12-24 Daniel Marjamäki
-
- * lib/checkclass.cpp, lib/symboldatabase.cpp, test/testclass.cpp,
- test/testconstructors.cpp: Revert "Fixed #4419 (False positive:
- Class does not have a constructor)" This reverts commit 9a79961b6c147878619037cc0a61046b4976771e. There is a segmentation fault when checking lib/preprocessor.cpp
-
-2012-12-24 Robert Reif
-
- * lib/checkclass.cpp, lib/symboldatabase.cpp, test/testclass.cpp,
- test/testconstructors.cpp: Fixed #4419 (False positive: Class does
- not have a constructor)
-
-2012-12-23 XhmikosR
-
- * htdocs/site/css/all.css, htdocs/site/css/pack.css: merge similar
- selectors and use silver instead of the hex color since it's smaller
-
-2012-12-23 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Tokenizer::setVarId:
- Fixed problem in initializer list when parameter and class member
- has same name
-
-2012-12-23 XhmikosR
-
- * htmlreport/cppcheck-htmlreport: htmlreport/cppcheck-htmlreport:
- simplify css
-
-2012-12-23 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: Fixed false positives when variable x is given a nonzero
- value when variable y is uninitialized.
-
-2012-12-23 XhmikosR
-
- * readme.md: readme.md: various improvements
-
-2012-12-22 XhmikosR
-
- * gui/help/buildhelp.bat: buildhelp.bat: Add missing popd
-
-2012-12-23 Daniel Marjamäki
-
- * lib/cppcheck.cpp: Cppcheck: Only show 'Too many configurations'
- and 'Interrupted checking' information messages when information
- severity is enabled
-
-2012-12-23 Robert Reif
-
- * lib/tokenize.cpp, test/testtokenize.cpp: Fixed #4430 (FP: Member
- variable is not initialized in the constructor.)
-
-2012-12-22 Daniel Marjamäki
-
- * lib/tokenize.cpp, test/testsimplifytokens.cpp: Tokenizer: Fixed
- goto problems
-
-2012-12-22 Daniel Marjamäki
-
- * lib/checkbufferoverrun.cpp, lib/checkbufferoverrun.h,
- test/testbufferoverrun.cpp: Fixed #4262 (Small Request/Suggestion
- for checks on array size of args (bounty offer))
-
-2012-12-22 Daniel Marjamäki
-
- * lib/checkbufferoverrun.cpp, test/testbufferoverrun.cpp: Fixed
- #4398 (False negative: out of bounds (for loop))
-
-2012-12-21 Robert Reif
-
- * lib/checkclass.cpp, test/testconstructors.cpp: Fixed #4383
- (Improve check: uninitialized member variable not detected when
- initialization is not proper)
-
-2012-12-21 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: Better testing of function handling
-
-2012-12-21 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: warn about structs in C code
-
-2012-12-21 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables: Improved handling of function calls
-
-2012-12-21 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, test/testuninitvar.cpp: Uninitialized
- variables : fixed false positives when passing address of pointer to
- function.
-
-2012-12-21 Daniel Marjamäki
-
- * : Merge pull request #125 from heyuqi/zhcn-trans GUI add translation for Simplified Chinese.
-
-2012-12-20 Daniel Marjamäki
-
- * lib/checkother.cpp, test/testother.cpp: Fixed #4403 (False
- positive 'Conversion of string literal to bool always
- evaluates to true.' with BOOST_ASSERT)
-
-2012-12-20 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, lib/checkuninitvar.h,
- test/testuninitvar.cpp: Uninitialized variables: Improved checking
- of functions
-
-2012-12-20 He Yuqi
-
- * gui/cppcheck_zh_CN.ts: Update the Chinese translation.
-
-2012-12-20 PKEuS
-
- * lib/checkunusedvar.cpp: Fixed compiler error in VS10
-
-2012-12-20 Robert Reif
-
- * lib/symboldatabase.cpp, lib/symboldatabase.h, test/teststl.cpp:
- Symbol database: Better handling of 'using namespace N;'. Ticket:
- #4412
-
-2012-12-19 He Yuqi
-
- * gui/cppcheck_zh_CN.ts: Update the Chinese translation.
-
-2012-12-19 He Yuqi
-
- * gui/cppcheck_zh_CN.ts: Update the Chinese translation.
-
-2012-12-19 Daniel Marjamäki
-
- * tools/matchcompiler.py: matchcompiler: throw InternalError if
- Token::Match is called with the varid 0
-
-2012-12-18 Daniel Marjamäki
-
- * lib/checkuninitvar.cpp, lib/checkunusedvar.cpp,
- test/testuninitvar.cpp, test/testunusedvar.cpp: Fixed #4320 (False
- positives 'unassignedVariable' and 'uninitvar')
-
-2012-12-19 He Yuqi
-
- * gui/cppcheck_zh_CN.ts, gui/gui.pro, gui/translationhandler.cpp:
- Update the chinese translation.
-
-2012-12-18 He Yuqi
-
- * gui/cppcheck_zh_CN.ts: Create the translation file for Simplified
- Chinese.
-
-2012-12-17 Daniel Marjamäki
-
- * lib/checkunusedvar.cpp, test/testunusedvar.cpp: Unused var: Limit
- bailout for foreach loops. Only bailout if name contains 'foreach'
- or 'for_each'. Only bailout variables that are used more than once
- in the body. Ticket: #4155
-
-2012-12-17 Daniel Marjamäki
-
- * lib/checkunusedvar.cpp, test/testunusedvar.cpp: Fixed #4155 (false
- positive: Variable is assigned a value that is never used (inside
- BOOST_FOREACH loop))
-
-2012-12-16 Daniel Marjamäki
-
- * lib/checkmemoryleak.cpp, test/testmemleak.cpp:
- CheckMemoryLeaksInFunction: Fixed problems with catch and function
- calls. Ticket: #4405
-
-2012-12-16 Daniel Marjamäki
-
- * test/testtokenize.cpp: AST: Added some tests to ensure operator
- precedence is handled properly
-
-2012-12-16 Daniel Marjamäki
-
- * lib/token.cpp, lib/tokenlist.cpp, test/testtokenize.cpp: AST:
- generate tree from bottom and upwards
-
-2012-12-16 Daniel Marjamäki
-
- * lib/token.cpp, lib/token.h, lib/tokenlist.cpp,
- test/testtokenize.cpp: AST: Handle function calls
-
-2012-12-16 Daniel Marjamäki
-
- * lib/token.cpp, lib/tokenlist.cpp, test/testtokenize.cpp: AST:
- Improved handling of unary operators
-
-2012-12-16 Robert Reif
-
- * lib/symboldatabase.cpp, test/testclass.cpp: Fixed #4404 (Forward
- declared class cause false style warning about missing constructor)
-
-2012-12-15 Daniel Marjamäki
-
- * lib/token.cpp, lib/token.h, lib/tokenlist.cpp, lib/tokenlist.h,
- test/testtokenize.cpp: AST: Simple AST. Not used in the clients.
- Only part of the testing for now.
-
-2012-12-15 XhmikosR