diff --git a/.clang-tidy b/.clang-tidy index ea453a81ee9..62047bd3966 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -48,7 +48,6 @@ Checks: > -modernize-replace-auto-ptr, -modernize-return-braced-init-list, -modernize-type-traits, - -modernize-use-auto, -modernize-use-designated-initializers, -modernize-use-nodiscard, -modernize-use-trailing-return-type, @@ -71,7 +70,8 @@ Checks: > -readability-suspicious-call-argument, -readability-uppercase-literal-suffix WarningsAsErrors: '*' -HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h' +HeaderFilterRegex: '(cli|gui|frontend|lib|oss-fuzz|test|triage)\/[a-z_]+\.h' +ExcludeHeaderFilterRegex: 'ui_.*.h' CheckOptions: - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic value: '1' diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index 4c86e9e13da..93a77d70c33 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -19,11 +20,13 @@ defaults: shell: cmd jobs: + # TODO: add CMake build build_cygwin: strategy: matrix: - os: [windows-2022] - arch: [x64] + # only use the latest windows-* as the installed toolchain is identical + os: [windows-2025] + platform: [x86_64] include: - platform: 'x86_64' packages: | @@ -35,17 +38,19 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Cygwin uses: cygwin/cygwin-install-action@master with: - platform: ${{ matrix.arch }} + 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 -j2 check + C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j%NUMBER_OF_PROCESSORS% check - name: Extra test for misra run: | diff --git a/.github/workflows/CI-mingw.yml b/.github/workflows/CI-mingw.yml index 88c3b73f042..a8c27b17224 100644 --- a/.github/workflows/CI-mingw.yml +++ b/.github/workflows/CI-mingw.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -19,26 +20,33 @@ defaults: shell: msys2 {0} jobs: + # TODO: add CMake build build_mingw: strategy: matrix: - # the MinGW installation in windows-2019 is supposed to be 8.1 but it is 12.2 - # the MinGW installation in windows-2022 is not including all necessary packages by default, so just use the older image instead - package versions are he same - os: [windows-2019] + # 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@v4 + 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 @@ -50,7 +58,7 @@ jobs: run: | export PATH="/mingw64/lib/ccache/bin:$PATH" # set RDYNAMIC to work around broken MinGW detection - make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 cppcheck + make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) cppcheck env: LDFLAGS: -fuse-ld=lld # use lld for faster linking @@ -58,7 +66,7 @@ jobs: run: | export PATH="/mingw64/lib/ccache/bin:$PATH" # set RDYNAMIC to work around broken MinGW detection - make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 testrunner + make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) testrunner env: LDFLAGS: -fuse-ld=lld # use lld for faster linking @@ -66,6 +74,6 @@ jobs: run: | export PATH="/mingw64/lib/ccache/bin:$PATH" # set RDYNAMIC to work around broken MinGW detection - make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 check + make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) check env: LDFLAGS: -fuse-ld=lld # use lld for faster linking diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index 43494965b3b..f8a74b4d8f7 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -14,19 +15,18 @@ on: permissions: contents: read -env: - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true - jobs: build_cmake: strategy: matrix: - image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:24.04"] + image: ["ubuntu:24.04", "ubuntu:24.10"] include: - build_gui: false - image: "ubuntu:24.04" build_gui: true + - image: "ubuntu:24.10" + build_gui: true fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 @@ -40,13 +40,9 @@ jobs: image: ${{ matrix.image }} steps: - # we need to stay at v3 for now because Node 20 does not support the older distros - # /__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node) - - uses: actions/checkout@v3 - if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04' - - uses: actions/checkout@v4 - if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04' + with: + persist-credentials: false - name: Install missing software on ubuntu if: contains(matrix.image, 'ubuntu') @@ -59,36 +55,15 @@ jobs: run: | apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev - # needs to be called after the package installation since - # - it doesn't call "apt-get update" - # - # needs to be to fixated on 1.2.11 so it works with older images - see https://github.com/hendrikmuhs/ccache-action/issues/178. - # using the older version will cause a two minute hang in its post-run step. - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2.11 - if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04' - with: - key: ${{ github.workflow }}-${{ matrix.image }} - # needs to be called after the package installation since # - it doesn't call "apt-get update" - name: ccache uses: hendrikmuhs/ccache-action@v1.2 - if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04' with: key: ${{ github.workflow }}-${{ matrix.image }} - # tests require CMake 3.9 - ccache available - - name: CMake build (no tests) - if: matrix.image == 'ubuntu:16.04' - run: | - mkdir cmake.output - cd cmake.output - cmake -G "Unix Makefiles" -DHAVE_RULES=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. - cmake --build . -- -j$(nproc) - - name: CMake build - if: ${{ !matrix.build_gui && matrix.image != 'ubuntu:16.04' }} + if: ${{ !matrix.build_gui }} run: | mkdir cmake.output cd cmake.output @@ -98,11 +73,10 @@ jobs: - name: CMake build (with GUI) if: matrix.build_gui run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache cmake --build cmake.output -- -j$(nproc) - name: Run CMake test - if: matrix.image != 'ubuntu:16.04' run: | cmake --build cmake.output --target check -- -j$(nproc) @@ -110,7 +84,7 @@ jobs: strategy: matrix: - image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:24.04"] + image: ["ubuntu:24.04", "ubuntu:24.10"] fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 @@ -119,13 +93,9 @@ jobs: image: ${{ matrix.image }} steps: - # we need to stay at v3 for now because Node 20 does not support the older distros - # /__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node) - - uses: actions/checkout@v3 - if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04' - - uses: actions/checkout@v4 - if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04' + with: + persist-credentials: false - name: Install missing software on ubuntu if: contains(matrix.image, 'ubuntu') @@ -133,22 +103,10 @@ jobs: apt-get update apt-get install -y g++ make python3 libxml2-utils libpcre3-dev - # needs to be called after the package installation since - # - it doesn't call "apt-get update" - # - # needs to be to fixated on 1.2.11 so it works with older images - see https://github.com/hendrikmuhs/ccache-action/issues/178. - # using the older version will cause a two minute hang in its post-run step. - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2.11 - if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04' - with: - key: ${{ github.workflow }}-${{ matrix.image }} - # needs to be called after the package installation since # - it doesn't call "apt-get update" - name: ccache uses: hendrikmuhs/ccache-action@v1.2 - if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04' with: key: ${{ github.workflow }}-${{ matrix.image }} @@ -169,7 +127,7 @@ jobs: # requires python3 - name: Run extra tests run: | - tools/generate_and_run_more_tests.sh + test/scripts/generate_and_run_more_tests.sh # requires which - name: Validate @@ -180,10 +138,3 @@ jobs: run: | ./cppcheck --addon=threadsafety addons/test/threadsafety ./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety - - - name: Generate Qt help file on ubuntu 18.04 - if: false # matrix.os == 'ubuntu-18.04' - run: | - pushd gui/help - qcollectiongenerator online-help.qhcp -o online-help.qhc - diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index a6c279bc7b8..9b720b95b4a 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -19,11 +20,7 @@ jobs: strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12] - include: - - use_qt6: On - - os: ubuntu-20.04 - use_qt6: Off + os: [ubuntu-22.04, macos-13, macos-15] fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} @@ -34,6 +31,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -41,18 +40,13 @@ jobs: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} - name: Install missing software on ubuntu - if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off' - run: | - sudo apt-get update - sudo apt-get install libxml2-utils libtinyxml2-dev qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser - - - name: Install missing software on ubuntu - if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On' + 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 libxml2-utils libtinyxml2-dev qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev + 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 @@ -64,13 +58,13 @@ jobs: - name: CMake build on ubuntu (with GUI / system tinyxml2) if: contains(matrix.os, 'ubuntu') run: | - cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=${{ matrix.use_qt6 }} -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache cmake --build cmake.output.tinyxml2 -- -j$(nproc) - name: CMake build on macos (with GUI / system tinyxml2) if: contains(matrix.os, 'macos') run: | - cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 + cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 cmake --build cmake.output.tinyxml2 -- -j$(nproc) - name: Run CMake test (system tinyxml2) @@ -81,11 +75,7 @@ jobs: strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12] - include: - - use_qt6: On - - os: ubuntu-20.04 - use_qt6: Off + os: [ubuntu-22.04, macos-13, macos-15] fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} @@ -96,18 +86,14 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} - - name: Install missing software on ubuntu - if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off' - run: | - sudo apt-get update - sudo apt-get install libxml2-utils qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser - # TODO: move latest compiler to separate step # TODO: bail out on warnings with latest GCC - name: Set up GCC @@ -123,12 +109,13 @@ jobs: echo "CXX=g++-13" >> $GITHUB_ENV - name: Install missing software on ubuntu - if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On' + 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 libxml2-utils qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev + 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 @@ -137,16 +124,18 @@ jobs: # pcre was removed from runner images in November 2022 brew install coreutils qt@6 pcre - - name: CMake build on ubuntu (with GUI) + - name: Run CMake on ubuntu (with GUI) if: contains(matrix.os, 'ubuntu') run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=${{ matrix.use_qt6 }} -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - cmake --build cmake.output -- -j$(nproc) + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install - - name: CMake build on macos (with GUI) + - name: Run CMake on macos (with GUI) if: contains(matrix.os, 'macos') run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 + + - name: Run CMake build + run: | cmake --build cmake.output -- -j$(nproc) - name: Run CMake test @@ -158,17 +147,23 @@ jobs: pushd cmake.output ctest --output-on-failure -j$(nproc) + - name: Run CMake install + run: | + cmake --build cmake.output --target install + build_uchar: strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12] + os: [ubuntu-22.04, macos-13, macos-15] fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -194,13 +189,15 @@ jobs: strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12] + os: [ubuntu-22.04, macos-13, macos-15] fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -226,13 +223,15 @@ jobs: strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12] + os: [ubuntu-22.04, macos-13, macos-15] fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false # coreutils contains "g++" (default is "c++") and "nproc" - name: Install missing software on macos @@ -244,105 +243,85 @@ jobs: run: | ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG - build_qmake: + build_cmake_boost: strategy: matrix: - # no longer build with qmake on MacOS as brew might lack pre-built Qt5 packages causing the step to run for hours - os: [ubuntu-20.04, ubuntu-22.04] + os: [macos-13, 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@v4 + with: + persist-credentials: false - - name: Install missing software on ubuntu - if: contains(matrix.os, 'ubuntu') + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + + - name: Run CMake on macOS (force Boost) run: | - sudo apt-get update - sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser + # 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 -G "Unix Makefiles" -DUSE_BOOST=On; then + exit 1 + else + exit 0 + fi # coreutils contains "nproc" - - name: Install missing software on macos - if: contains(matrix.os, 'macos') + - name: Install missing software on macOS run: | - brew install coreutils qt@5 - # expose qmake - brew link qt@5 --force + brew install coreutils boost - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + - name: Run CMake on macOS (force Boost) + run: | + cmake -S . -B cmake.output.boost-force -G "Unix Makefiles" -DUSE_BOOST=On - - name: Build GUI + - name: Run CMake on macOS (no Boost) run: | - export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - pushd gui - qmake CONFIG+=debug CONFIG+=ccache HAVE_QCHART=yes - make -j$(nproc) + # make sure Boost is not used when disabled even though it is available + cmake -S . -B cmake.output.boost-no -G "Unix Makefiles" -DUSE_BOOST=Off + if grep -q '\-DHAVE_BOOST' ./cmake.output.boost-no/compile_commands.json; then + exit 1 + else + exit 0 + fi - # TODO: binaries are in a different location on macos - - name: Build and Run GUI tests - if: contains(matrix.os, 'ubuntu') + - name: Run CMake on macOS (with Boost) + run: | + cmake -S . -B cmake.output.boost -G "Unix Makefiles" -DBUILD_TESTS=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=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: | - export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - pushd gui/test/cppchecklibrarydata - qmake CONFIG+=debug CONFIG+=ccache - make -j$(nproc) - ./test-cppchecklibrarydata - popd - pushd gui/test/filelist - qmake CONFIG+=debug CONFIG+=ccache - make -j$(nproc) - ./test-filelist - popd - pushd gui/test/projectfile - qmake CONFIG+=debug CONFIG+=ccache - make -j$(nproc) - ./test-projectfile - popd - pushd gui/test/resultstree - qmake CONFIG+=debug CONFIG+=ccache - make -j$(nproc) - export QT_QPA_PLATFORM=offscreen - ./test-resultstree - popd - pushd gui/test/translationhandler - qmake CONFIG+=debug CONFIG+=ccache - make -j$(nproc) - # TODO: requires X session because of QApplication dependency in translationhandler.cpp - #./test-translationhandler - popd - pushd gui/test/xmlreportv2 - qmake CONFIG+=debug CONFIG+=ccache - make -j$(nproc) - ./test-xmlreportv2 - - - name: Generate Qt help file - run: | - pushd gui/help - qhelpgenerator online-help.qhcp -o online-help.qhc - - - name: Build triage - run: | - export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - pushd tools/triage - qmake CONFIG+=debug CONFIG+=ccache - make -j$(nproc) + cmake --build cmake.output.boost -- -j$(nproc) build: strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12] + os: [ubuntu-22.04, macos-13, macos-15] + include: + - xdist_n: auto + # FIXME: test_color_tty fails with xdist + - os: macos-13 + xdist_n: '1' fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -366,15 +345,30 @@ jobs: if: contains(matrix.os, 'macos') run: | # pcre was removed from runner images in November 2022 - brew install coreutils python3 pcre gnu-sed + brew install coreutils pcre gnu-sed - - name: Install missing Python packages + - name: Install missing Python packages on ubuntu + if: contains(matrix.os, 'ubuntu') run: | python3 -m pip install pip --upgrade python3 -m pip install pytest 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" @@ -392,35 +386,48 @@ jobs: # requires "gnu-sed" installed on macos - name: Run extra tests run: | - tools/generate_and_run_more_tests.sh + test/scripts/generate_and_run_more_tests.sh - # do not use pushd in this step since we go below the working directory - name: Run test/cli run: | - cd test/cli - python3 -m pytest -Werror --strict-markers -vv - cd ../../.. + 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 + 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' - # do not use pushd in this step since we go below the working directory - name: Run test/cli (-j2) run: | - cd test/cli - python3 -m pytest -Werror --strict-markers -vv + python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli env: TEST_CPPCHECK_INJECT_J: 2 - # do not use pushd in this step since we go below the working directory - name: Run test/cli (--clang) if: false run: | - cd test/cli - python3 -m pytest -Werror --strict-markers -vv + 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: | @@ -442,25 +449,36 @@ jobs: 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 cmake.output.signal -G "Unix Makefiles" -DBUILD_TESTS=On - cmake --build cmake.output.signal --target test-signalhandler -- -j$(nproc) - cp cmake.output.signal/bin/test-s* . + cmake -S . -B build.cmake.signal -G "Unix Makefiles" -DBUILD_TESTS=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 cmake.output.signal -G "Unix Makefiles" -DBUILD_TESTS=On - cmake --build cmake.output.signal --target test-stacktrace -- -j$(nproc) - cp cmake.output.signal/bin/test-s* . + cmake -S . -B build.cmake.stack -G "Unix Makefiles" -DBUILD_TESTS=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 @@ -490,12 +508,40 @@ jobs: ../../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: 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 @@ -503,6 +549,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -525,7 +573,7 @@ jobs: - name: CMake run: | - cmake -S . -B cmake.output -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DUSE_MATCHCOMPILER=Verify -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On + cmake -S . -B cmake.output -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On - name: Generate dependencies run: | @@ -546,17 +594,19 @@ jobs: exit $ec fi - # self check simplecpp - ./cppcheck $selfcheck_options externals/simplecpp || ec=1 + # self check externals + ./cppcheck $selfcheck_options externals || ec=1 # self check lib/cli mkdir b1 - ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json cli || ec=1 + ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json frontend || ec=1 + ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json -Ifrontend cli || ec=1 ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json --enable=internal lib || ec=1 # check gui with qt settings mkdir b2 - ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b2 -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui || ec=1 + ./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b2 -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Ifrontend -Igui gui/*.cpp cmake.output/gui || ec=1 # self check test and tools - ./cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1 + ./cppcheck $selfcheck_options $cppcheck_options -Ifrontend -Icli test/*.cpp || ec=1 + ./cppcheck $selfcheck_options $cppcheck_options -Icli tools/dmake/*.cpp || ec=1 # triage ./cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage || ec=1 exit $ec diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml index 7a84a43b8bd..3cf7d66a8fc 100644 --- a/.github/workflows/CI-windows.yml +++ b/.github/workflows/CI-windows.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -25,14 +26,16 @@ jobs: build_qt: strategy: matrix: - os: [windows-2019, windows-2022] - qt_ver: [5.15.2, 6.7.2] + os: [windows-2022, windows-2025] + qt_ver: [6.9.1] fail-fast: false runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Visual Studio environment uses: ilammy/msvc-dev-cmd@v1 @@ -40,40 +43,40 @@ jobs: arch: x64 - name: Install Qt ${{ matrix.qt_ver }} - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ matrix.qt_ver }} modules: 'qtcharts' + setup-python: 'false' cache: true + aqtversion: '==3.1.*' # TODO: remove when aqtinstall 3.2.2 is available - - name: Build GUI release (qmake) - if: startsWith(matrix.qt_ver, '5') + - name: Run CMake run: | - cd gui || exit /b !errorlevel! - qmake HAVE_QCHART=yes || exit /b !errorlevel! - nmake release || exit /b !errorlevel! - env: - CL: /MP + rem TODO: enable rules? + rem specify Release build so matchcompiler is used + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DBUILD_ONLINE_HELP=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install || exit /b !errorlevel! - - name: Deploy GUI - if: startsWith(matrix.qt_ver, '5') + - name: Build GUI release run: | - windeployqt Build\gui || exit /b !errorlevel! - del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel! - del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel! + cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel! - - name: Build GUI release (CMake) - if: startsWith(matrix.qt_ver, '6') + - name: Deploy GUI run: | - cmake -S . -B build -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On || exit /b !errorlevel! - cmake --build build --target cppcheck-gui || exit /b !errorlevel! + 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! - # TODO: deploy with CMake/Qt6 + # TODO: run GUI tests + + - name: Run CMake install + run: | + cmake --build build --target install build: strategy: matrix: - os: [windows-2019, windows-2022] + os: [windows-2022, windows-2025] config: [debug, release] fail-fast: false @@ -85,12 +88,14 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - - name: Set up Python 3.12 + - name: Set up Python 3.13 if: matrix.config == 'release' uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.13' check-latest: true - name: Set up Visual Studio environment @@ -116,9 +121,11 @@ jobs: - 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! - cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off || exit /b !errorlevel! + git apply --ignore-space-change ..\externals\pcre.patch || exit /b !errorlevel! + cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5 || exit /b !errorlevel! nmake || exit /b !errorlevel! copy pcre.h ..\externals || exit /b !errorlevel! copy pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel! @@ -132,18 +139,18 @@ jobs: 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: Run CMake - if: false # TODO: enable - run: | - cmake -S . -B build -DBUILD_TESTS=On || exit /b !errorlevel! + # TODO: build with CMake - 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' @@ -154,6 +161,8 @@ jobs: 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' @@ -170,14 +179,12 @@ jobs: - name: Run test/cli if: matrix.config == 'release' run: | - cd test/cli || exit /b !errorlevel! - python -m pytest -Werror --strict-markers -vv || exit /b !errorlevel! + python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel! - name: Run test/cli (-j2) if: matrix.config == 'release' run: | - cd test/cli || exit /b !errorlevel! - python -m pytest -Werror --strict-markers -vv || exit /b !errorlevel! + python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel! env: TEST_CPPCHECK_INJECT_J: 2 @@ -185,14 +192,32 @@ jobs: - name: Run test/cli (--clang) if: false # matrix.config == 'release' run: | - cd test/cli || exit /b !errorlevel! - python -m pytest -Werror --strict-markers -vv || exit /b !errorlevel! + 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 -DBUILD_TESTS=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! @@ -220,9 +245,29 @@ jobs: ..\..\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/asan.yml b/.github/workflows/asan.yml index 1f92b36a6f2..f2c4f2cdd1b 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -20,43 +21,46 @@ jobs: runs-on: ubuntu-22.04 env: - QT_VERSION: 6.7.2 + QT_VERSION: 6.9.1 ASAN_OPTIONS: detect_stack_use_after_return=1 # TODO: figure out why there are cache misses with PCH enabled CCACHE_SLOPPINESS: pch_defines,time_macros steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.13' check-latest: true - name: Install missing software on ubuntu run: | sudo apt-get update sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils + sudo apt-get install -y libcups2-dev # required for Qt6PrintSupport in CMake since Qt 6.7.3 - name: Install clang run: | sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14 wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 19 + sudo ./llvm.sh 20 - name: Install Qt ${{ env.QT_VERSION }} - if: false - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} modules: 'qtcharts' + setup-python: 'false' cache: true - name: Install missing Python packages @@ -64,15 +68,16 @@ jobs: python3 -m pip install pip --upgrade python3 -m pip install pytest python3 -m pip install pytest-timeout + python3 -m pip install pytest-xdist python3 -m pip install psutil # TODO: disable all warnings - name: CMake run: | - cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=Off -DUSE_QT6=On -DWITH_QCHART=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache env: - CC: clang-19 - CXX: clang++-19 + CC: clang-20 + CXX: clang++-20 - name: Build cppcheck run: | @@ -82,6 +87,10 @@ jobs: 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 @@ -89,23 +98,19 @@ jobs: run: | cmake --build cmake.output --target checkcfg -- -j $(nproc) - # TODO: we should use CTest instead to parallelize tests but the start-up overhead will slow things down - name: Run CTest - if: false run: | ctest --test-dir cmake.output --output-on-failure -j$(nproc) - name: Run test/cli run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli - name: Run test/cli (-j2) run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + 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 @@ -113,11 +118,17 @@ jobs: if: false run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli env: TEST_CPPCHECK_INJECT_CLANG: clang + - name: Run test/cli (--cppcheck-build-dir) + run: | + pwd=$(pwd) + TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli + env: + TEST_CPPCHECK_INJECT_BUILDDIR: injected + - name: Generate dependencies if: false run: | @@ -130,13 +141,15 @@ jobs: - name: Self check if: false run: | - selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5_summary -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive" + selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive" cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2" ec=0 - ./cmake.output/bin/cppcheck $selfcheck_options externals/simplecpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options externals || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json frontend || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json -Ifrontend cli || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json --enable=internal lib || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Ifrontend -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli -Ifrontend test/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli tools/dmake/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 exit $ec diff --git a/.github/workflows/buildman.yml b/.github/workflows/buildman.yml index 91bfa4c5e0d..b0b399dd851 100644 --- a/.github/workflows/buildman.yml +++ b/.github/workflows/buildman.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -16,22 +17,24 @@ permissions: jobs: convert_via_pandoc: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - run: | mkdir output - - uses: docker://pandoc/latex:2.9 + - uses: docker://pandoc/latex:3.6.3 with: args: --output=output/manual.html man/manual.md - - uses: docker://pandoc/latex:2.9 + - uses: docker://pandoc/latex:3.6.3 with: args: --output=output/manual.pdf man/manual.md - - uses: docker://pandoc/latex:2.9 + - uses: docker://pandoc/latex:3.6.3 with: args: --output=output/manual-premium.pdf man/manual-premium.md @@ -44,6 +47,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Install missing software on ubuntu run: | diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index a957f8408b7..e9c486cc4f4 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -7,9 +7,13 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: + schedule: + - cron: '0 0 * * 0' + workflow_dispatch: permissions: contents: read @@ -20,54 +24,70 @@ jobs: runs-on: ubuntu-22.04 env: - QT_VERSION: 6.7.2 + QT_VERSION: 6.9.1 steps: - uses: actions/checkout@v4 + 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 libffi7 # work around missing dependency for Qt install step + 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 19 - sudo apt-get install -y clang-tidy-19 + sudo ./llvm.sh 20 + sudo apt-get install -y clang-tidy-20 - name: Install Qt ${{ env.QT_VERSION }} - uses: jurplel/install-qt-action@v3 + 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-19 --verify-config + clang-tidy-20 --verify-config - name: Prepare CMake run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off -DWARNINGS_ARE_ERRORS=On env: - CC: clang-19 - CXX: clang++-19 + CC: clang-20 + CXX: clang++-20 - 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 sources exist - make -C cmake.output autogen - 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@v4 + 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 index db578d0b3e6..185ebe139c6 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -7,18 +7,20 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: permissions: contents: read - security-events: write jobs: analyze: name: Analyze runs-on: ubuntu-22.04 + permissions: + security-events: write strategy: fail-fast: false @@ -32,25 +34,19 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + persist-credentials: false - - name: Install missing software on ubuntu - run: | - sudo apt-get update - sudo apt-get install libxml2-utils - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - setup-python-dependencies: false - - run: | + - name: Build cppcheck + if: matrix.language == 'cpp' + run: | make -j$(nproc) HAVE_RULES=yes cppcheck - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index dee18946c06..3c0c8e1d1df 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -18,11 +19,11 @@ jobs: build: runs-on: ubuntu-22.04 - # FIXME: disabled because the tokenless upload suddenly started to permanently fail - if: false # ${{ github.repository_owner == 'danmar' }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -61,9 +62,9 @@ jobs: name: Coverage results path: coverage_report - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: - # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + token: ${{ secrets.CODECOV_TOKEN }} # file: ./coverage.xml # optional flags: unittests # optional name: ${{ github.repository }} # optional diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 148fc15462d..3c07b61d7c7 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -15,6 +15,8 @@ jobs: if: ${{ github.repository_owner == 'danmar' }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Install missing software on ubuntu run: | sudo apt-get update diff --git a/.github/workflows/cppcheck-premium.yml b/.github/workflows/cppcheck-premium.yml index 5f5a97e0863..87aa920193e 100644 --- a/.github/workflows/cppcheck-premium.yml +++ b/.github/workflows/cppcheck-premium.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -17,35 +18,65 @@ on: permissions: contents: read + security-events: write jobs: build: - runs-on: ubuntu-22.04 # run on the latest image only + runs-on: ubuntu-24.04 # run on the latest image only steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - - name: Download cppcheckpremium + - name: Download cppcheckpremium release + if: false run: | premium_version=${{ inputs.premium_version }} if [ -z $premium_version ]; then - premium_version=devdrop-20240815 - wget https://files.cppchecksolutions.com/devdrop/cppcheckpremium-$premium_version-amd64.tar.gz -O cppcheckpremium.tar.gz + premium_version=24.11.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-22.04/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 fi - tar xvzf cppcheckpremium.tar.gz + tar xzf cppcheckpremium.tar.gz mv cppcheckpremium-$premium_version cppcheckpremium + - name: Download cppcheckpremium devdrop + run: | + wget https://files.cppchecksolutions.com/devdrop/cppcheckpremium-devdrop-20250713-amd64.tar.gz -O cppcheckpremium.tar.gz + tar xzvf cppcheckpremium.tar.gz + mv cppcheckpremium-devdrop-20250713 cppcheckpremium + # Overwrite cppcheck binary + make -j$(nproc) CXXFLAGS=-O2 MATCHCOMPILER=yes + cp cppcheck cppcheckpremium/ + - name: Generate a license file run: | echo cppcheck > cppcheck.lic - echo 241231 >> cppcheck.lic + echo 251231 >> cppcheck.lic echo 80000 >> cppcheck.lic - echo 53b72a908d7aeeee >> cppcheck.lic + echo 4f8dc8e7c8bb288f >> cppcheck.lic echo path:lib >> cppcheck.lic - name: Check run: | cppcheckpremium/premiumaddon --check-loc-license cppcheck.lic > cppcheck-premium-loc - cppcheckpremium/cppcheck -j$(nproc) -D__GNUC__ -D__CPPCHECK__ --suppressions-list=cppcheckpremium-suppressions --platform=unix64 --enable=style --premium=misra-c++-2023 --premium=cert-c++-2016 --inline-suppr --error-exitcode=1 lib + cppcheckpremium/cppcheck --premium=safety-off -j$(nproc) -D__GNUC__ -D__CPPCHECK__ --suppressions-list=cppcheckpremium-suppressions --platform=unix64 --enable=style --premium=misra-c++-2023 --premium=cert-c++-2016 --inline-suppr lib --error-exitcode=0 --output-format=sarif 2> results.sarif + + - name: Cat results + run: | + #sed -i 's|"security-severity":.*||' results.sarif + cat results.sarif + + - uses: actions/upload-artifact@v4 + with: + name: results + path: results.sarif + + - name: Upload report + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: results.sarif + category: cppcheckpremium diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 5c7d519a55d..8ad9408a376 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -19,8 +20,13 @@ jobs: runs-on: ubuntu-22.04 + env: + UNCRUSTIFY_VERSION: 0.80.1 + steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Cache uncrustify uses: actions/cache@v4 @@ -28,17 +34,19 @@ jobs: with: path: | ~/uncrustify - key: ${{ runner.os }}-uncrustify + key: ${{ runner.os }}-uncrustify-${{ env.UNCRUSTIFY_VERSION }} - name: build uncrustify if: steps.cache-uncrustify.outputs.cache-hit != 'true' run: | - wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.tar.gz - tar xzvf uncrustify-0.72.0.tar.gz && cd uncrustify-uncrustify-0.72.0 + 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 - cd build && cp uncrustify ~/uncrustify/ + cp build/uncrustify ~/uncrustify/ - name: Uncrustify check run: | diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index 49d27809a89..65e5ca5f9f1 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -15,19 +15,36 @@ jobs: strategy: matrix: - image: ["fedora:latest"] # "opensuse/tumbleweed:latest" / "fedora:latest" / "debian:unstable" / "archlinux:latest" + # "opensuse/tumbleweed:latest" / "fedora:latest" / "debian:unstable" / "archlinux:latest" + include: + - os: ubuntu-22.04 + image: "fedora:latest" + stdlib: libstdc++ + clang_inc: '-isystem/usr/lib/clang/20/include' + # TODO: disable because it currently fails with "error: tried including but didn't find libc++'s header." + #- os: ubuntu-22.04 + # image: "fedora:latest" + # stdlib: libc++ + # clang_inc: '-isystem/usr/lib/clang/20/include' + - os: macos-13 + image: "" + stdlib: libc++ # no libstdc++ on macOS + mapping_file_opt: '-Xiwyu --mapping_file=$(realpath ./macos.imp)' + fail-fast: false - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.os }} if: ${{ github.repository_owner == 'danmar' }} container: image: ${{ matrix.image }} env: - QT_VERSION: 6.7.2 + QT_VERSION: 6.9.1 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Install missing software on debian/ubuntu if: contains(matrix.image, 'debian') @@ -60,34 +77,56 @@ jobs: dnf install -y cmake clang pcre-devel 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 - # fixes error during Qt installation - # /__w/cppcheck/Qt/6.7.0/gcc_64/bin/qmake: error while loading shared libraries: libgthread-2.0.so.0: cannot open shared object file: No such file or directory - zypper install -y libgthread-2_0-0 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 + ln -s 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 - name: Install Qt ${{ env.QT_VERSION }} - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} modules: 'qtcharts' + setup-python: 'false' 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: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On + # TODO: why does it build dmake in the next step? + cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.stdlib == 'libc++' }} env: CC: clang CXX: clang++ @@ -96,45 +135,74 @@ jobs: # /__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 sources exist - make -C cmake.output autogen # 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: | - PWD=$(pwd) - # -isystem/usr/lib/clang/17/include - iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments > iwyu.log + # TODO: remove -stdlib= - it should have been taken from the compilation database + iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -stdlib=${{ matrix.stdlib }} ${{ matrix.mapping_file_opt }} ${{ matrix.clang_inc }} > iwyu.log + + # TODO: run with all configurations + - name: test/cfg + if: matrix.stdlib == 'libstdc++' + run: | + # TODO: redirect to log + ./test/cfg/runtests.sh + env: + IWYU: include-what-you-use + IWYU_CLANG_INC: ${{ matrix.clang_inc }} - uses: actions/upload-artifact@v4 if: success() || failure() with: - name: Compilation Database + name: Compilation Database (include-what-you-use - ${{ matrix.os }} ${{ matrix.stdlib }}) path: ./cmake.output/compile_commands.json + - uses: actions/upload-artifact@v4 + if: ${{ contains(matrix.os, 'macos') && (success() || failure()) }} + with: + name: macOS Mappings + path: | + ./iwyu-mapgen-apple-libc.py + ./macos.imp + - uses: actions/upload-artifact@v4 if: success() || failure() with: - name: Logs (include-what-you-use) + 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 == 'danmar' }} env: - QT_VERSION: 6.7.2 + QT_VERSION: 6.9.1 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Install missing software run: | @@ -147,42 +215,56 @@ jobs: sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14 wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 19 - sudo apt-get install -y clang-tools-19 + sudo ./llvm.sh 20 + sudo apt-get install -y clang-tools-20 + + - name: Install libc++ + if: matrix.stdlib == 'libc++' + run: | + sudo apt-get install -y libc++-20-dev - name: Install Qt ${{ env.QT_VERSION }} - uses: jurplel/install-qt-action@v3 + 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: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On + # TODO: why does it build dmake in the next step? + cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.use_libcxx }} env: - CC: clang-19 - CXX: clang++-19 + CC: clang-20 + CXX: clang++-20 - 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 sources exist - make -C cmake.output autogen # 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-19 --print=changes --extra-arg=-w -p cmake.output > clang-include-cleaner.log 2>&1 + find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-20 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1 - uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: Compilation Database (clang-include-cleaner - ${{ matrix.stdlib }}) + path: ./cmake.output/compile_commands.json + + - uses: actions/upload-artifact@v4 + if: success() || failure() with: - name: Logs (clang-include-cleaner) + name: Logs (clang-include-cleaner - ${{ matrix.stdlib }}) path: ./*.log diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index ced557ae694..afc6643e268 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -21,40 +21,33 @@ jobs: build: - runs-on: windows-2022 + runs-on: windows-2025 if: ${{ github.repository_owner == 'danmar' }} env: # see https://www.pcre.org/original/changelog.txt PCRE_VERSION: 8.45 - QT_VERSION: 5.15.2 + QT_VERSION: 6.9.1 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Visual Studio environment uses: ilammy/msvc-dev-cmd@v1 - - name: Cache PCRE - id: cache-pcre - uses: actions/cache@v4 - with: - path: | - externals\pcre.h - externals\pcre64.lib - key: pcre-${{ env.PCRE_VERSION }}-bin-x64-win-release-job - - 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! - cmake . -G "Visual Studio 17 2022" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF || exit /b !errorlevel! + git apply --ignore-space-change ..\externals\pcre.patch || exit /b !errorlevel! + cmake . -G "Visual Studio 17 2022" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 || exit /b !errorlevel! msbuild -m PCRE.sln -p:Configuration=Release -p:Platform=x64 || exit /b !errorlevel! copy pcre.h ..\externals || exit /b !errorlevel! copy Release\pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel! @@ -62,75 +55,104 @@ jobs: # available modules: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-modules # available tools: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-tools - name: Install Qt ${{ env.QT_VERSION }} - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} modules: 'qtcharts' + setup-python: 'false' tools: 'tools_opensslv3_x64' - cache: true - - - name: Create .qm - run: | - cd gui || exit /b !errorlevel! - lupdate gui.pro -no-obsolete || exit /b !errorlevel! - lrelease gui.pro -removeidentical || exit /b !errorlevel! - - - name: Matchcompiler - run: python tools\matchcompiler.py --write-dir lib || exit /b !errorlevel! + aqtversion: '==3.1.*' # TODO: remove when aqtinstall 3.2.2 is available + # TODO: build with multiple threads - name: Build x64 release GUI run: | - cd gui || exit /b !errorlevel! - qmake HAVE_QCHART=yes || exit /b !errorlevel! - nmake release || exit /b !errorlevel! - env: - CL: /MP + :: TODO: enable rules? + :: specify Release build so matchcompiler is used + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On || exit /b !errorlevel! + cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel! + # TODO: package PDBs - name: Deploy app run: | - windeployqt Build\gui || exit /b !errorlevel! - del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel! - del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel! + 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@v4 + 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 # TODO: build with boost enabled - name: Build CLI x64 release configuration using MSBuild run: msbuild -m cppcheck.sln -t:cli -p:Configuration=Release-PCRE -p:Platform=x64 || exit /b !errorlevel! - - name: Compile misra.py executable + - uses: actions/upload-artifact@v4 + 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: | - move Build\gui win_installer\files || exit /b !errorlevel! - mkdir win_installer\files\addons || exit /b !errorlevel! - copy addons\*.* win_installer\files\addons || exit /b !errorlevel! + @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! - mkdir win_installer\files\cfg || exit /b !errorlevel! - copy cfg\*.cfg win_installer\files\cfg || exit /b !errorlevel! - :: "platforms" is a folder used by Qt as well so it already exists - :: mkdir win_installer\files\platforms || exit /b !errorlevel! - copy platforms\*.xml win_installer\files\platforms || 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! + :: 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 gui\*.qm win_installer\files\translations || 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@v4 + with: + name: collect + path: win_installer\files + - name: Build Installer run: | cd win_installer || exit /b !errorlevel! - REM Read ProductVersion + :: Read ProductVersion for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a - REM Remove double quotes + :: Remove double quotes set PRODUCTVER=%PRODUCTVER:"=% - echo ProductVersion="%PRODUCTVER%" || exit /b !errorlevel! + @echo ProductVersion="%PRODUCTVER%" || exit /b !errorlevel! msbuild -m cppcheck.wixproj -p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }} || exit /b !errorlevel! - uses: actions/upload-artifact@v4 @@ -138,28 +160,35 @@ jobs: name: installer path: win_installer/Build/ - - uses: actions/upload-artifact@v4 - with: - name: deploy - path: win_installer\files - - name: Clean up deploy run: | - del win_installer\files\addons\*.dll || 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\bearer || exit /b !errorlevel! + @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\printsupport || 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\libEGL.dll || exit /b !errorlevel! - del win_installer\files\libGLESv2.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\Qt5Svg.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@v4 diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml index 9c7b83f32e6..3394604d155 100644 --- a/.github/workflows/scriptcheck.yml +++ b/.github/workflows/scriptcheck.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -17,11 +18,12 @@ permissions: jobs: build: - # 'ubuntu-22.04' removes Python 3.5 and 3.6 so keep the previous LTS version - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -43,20 +45,22 @@ jobs: scriptcheck: needs: build - # 'ubuntu-22.04' removes Python 3.5 and 3.6 so keep the previous LTS version - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11', '3.12'] + python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13'] include: - - python-version: '3.12' + - python-version: '3.13' python-latest: true fail-fast: false steps: - uses: actions/checkout@v4 + with: + persist-credentials: false + # TODO: bailout on error - name: Restore Cppcheck uses: actions/cache@v4 with: @@ -83,9 +87,10 @@ jobs: python -m pip install pip --upgrade python -m pip install natsort python -m pip install pexpect - python -m pip install pylint + python -m pip install 'pylint<=3.3.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 @@ -100,7 +105,7 @@ jobs: if: matrix.python-latest run: | shopt -s globstar - pylint --jobs $(nproc) addons/**/*.py htmlreport/cppcheck-htmlreport htmlreport/**/*.py test/**/*.py tools/**/*.py + 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 @@ -127,32 +132,33 @@ jobs: - name: test matchcompiler run: | - python tools/test_matchcompiler.py + 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 addons/test + 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 addons/test + 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 - cd test/tools/htmlreport - ./check.sh - # Python 3.5 and 3.6 are excluded as they are not supported by setuptools-scm package for getting - # package version + test/tools/htmlreport/check.sh + - name: test htmlreport (pip) - if: matrix.python-version != '3.5' && matrix.python-version != '3.6' run: | python -m venv venv source venv/bin/activate @@ -160,41 +166,56 @@ jobs: pip install ./htmlreport/ which cppcheck-htmlreport PIP_PACKAGE_TEST=1 test/tools/htmlreport/test_htmlreport.py - cd test/tools/htmlreport - ./check.sh + # TODO: does not test the pip binary + test/tools/htmlreport/check.sh - name: test reduce run: | - python -m pytest -Werror --strict-markers -vv tools/reduce_test.py + 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 tools/donate_cpu_lib_test.py + 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 tools/donate_cpu_server_test.py + 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-12, windows-2022] + os: [ubuntu-22.04, macos-13, macos-15, windows-2025] fail-fast: false runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: run dmake run: | - make -j2 CXXFLAGS="-w" run-dmake + make -j3 CXXFLAGS="-w" run-dmake - name: check diff run: | diff --git a/.github/workflows/selfcheck.yml b/.github/workflows/selfcheck.yml index 99ff4ae167b..69aab78db07 100644 --- a/.github/workflows/selfcheck.yml +++ b/.github/workflows/selfcheck.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -20,15 +21,12 @@ jobs: runs-on: ubuntu-22.04 env: - QT_VERSION: 6.7.2 + QT_VERSION: 6.9.1 steps: - uses: actions/checkout@v4 - - - name: Install missing software - run: | - sudo apt-get update - sudo apt-get install libboost-container-dev + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -38,13 +36,18 @@ jobs: - name: Install missing software run: | sudo apt-get update - sudo apt-get install clang-14 valgrind + 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@v3 + 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 @@ -61,22 +64,23 @@ jobs: # unusedFunction - start - name: CMake run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=ON -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On - 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 auto-generated GUI files exist - make -C cmake.output autogen + # make sure the auto-generated GUI dependencies exist make -C cmake.output gui-build-deps # TODO: find a way to report unmatched suppressions without need to add information checks - name: Self check (unusedFunction) if: false # TODO: fails with preprocessorErrorDirective - see #10667 run: | - ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr + ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr env: DISABLE_VALUEFLOW: 1 UNUSEDFUNCTION_ONLY: 1 @@ -87,20 +91,21 @@ jobs: # unusedFunction notest - start - name: CMake (no test) run: | - cmake -S . -B cmake.output.notest -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On + cmake -S . -B cmake.output.notest -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DBUILD_TRIAGE=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On - name: Generate dependencies (no test) run: | - # make sure the precompiled headers exist - make -C cmake.output.notest lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx # 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 # TODO: find a way to report unmatched suppressions without need to add information checks - name: Self check (unusedFunction / no test) run: | - ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.notest/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr + ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.notest/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr env: DISABLE_VALUEFLOW: 1 UNUSEDFUNCTION_ONLY: 1 @@ -128,21 +133,22 @@ jobs: # unusedFunction notest nocli - start - name: CMake (no test / no cli) run: | - cmake -S . -B cmake.output.notest_nocli -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_CLI=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On + cmake -S . -B cmake.output.notest_nocli -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_CLI=Off -DBUILD_GUI=ON -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On - name: Generate dependencies (no test / no cli) run: | - # make sure the precompiled headers exist - make -C cmake.output.notest_nocli lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx # 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 # TODO: find a way to report unmatched suppressions without need to add information checks - name: Self check (unusedFunction / no test / no cli) if: false # TODO: the findings are currently too intrusive run: | - ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.notest_nocli/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr + ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --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 @@ -155,21 +161,22 @@ jobs: - name: CMake (corpus / no test) run: | - cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On + cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - name: Generate dependencies (corpus) run: | - # make sure the precompiled headers exist - make -C cmake.output.corpus lib/CMakeFiles/lib_objs.dir/cmake_pch.hxx.cxx # 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 # TODO: find a way to report unmatched suppressions without need to add information checks - name: Self check (unusedFunction / corpus / no test / callgrind) run: | # TODO: fix -rp so the suppressions actually work - valgrind --tool=callgrind ./cppcheck --template=selfcheck --error-exitcode=0 --library=cppcheck-lib --library=qt -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.corpus/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr 2>callgrind.log || (cat callgrind.log && false) + valgrind --tool=callgrind ./cppcheck --template=selfcheck --error-exitcode=0 --library=cppcheck-lib --library=qt -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction --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 diff --git a/.github/workflows/tsan.yml b/.github/workflows/tsan.yml index f06f38045ab..4347e5e1b98 100644 --- a/.github/workflows/tsan.yml +++ b/.github/workflows/tsan.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -20,43 +21,46 @@ jobs: runs-on: ubuntu-22.04 env: - QT_VERSION: 6.7.2 + QT_VERSION: 6.9.1 TSAN_OPTIONS: halt_on_error=1 # TODO: figure out why there are cache misses with PCH enabled CCACHE_SLOPPINESS: pch_defines,time_macros steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.13' check-latest: true - name: Install missing software on ubuntu run: | sudo apt-get update sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils + sudo apt-get install -y libcups2-dev # required for Qt6PrintSupport in CMake since Qt 6.7.3 - name: Install clang run: | sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14 wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 19 + sudo ./llvm.sh 20 - name: Install Qt ${{ env.QT_VERSION }} - if: false - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} modules: 'qtcharts' + setup-python: 'false' cache: true - name: Install missing Python packages @@ -64,14 +68,15 @@ jobs: python3 -m pip install pip --upgrade python3 -m pip install pytest python3 -m pip install pytest-timeout + python3 -m pip install pytest-xdist python3 -m pip install psutil - name: CMake run: | - cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=Off -DUSE_QT6=On -DWITH_QCHART=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=Off -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=Off -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache env: - CC: clang-19 - CXX: clang++-19 + CC: clang-20 + CXX: clang++-20 - name: Build cppcheck run: | @@ -81,6 +86,10 @@ jobs: 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 @@ -88,25 +97,22 @@ jobs: run: | cmake --build cmake.output --target checkcfg -- -j $(nproc) - # TODO: we should use CTest instead to parallelize tests but the start-up overhead will slow things down - name: Run CTest - if: false + if: false # TODO: test-filelist fails with data race in pthread_cond_destroy run: | ctest --test-dir cmake.output --output-on-failure -j$(nproc) - name: Run test/cli run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli env: TEST_CPPCHECK_INJECT_EXECUTOR: thread - name: Run test/cli (-j2) run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + 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 @@ -114,11 +120,17 @@ jobs: if: false run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli env: TEST_CPPCHECK_INJECT_CLANG: clang + - name: Run test/cli (--cppcheck-build-dir) + run: | + pwd=$(pwd) + TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli + env: + TEST_CPPCHECK_INJECT_BUILDDIR: injected + - name: Generate dependencies if: false run: | @@ -131,14 +143,16 @@ jobs: - name: Self check if: false run: | - selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5_summary -D__GNUC__ --error-exitcode=0 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive" + selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=0 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive" selfcheck_options="$selfcheck_options --executor=thread" cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2" ec=0 - ./cmake.output/bin/cppcheck $selfcheck_options externals/simplecpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options externals || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json frontend || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json -Ifrontend cli || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json --enable=internal lib || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Ifrontend -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli -Ifrontend test/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli tools/dmake/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 exit $ec diff --git a/.github/workflows/ubsan.yml b/.github/workflows/ubsan.yml index 107ab0970a4..11dc26a8ec3 100644 --- a/.github/workflows/ubsan.yml +++ b/.github/workflows/ubsan.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -20,42 +21,46 @@ jobs: runs-on: ubuntu-22.04 env: - QT_VERSION: 6.7.2 + QT_VERSION: 6.9.1 UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:report_error_type=1 # TODO: figure out why there are cache misses with PCH enabled CCACHE_SLOPPINESS: pch_defines,time_macros steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.13' check-latest: true - name: Install missing software on ubuntu run: | sudo apt-get update sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils + sudo apt-get install -y libcups2-dev # required for Qt6PrintSupport in CMake since Qt 6.7.3 - name: Install clang run: | sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14 wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 19 + sudo ./llvm.sh 20 - name: Install Qt ${{ env.QT_VERSION }} - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} modules: 'qtcharts' + setup-python: 'false' cache: true - name: Install missing Python packages @@ -63,15 +68,16 @@ jobs: python3 -m pip install pip --upgrade python3 -m pip install pytest python3 -m pip install pytest-timeout + python3 -m pip install pytest-xdist python3 -m pip install psutil # TODO: disable warnings - name: CMake run: | - cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache env: - CC: clang-19 - CXX: clang++-19 + CC: clang-20 + CXX: clang++-20 - name: Build cppcheck run: | @@ -81,6 +87,10 @@ jobs: 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 @@ -88,23 +98,19 @@ jobs: run: | cmake --build cmake.output --target checkcfg -- -j $(nproc) - # TODO: we should use CTest instead to parallelize tests but the start-up overhead will slow things down - name: Run CTest - if: false run: | ctest --test-dir cmake.output --output-on-failure -j$(nproc) - name: Run test/cli run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli - name: Run test/cli (-j2) run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + 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 @@ -112,11 +118,17 @@ jobs: if: false run: | pwd=$(pwd) - cd test/cli - TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv + 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 run: | # make sure auto-generated GUI files exist @@ -126,13 +138,15 @@ jobs: # TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError - name: Self check run: | - selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5_summary -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive" + selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude --exception-handling --debug-warnings --check-level=exhaustive" cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2" ec=0 - ./cmake.output/bin/cppcheck $selfcheck_options externals/simplecpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options externals || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json frontend || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json -Ifrontend cli || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json --enable=internal lib || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt --addon=naming.json -Icmake.output/gui -Ifrontend -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli -Ifrontend test/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli tools/dmake/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 exit $ec diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 70671db271a..7fd16382802 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'releases/**' + - '2.*' tags: - '2.*' pull_request: @@ -21,6 +22,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: ccache uses: hendrikmuhs/ccache-action@v1.2 diff --git a/.gitignore b/.gitignore index 48df3dad1ef..9a2c61ded12 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ tags tools/daca2*.html tools/errmsg tools/extracttests +.DS_Store # dump files generated by Cppcheck *.*.dump @@ -50,42 +51,13 @@ ipch/ *.pbxuser build/ -# GUI build folders -/gui/debug/ -/gui/release/ -/gui/temp/ -/triage/temp - # Other (generated) GUI files -/gui/*.qm -/gui/cppcheck-gui -/gui/cppcheck-gui.exe -/gui/gui.sln -/gui/gui.vcproj /gui/help/online-help.qch /gui/help/online-help.qhc -/gui/Makefile -/gui/Makefile.debug -/gui/Makefile.release -/gui/qrc_gui.cpp -/gui/test/Makefile -/gui/test/*/Makefile -/gui/test/*/*/Makefile -/gui/test/benchmark/simple/benchmark-simple -/gui/test/cppchecklibrarydata/qrc_resources.cpp -/gui/test/cppchecklibrarydata/test-cppchecklibrarydata -/gui/test/filelist/test-filelist -/gui/test/projectfile/test-projectfile -/gui/test/translationhandler/test-translationhandler -/gui/test/xmlreportv2/test-xmlreportv2 # Doxygen output folder doxyoutput/ -# qmake generated -htmlreport/.tox/ -htmlreport/MANIFEST - # Backup files and stuff from patches *.rej *~ @@ -120,12 +92,9 @@ stage /.run # clang tooling temporary files -.clangd/ -.cache/ -compile_commands.json - -# qmake -.qmake.stash +/.clangd/ +/.cache/ +/compile_commands.json #vs code /.vscode @@ -145,3 +114,16 @@ compile_commands.json # 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/.pylintrc b/.pylintrc index 03c7bddf103..9b14fa2d00e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -10,19 +10,13 @@ disable= unspecified-encoding, global-statement, protected-access, - redundant-u-string-prefix, broad-exception-raised, subprocess-popen-preexec-fn, - format-string-without-interpolation, - cell-var-from-loop, logging-not-lazy, unknown-option-value, - implicit-str-concat, unused-wildcard-import, - pointless-statement, wildcard-import, unused-argument, - deprecated-module, pointless-string-statement, arguments-renamed, duplicate-string-formatting-argument, @@ -38,11 +32,9 @@ disable= too-many-lines, trailing-newlines, missing-final-newline, - unnecessary-negation, use-implicit-booleaness-not-len, wrong-import-order, use-implicit-booleaness-not-comparison, - multiple-imports, consider-using-enumerate, unnecessary-lambda-assignment, consider-using-dict-items, @@ -52,29 +44,18 @@ disable= consider-using-with, too-many-statements, too-many-branches, - use-list-literal, - simplifiable-if-statement, too-many-locals, too-many-arguments, - no-else-return, too-few-public-methods, - consider-using-min-builtin, - comparison-with-itself, too-many-return-statements, - no-else-continue, - no-else-break, - inconsistent-return-statements, consider-using-in, too-many-nested-blocks, too-many-public-methods, - consider-using-sys-exit, - use-dict-literal, chained-comparison, too-many-instance-attributes, - consider-using-join, too-many-boolean-expressions, - useless-object-inheritance, - use-a-generator + use-a-generator, + too-many-positional-arguments [REPORTS] reports=no [TYPECHECK] diff --git a/.selfcheck_suppressions b/.selfcheck_suppressions index 03e54874475..6a00f33655f 100644 --- a/.selfcheck_suppressions +++ b/.selfcheck_suppressions @@ -16,13 +16,23 @@ functionStatic:*/ui_fileview.h valueFlowBailout valueFlowBailoutIncompleteVar autoNoType +# ticket 11631 +templateInstantiation:test/testutils.cpp naming-varname:externals/simplecpp/simplecpp.h naming-privateMemberVariable:externals/simplecpp/simplecpp.h -# these warnings need to be addressed upstream +valueFlowMaxIterations:externals/tinyxml2/tinyxml2.cpp + +# 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 \ No newline at end of file +naming-privateMemberVariable:externals/tinyxml2/tinyxml2.h +functionStatic:externals/tinyxml2/tinyxml2.cpp +invalidPrintfArgType_uint:externals/tinyxml2/tinyxml2.cpp +funcArgNamesDifferent:externals/tinyxml2/tinyxml2.cpp +nullPointerRedundantCheck:externals/tinyxml2/tinyxml2.cpp +knownConditionTrueFalse:externals/tinyxml2/tinyxml2.cpp +useStlAlgorithm:externals/simplecpp/simplecpp.cpp diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 46b471c0aff..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: cpp -dist: xenial - -compiler: - - gcc - - clang - -env: - global: - - ORIGINAL_CXXFLAGS="-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 -D_GLIBCXX_DEBUG -g" -# unfortunately we need this to stay within 50min timelimit given by travis. - - CXXFLAGS="${ORIGINAL_CXXFLAGS} -O2 -march=native -Wstrict-aliasing=2 -Werror=strict-aliasing" - - CPPCHECK=${TRAVIS_BUILD_DIR}/cppcheck - matrix: - - CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL" - - CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL" MAKEFLAGS="HAVE_RULES=yes" MATCHCOMPILER=yes VERIFY=1 - -before_install: -# install needed deps - - travis_retry sudo apt-get update -qq - - travis_retry sudo apt-get install -qq libxml2-utils libpcre3 gdb unzip wx-common xmlstarlet liblua5.3-dev libcurl3 libcairo2-dev libsigc++-2.0-dev tidy libopencv-dev - -matrix: -# do notify immediately about it when a job of a build fails. - fast_finish: true -# defined extra jobs that run besides what is configured in the build matrix - include: - -# check a lot of stuff that only needs to be checked in a single configuration - - name: "misc" - compiler: clang - script: - - make -j$(nproc) -s -# check if DESTDIR works TODO: actually execute this - - mkdir install_test - - echo $CXXFLAGS - - make -s DESTDIR=install_test FILESDIR=/usr/share/cppcheck install -# rm everything - - git clean -dfx -# check what happens if we want to install it to some other dir, - - echo $CXXFLAGS - - make -s MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck -j$(nproc) - - sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck install diff --git a/.uncrustify.cfg b/.uncrustify.cfg index 074811b05b7..81722ff7249 100644 --- a/.uncrustify.cfg +++ b/.uncrustify.cfg @@ -1,13 +1,4 @@ -# Uncrustify-0.72.0_f - -# -# General options -# - -# The type of line endings. -# -# Default: auto -newlines = auto # lf/crlf/cr/auto +# Uncrustify-0.80.1_f # The original size of tabs in the input. # @@ -19,274 +10,36 @@ input_tab_size = 4 # unsigned number # Default: 8 output_tab_size = 4 # unsigned number -# The ASCII value of the string escape char, usually 92 (\) or (Pawn) 94 (^). -# -# Default: 92 -string_escape_char = 92 # unsigned number - -# Alternate string escape char (usually only used for Pawn). -# Only works right before the quote char. -string_escape_char2 = 0 # unsigned number - -# Replace tab characters found in string literals with the escape sequence \t -# instead. -string_replace_tab_chars = false # true/false - -# Allow interpreting '>=' and '>>=' as part of a template in code like -# 'void f(list>=val);'. If true, 'assert(x<0 && y>=3)' will be broken. -# Improvements to template detection may make this option obsolete. -tok_split_gte = false # true/false - -# Disable formatting of NL_CONT ('\\n') ended lines (e.g. multiline macros) -disable_processing_nl_cont = false # true/false - -# Specify the marker used in comments to disable processing of part of the -# file. -# The comment should be used alone in one line. -# -# Default: *INDENT-OFF* -disable_processing_cmt = " *INDENT-OFF*" # string - -# Specify the marker used in comments to (re)enable processing in a file. -# The comment should be used alone in one line. -# -# Default: *INDENT-ON* -enable_processing_cmt = " *INDENT-ON*" # string - -# Enable parsing of digraphs. -enable_digraphs = false # true/false - -# Add or remove the UTF-8 BOM (recommend 'remove'). -utf8_bom = ignore # ignore/add/remove/force - -# If the file contains bytes with values between 128 and 255, but is not -# UTF-8, then output as UTF-8. -utf8_byte = false # true/false - -# Force the output encoding to UTF-8. -utf8_force = false # true/false - -# Add or remove space between 'do' and '{'. -sp_do_brace_open = ignore # ignore/add/remove/force - -# Add or remove space between '}' and 'while'. -sp_brace_close_while = ignore # ignore/add/remove/force - # Add or remove space between 'while' and '('. sp_while_paren_open = add # ignore/add/remove/force -# -# Spacing options -# - -# Add or remove space around non-assignment symbolic operators ('+', '/', '%', -# '<<', and so forth). -sp_arith = ignore # ignore/add/remove/force - -# Add or remove space around arithmetic operators '+' and '-'. -# -# Overrides sp_arith. -sp_arith_additive = ignore # ignore/add/remove/force - -# Add or remove space around assignment operator '=', '+=', etc. -sp_assign = ignore # ignore/add/remove/force - -# Add or remove space around '=' in C++11 lambda capture specifications. -# -# Overrides sp_assign. -sp_cpp_lambda_assign = ignore # ignore/add/remove/force - -# Add or remove space after the capture specification of a C++11 lambda when -# an argument list is present, as in '[] (int x){ ... }'. -sp_cpp_lambda_square_paren = ignore # ignore/add/remove/force - -# Add or remove space after the capture specification of a C++11 lambda with -# no argument list is present, as in '[] { ... }'. -sp_cpp_lambda_square_brace = ignore # ignore/add/remove/force - -# Add or remove space after the argument list of a C++11 lambda, as in -# '[](int x) { ... }'. -sp_cpp_lambda_paren_brace = ignore # ignore/add/remove/force - -# Add or remove space between a lambda body and its call operator of an -# immediately invoked lambda, as in '[]( ... ){ ... } ( ... )'. -sp_cpp_lambda_fparen = ignore # ignore/add/remove/force - -# Add or remove space around assignment operator '=' in a prototype. -# -# If set to ignore, use sp_assign. -sp_assign_default = ignore # ignore/add/remove/force - -# Add or remove space before assignment operator '=', '+=', etc. -# -# Overrides sp_assign. -sp_before_assign = ignore # ignore/add/remove/force - -# Add or remove space after assignment operator '=', '+=', etc. -# -# Overrides sp_assign. -sp_after_assign = ignore # ignore/add/remove/force - -# Add or remove space in 'NS_ENUM ('. -sp_enum_paren = ignore # ignore/add/remove/force - -# Add or remove space around assignment '=' in enum. -sp_enum_assign = ignore # ignore/add/remove/force - -# Add or remove space before assignment '=' in enum. -# -# Overrides sp_enum_assign. -sp_enum_before_assign = ignore # ignore/add/remove/force - -# Add or remove space after assignment '=' in enum. -# -# Overrides sp_enum_assign. -sp_enum_after_assign = ignore # ignore/add/remove/force - -# Add or remove space around assignment ':' in enum. -sp_enum_colon = ignore # ignore/add/remove/force - -# Add or remove space around preprocessor '##' concatenation operator. -# -# Default: add -sp_pp_concat = add # ignore/add/remove/force - -# Add or remove space after preprocessor '#' stringify operator. -# Also affects the '#@' charizing operator. -sp_pp_stringify = ignore # ignore/add/remove/force - -# Add or remove space before preprocessor '#' stringify operator -# as in '#define x(y) L#y'. -sp_before_pp_stringify = ignore # ignore/add/remove/force - # Add or remove space around boolean operators '&&' and '||'. sp_bool = force # ignore/add/remove/force -# Add or remove space around compare operator '<', '>', '==', etc. -sp_compare = ignore # 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 back-to-back parentheses, i.e. ')(' vs. ') ('. -sp_cparen_oparen = ignore # ignore/add/remove/force - -# Whether to balance spaces inside nested parentheses. -sp_balance_nested_parens = false # true/false - # Add or remove space between ')' and '{'. sp_paren_brace = force # ignore/add/remove/force -# Add or remove space between nested braces, i.e. '{{' vs '{ {'. -sp_brace_brace = ignore # ignore/add/remove/force - -# Add or remove space before pointer star '*'. -sp_before_ptr_star = ignore # ignore/add/remove/force - -# Add or remove space before pointer star '*' that isn't followed by a -# variable name. If set to ignore, sp_before_ptr_star is used instead. -sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force - # Add or remove space between pointer stars '*'. sp_between_ptr_star = remove # ignore/add/remove/force -# Add or remove space after pointer star '*', if followed by a word. -# -# Overrides sp_type_func. -sp_after_ptr_star = ignore # ignore/add/remove/force - -# Add or remove space after pointer caret '^', if followed by a word. -sp_after_ptr_block_caret = ignore # ignore/add/remove/force - -# Add or remove space after pointer star '*', if followed by a qualifier. -sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force - -# Add or remove space after a pointer star '*', if followed by a function -# prototype or function definition. -# -# Overrides sp_after_ptr_star and sp_type_func. -sp_after_ptr_star_func = ignore # ignore/add/remove/force - -# Add or remove space after a pointer star '*', if followed by an open -# parenthesis, as in 'void* (*)(). -sp_ptr_star_paren = ignore # ignore/add/remove/force - -# Add or remove space before a pointer star '*', if followed by a function -# prototype or function definition. -sp_before_ptr_star_func = ignore # ignore/add/remove/force - -# Add or remove space before a reference sign '&'. -sp_before_byref = ignore # ignore/add/remove/force - -# Add or remove space before a reference sign '&' that isn't followed by a -# variable name. If set to ignore, sp_before_byref is used instead. -sp_before_unnamed_byref = ignore # ignore/add/remove/force - -# Add or remove space after reference sign '&', if followed by a word. -# -# Overrides sp_type_func. -sp_after_byref = ignore # ignore/add/remove/force - -# Add or remove space after a reference sign '&', if followed by a function -# prototype or function definition. -# -# Overrides sp_after_byref and sp_type_func. -sp_after_byref_func = ignore # ignore/add/remove/force - -# Add or remove space before a reference sign '&', if followed by a function -# prototype or function definition. -sp_before_byref_func = ignore # ignore/add/remove/force - -# Add or remove space between type and word. In cases where total removal of -# whitespace would be a syntax error, a value of 'remove' is treated the same -# as 'force'. -# -# This also affects some other instances of space following a type that are -# not covered by other options; for example, between the return type and -# parenthesis of a function type template argument, between the type and -# parenthesis of an array parameter, or between 'decltype(...)' and the -# following word. -# -# Default: force -sp_after_type = force # ignore/add/remove/force - -# Add or remove space between 'decltype(...)' and word. -# -# Overrides sp_after_type. -sp_after_decltype = ignore # ignore/add/remove/force - -# (D) Add or remove space before the parenthesis in the D constructs -# 'template Foo(' and 'class Foo('. -sp_before_template_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'template' and '<'. -# If set to ignore, sp_before_angle is used. -sp_template_angle = ignore # 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 inside '<>'. -sp_inside_angle_empty = ignore # ignore/add/remove/force - -# Add or remove space between '>' and ':'. -sp_angle_colon = ignore # 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 '()' as found in 'new List();'. -sp_angle_paren_empty = ignore # 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 @@ -307,67 +60,19 @@ 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. -# -# Overrides sp_inside_sparen. -sp_inside_sparen_open = ignore # ignore/add/remove/force - -# Add or remove space before ')' of control statements. -# -# Overrides sp_inside_sparen. -sp_inside_sparen_close = ignore # 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 -# (D) Add or remove space between 'invariant' and '('. -sp_invariant_paren = ignore # ignore/add/remove/force - -# (D) Add or remove space after the ')' in 'invariant (C) c'. -sp_after_invariant_paren = ignore # ignore/add/remove/force - -# Add or remove space before empty statement ';' on 'if', 'for' and 'while'. -sp_special_semi = ignore # ignore/add/remove/force - -# Add or remove space before ';'. -# -# Default: remove -sp_before_semi = remove # 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 before a semicolon of an empty part of a for statement. -sp_before_semi_for_empty = ignore # ignore/add/remove/force - -# Add or remove space after ';', except when followed by a comment. -# -# Default: add -sp_after_semi = add # ignore/add/remove/force - -# Add or remove space after ';' in non-empty 'for' statements. -# -# Default: force -sp_after_semi_for = force # 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 '[' (except '[]'). -sp_before_square = ignore # ignore/add/remove/force - -# Add or remove space before '[' for a variable definition. -# -# Default: remove -sp_before_vardef_square = remove # ignore/add/remove/force - -# Add or remove space before '[' for asm block. -sp_before_square_asm_block = ignore # ignore/add/remove/force - # Add or remove space before '[]'. sp_before_squares = remove # ignore/add/remove/force @@ -377,2752 +82,89 @@ 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 inside '[]'. -sp_inside_square_empty = ignore # ignore/add/remove/force - -# (OC) Add or remove space inside a non-empty Objective-C boxed array '@[' and -# ']'. If set to ignore, sp_inside_square is used. -sp_inside_square_oc_array = ignore # ignore/add/remove/force - -# Add or remove space after ',', i.e. 'a,b' vs. 'a, b'. -sp_after_comma = ignore # ignore/add/remove/force - -# Add or remove space before ','. -# -# Default: remove -sp_before_comma = remove # ignore/add/remove/force - -# (C#) Add or remove space between ',' and ']' in multidimensional array type -# like 'int[,,]'. -sp_after_mdatype_commas = ignore # ignore/add/remove/force - -# (C#) Add or remove space between '[' and ',' in multidimensional array type -# like 'int[,,]'. -sp_before_mdatype_commas = ignore # ignore/add/remove/force - -# (C#) Add or remove space between ',' in multidimensional array type -# like 'int[,,]'. -sp_between_mdatype_commas = ignore # ignore/add/remove/force - -# Add or remove space between an open parenthesis and comma, -# i.e. '(,' vs. '( ,'. -# -# Default: force -sp_paren_comma = force # ignore/add/remove/force - -# Add or remove space before the variadic '...' when preceded by a -# non-punctuator. -sp_before_ellipsis = ignore # ignore/add/remove/force - -# Add or remove space between a type and '...'. -sp_type_ellipsis = ignore # ignore/add/remove/force - -# (D) Add or remove space between a type and '?'. -sp_type_question = ignore # ignore/add/remove/force - -# Add or remove space between ')' and '...'. -sp_paren_ellipsis = ignore # ignore/add/remove/force - -# Add or remove space between ')' and a qualifier such as 'const'. -sp_paren_qualifier = ignore # ignore/add/remove/force - -# Add or remove space between ')' and 'noexcept'. -sp_paren_noexcept = ignore # 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 after class constructor ':'. -sp_after_constr_colon = ignore # ignore/add/remove/force - -# Add or remove space before class constructor ':'. -sp_before_constr_colon = ignore # ignore/add/remove/force - -# Add or remove space before case ':'. -# -# Default: remove -sp_before_case_colon = remove # ignore/add/remove/force - -# Add or remove space between 'operator' and operator sign. -sp_after_operator = ignore # ignore/add/remove/force - -# Add or remove space between the operator symbol and the open parenthesis, as -# in 'operator ++('. -sp_after_operator_sym = ignore # ignore/add/remove/force - -# Overrides sp_after_operator_sym when the operator has no arguments, as in -# 'operator *()'. -sp_after_operator_sym_empty = ignore # ignore/add/remove/force - -# Add or remove space after C/D cast, i.e. 'cast(int)a' vs. 'cast(int) a' or -# '(int)a' vs. '(int) a'. -sp_after_cast = ignore # ignore/add/remove/force - -# Add or remove spaces inside cast parentheses. -sp_inside_paren_cast = ignore # ignore/add/remove/force - -# Add or remove space between the type and open parenthesis in a C++ cast, -# i.e. 'int(exp)' vs. 'int (exp)'. -sp_cpp_cast_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'sizeof' and '('. -sp_sizeof_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'sizeof' and '...'. -sp_sizeof_ellipsis = ignore # ignore/add/remove/force - -# Add or remove space between 'sizeof...' and '('. -sp_sizeof_ellipsis_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'decltype' and '('. -sp_decltype_paren = ignore # ignore/add/remove/force - -# (Pawn) Add or remove space after the tag keyword. -sp_after_tag = ignore # ignore/add/remove/force - -# Add or remove space inside enum '{' and '}'. -sp_inside_braces_enum = ignore # ignore/add/remove/force - -# Add or remove space inside struct/union '{' and '}'. -sp_inside_braces_struct = ignore # ignore/add/remove/force - -# (OC) Add or remove space inside Objective-C boxed dictionary '{' and '}' -sp_inside_braces_oc_dict = ignore # ignore/add/remove/force - -# Add or remove space after open brace in an unnamed temporary -# direct-list-initialization. -sp_after_type_brace_init_lst_open = ignore # ignore/add/remove/force - -# Add or remove space before close brace in an unnamed temporary -# direct-list-initialization. -sp_before_type_brace_init_lst_close = ignore # ignore/add/remove/force - -# Add or remove space inside an unnamed temporary direct-list-initialization. -sp_inside_type_brace_init_lst = ignore # ignore/add/remove/force - -# Add or remove space inside '{' and '}'. -sp_inside_braces = ignore # ignore/add/remove/force - # Add or remove space inside '{}'. sp_inside_braces_empty = remove # ignore/add/remove/force -# Add or remove space around trailing return operator '->'. -sp_trailing_return = ignore # ignore/add/remove/force - -# Add or remove space between return type and function name. A minimum of 1 -# is forced except for pointer return types. -sp_type_func = ignore # ignore/add/remove/force - -# Add or remove space between type and open brace of an unnamed temporary -# direct-list-initialization. -sp_type_brace_init_lst = ignore # ignore/add/remove/force - -# Add or remove space between function name and '(' on function declaration. -sp_func_proto_paren = ignore # ignore/add/remove/force - -# Add or remove space between function name and '()' on function declaration -# without parameters. -sp_func_proto_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space between function name and '(' with a typedef specifier. -sp_func_type_paren = ignore # ignore/add/remove/force - -# Add or remove space between alias name and '(' of a non-pointer function type typedef. -sp_func_def_paren = ignore # ignore/add/remove/force - -# Add or remove space between function name and '()' on function definition -# without parameters. -sp_func_def_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space inside empty function '()'. -# Overrides sp_after_angle unless use_sp_after_angle_always is set to true. -sp_inside_fparens = ignore # ignore/add/remove/force - -# Add or remove space inside function '(' and ')'. -sp_inside_fparen = ignore # ignore/add/remove/force - -# Add or remove space inside the first parentheses in a function type, as in -# 'void (*x)(...)'. -sp_inside_tparen = ignore # ignore/add/remove/force - -# Add or remove space between the ')' and '(' in a function type, as in -# 'void (*x)(...)'. -sp_after_tparen_close = ignore # ignore/add/remove/force - -# Add or remove space between ']' and '(' when part of a function call. -sp_square_fparen = ignore # ignore/add/remove/force - -# Add or remove space between ')' and '{' of function. -sp_fparen_brace = ignore # ignore/add/remove/force - -# Add or remove space between ')' and '{' of a function call in object -# initialization. -# -# Overrides sp_fparen_brace. -sp_fparen_brace_initializer = ignore # ignore/add/remove/force - -# (Java) Add or remove space between ')' and '{{' of double brace initializer. -sp_fparen_dbrace = ignore # ignore/add/remove/force - -# Add or remove space between function name and '(' on function calls. -sp_func_call_paren = ignore # ignore/add/remove/force - -# Add or remove space between function name and '()' on function calls without -# parameters. If set to ignore (the default), sp_func_call_paren is used. -sp_func_call_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space between the user function name and '(' on function -# calls. You need to set a keyword to be a user function in the config file, -# like: -# set func_call_user tr _ i18n -sp_func_call_user_paren = ignore # ignore/add/remove/force - -# Add or remove space inside user function '(' and ')'. -sp_func_call_user_inside_fparen = ignore # ignore/add/remove/force - -# Add or remove space between nested parentheses with user functions, -# i.e. '((' vs. '( ('. -sp_func_call_user_paren_paren = ignore # ignore/add/remove/force - -# Add or remove space between a constructor/destructor and the open -# parenthesis. -sp_func_class_paren = ignore # ignore/add/remove/force - -# Add or remove space between a constructor without parameters or destructor -# and '()'. -sp_func_class_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space between 'return' and '('. -sp_return_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'return' and '{'. -sp_return_brace = ignore # ignore/add/remove/force - -# Add or remove space between '__attribute__' and '('. -sp_attribute_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'defined' and '(' in '#if defined (FOO)'. -sp_defined_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'throw' and '(' in 'throw (something)'. -sp_throw_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'throw' and anything other than '(' as in -# '@throw [...];'. -sp_after_throw = ignore # ignore/add/remove/force - -# Add or remove space between 'catch' and '(' in 'catch (something) { }'. -# If set to ignore, sp_before_sparen is used. -sp_catch_paren = ignore # ignore/add/remove/force - -# (OC) Add or remove space between '@catch' and '(' -# in '@catch (something) { }'. If set to ignore, sp_catch_paren is used. -sp_oc_catch_paren = ignore # ignore/add/remove/force - -# (OC) Add or remove space before Objective-C protocol list -# as in '@protocol Protocol' or '@interface MyClass : NSObject'. -sp_before_oc_proto_list = ignore # ignore/add/remove/force - -# (OC) Add or remove space between class name and '(' -# in '@interface className(categoryName):BaseClass' -sp_oc_classname_paren = ignore # ignore/add/remove/force - -# (D) Add or remove space between 'version' and '(' -# in 'version (something) { }'. If set to ignore, sp_before_sparen is used. -sp_version_paren = ignore # ignore/add/remove/force - -# (D) Add or remove space between 'scope' and '(' -# in 'scope (something) { }'. If set to ignore, sp_before_sparen is used. -sp_scope_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'super' and '(' in 'super (something)'. -# -# Default: remove -sp_super_paren = remove # ignore/add/remove/force - -# Add or remove space between 'this' and '(' in 'this (something)'. -# -# Default: remove -sp_this_paren = remove # ignore/add/remove/force - -# Add or remove space between a macro name and its definition. -sp_macro = ignore # ignore/add/remove/force - -# Add or remove space between a macro function ')' and its definition. -sp_macro_func = ignore # 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 between '}' and the name of a typedef on the same line. -sp_brace_typedef = ignore # 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 -# (OC) Add or remove space before the '{' of a '@catch' statement, if the '{' -# and '@catch' are on the same line, as in '@catch (decl) {'. -# If set to ignore, sp_catch_brace is used. -sp_oc_catch_brace = ignore # ignore/add/remove/force - # Add or remove space between '}' and 'catch' if on the same line. sp_brace_catch = force # ignore/add/remove/force -# (OC) Add or remove space between '}' and '@catch' if on the same line. -# If set to ignore, sp_brace_catch is used. -sp_oc_brace_catch = ignore # ignore/add/remove/force - -# Add or remove space between 'finally' and '{' if on the same line. -sp_finally_brace = ignore # ignore/add/remove/force - -# Add or remove space between '}' and 'finally' if on the same line. -sp_brace_finally = ignore # ignore/add/remove/force - -# Add or remove space between 'try' and '{' if on the same line. -sp_try_brace = ignore # ignore/add/remove/force - -# Add or remove space between get/set and '{' if on the same line. -sp_getset_brace = ignore # ignore/add/remove/force - -# Add or remove space between a variable and '{' for C++ uniform -# initialization. -sp_word_brace_init_lst = ignore # ignore/add/remove/force - -# Add or remove space between a variable and '{' for a namespace. -# -# Default: add -sp_word_brace_ns = add # ignore/add/remove/force - -# Add or remove space before the '::' operator. -sp_before_dc = ignore # ignore/add/remove/force - -# Add or remove space after the '::' operator. -sp_after_dc = ignore # ignore/add/remove/force - -# (D) Add or remove around the D named array initializer ':' operator. -sp_d_array_colon = ignore # ignore/add/remove/force - -# Add or remove space after the '!' (not) unary operator. -# -# Default: remove -sp_not = remove # ignore/add/remove/force - -# Add or remove space after the '~' (invert) unary operator. +# The number of columns to indent per level. Usually 2, 3, 4, or 8. # -# Default: remove -sp_inv = remove # ignore/add/remove/force +# Default: 8 +indent_columns = 4 # unsigned number -# Add or remove space after the '&' (address-of) unary operator. This does not -# affect the spacing after a '&' that is part of a type. +# How to use tabs when indenting code. # -# Default: remove -sp_addr = remove # ignore/add/remove/force - -# Add or remove space around the '.' or '->' operators. +# 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: remove -sp_member = remove # ignore/add/remove/force +# Default: 1 +indent_with_tabs = 0 # unsigned number -# Add or remove space after the '*' (dereference) unary operator. This does -# not affect the spacing after a '*' that is part of a type. -# -# Default: remove -sp_deref = remove # ignore/add/remove/force +# Whether to indent the body of a 'namespace'. +indent_namespace = true # true/false -# Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. -# -# Default: remove -sp_sign = remove # ignore/add/remove/force +# Whether the 'class' body is indented. +indent_class = true # true/false -# Add or remove space between '++' and '--' the word to which it is being -# applied, as in '(--x)' or 'y++;'. +# How to indent access specifiers that are followed by a +# colon. # -# Default: remove -sp_incdec = remove # ignore/add/remove/force - -# Add or remove space before a backslash-newline at the end of a line. +# >0: Absolute column where 1 is the leftmost column +# <=0: Subtract from brace indent # -# Default: add -sp_before_nl_cont = add # ignore/add/remove/force - -# (OC) Add or remove space after the scope '+' or '-', as in '-(void) foo;' -# or '+(int) bar;'. -sp_after_oc_scope = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the colon in message specs, -# i.e. '-(int) f:(int) x;' vs. '-(int) f: (int) x;'. -sp_after_oc_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space before the colon in message specs, -# i.e. '-(int) f: (int) x;' vs. '-(int) f : (int) x;'. -sp_before_oc_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the colon in immutable dictionary expression -# 'NSDictionary *test = @{@"foo" :@"bar"};'. -sp_after_oc_dict_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space before the colon in immutable dictionary expression -# 'NSDictionary *test = @{@"foo" :@"bar"};'. -sp_before_oc_dict_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the colon in message specs, -# i.e. '[object setValue:1];' vs. '[object setValue: 1];'. -sp_after_send_oc_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space before the colon in message specs, -# i.e. '[object setValue:1];' vs. '[object setValue :1];'. -sp_before_send_oc_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the (type) in message specs, -# i.e. '-(int)f: (int) x;' vs. '-(int)f: (int)x;'. -sp_after_oc_type = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the first (type) in message specs, -# i.e. '-(int) f:(int)x;' vs. '-(int)f:(int)x;'. -sp_after_oc_return_type = ignore # ignore/add/remove/force - -# (OC) Add or remove space between '@selector' and '(', -# i.e. '@selector(msgName)' vs. '@selector (msgName)'. -# Also applies to '@protocol()' constructs. -sp_after_oc_at_sel = ignore # ignore/add/remove/force - -# (OC) Add or remove space between '@selector(x)' and the following word, -# i.e. '@selector(foo) a:' vs. '@selector(foo)a:'. -sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force - -# (OC) Add or remove space inside '@selector' parentheses, -# i.e. '@selector(foo)' vs. '@selector( foo )'. -# Also applies to '@protocol()' constructs. -sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force - -# (OC) Add or remove space before a block pointer caret, -# i.e. '^int (int arg){...}' vs. ' ^int (int arg){...}'. -sp_before_oc_block_caret = ignore # ignore/add/remove/force - -# (OC) Add or remove space after a block pointer caret, -# i.e. '^int (int arg){...}' vs. '^ int (int arg){...}'. -sp_after_oc_block_caret = ignore # ignore/add/remove/force - -# (OC) Add or remove space between the receiver and selector in a message, -# as in '[receiver selector ...]'. -sp_after_oc_msg_receiver = ignore # ignore/add/remove/force - -# (OC) Add or remove space after '@property'. -sp_after_oc_property = ignore # ignore/add/remove/force +# Default: 1 +indent_access_spec = -4 # number -# (OC) Add or remove space between '@synchronized' and the open parenthesis, -# i.e. '@synchronized(foo)' vs. '@synchronized (foo)'. -sp_after_oc_synchronized = ignore # ignore/add/remove/force +# 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 -# Add or remove space around the ':' in 'b ? t : f'. -sp_cond_colon = ignore # ignore/add/remove/force +# 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 -# Add or remove space before the ':' in 'b ? t : f'. -# -# Overrides sp_cond_colon. -sp_cond_colon_before = ignore # ignore/add/remove/force +# 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 -# Add or remove space after the ':' in 'b ? t : f'. +# 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'. # -# Overrides sp_cond_colon. -sp_cond_colon_after = ignore # ignore/add/remove/force - -# Add or remove space around the '?' in 'b ? t : f'. -sp_cond_question = ignore # ignore/add/remove/force - -# Add or remove space before the '?' in 'b ? t : f'. +# <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 '#') # -# Overrides sp_cond_question. -sp_cond_question_before = ignore # ignore/add/remove/force +# Default: 8 +pp_multiline_define_body_indent = 4 # number -# Add or remove space after the '?' in 'b ? t : f'. +# The value might be used twice: +# - at the assignment +# - at the opening brace # -# Overrides sp_cond_question. -sp_cond_question_after = ignore # ignore/add/remove/force - -# In the abbreviated ternary form '(a ?: b)', add or remove space between '?' -# and ':'. -# -# Overrides all other sp_cond_* options. -sp_cond_ternary_short = ignore # ignore/add/remove/force - -# Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make -# sense here. -sp_case_label = ignore # ignore/add/remove/force - -# (D) Add or remove space around the D '..' operator. -sp_range = ignore # ignore/add/remove/force - -# Add or remove space after ':' in a Java/C++11 range-based 'for', -# as in 'for (Type var : expr)'. -sp_after_for_colon = ignore # ignore/add/remove/force - -# Add or remove space before ':' in a Java/C++11 range-based 'for', -# as in 'for (Type var : expr)'. -sp_before_for_colon = ignore # ignore/add/remove/force - -# (D) Add or remove space between 'extern' and '(' as in 'extern (C)'. -sp_extern_paren = ignore # ignore/add/remove/force - -# Add or remove space after the opening of a C++ comment, -# i.e. '// A' vs. '//A'. -sp_cmt_cpp_start = ignore # ignore/add/remove/force - -# If true, space is added with sp_cmt_cpp_start will be added after doxygen -# sequences like '///', '///<', '//!' and '//!<'. -sp_cmt_cpp_doxygen = false # true/false - -# If true, space is added with sp_cmt_cpp_start will be added after Qt -# translator or meta-data comments like '//:', '//=', and '//~'. -sp_cmt_cpp_qttr = false # true/false - -# Add or remove space between #else or #endif and a trailing comment. -sp_endif_cmt = ignore # ignore/add/remove/force - -# Add or remove space after 'new', 'delete' and 'delete[]'. -sp_after_new = ignore # ignore/add/remove/force - -# Add or remove space between 'new' and '(' in 'new()'. -sp_between_new_paren = ignore # ignore/add/remove/force - -# Add or remove space between ')' and type in 'new(foo) BAR'. -sp_after_newop_paren = ignore # ignore/add/remove/force - -# Add or remove space inside parenthesis of the new operator -# as in 'new(foo) BAR'. -sp_inside_newop_paren = ignore # ignore/add/remove/force - -# Add or remove space after the open parenthesis of the new operator, -# as in 'new(foo) BAR'. -# -# Overrides sp_inside_newop_paren. -sp_inside_newop_paren_open = ignore # ignore/add/remove/force - -# Add or remove space before the close parenthesis of the new operator, -# as in 'new(foo) BAR'. -# -# Overrides sp_inside_newop_paren. -sp_inside_newop_paren_close = ignore # ignore/add/remove/force - -# Add or remove space before a trailing or embedded comment. -sp_before_tr_emb_cmt = ignore # ignore/add/remove/force - -# Number of spaces before a trailing or embedded comment. -sp_num_before_tr_emb_cmt = 0 # unsigned number - -# (Java) Add or remove space between an annotation and the open parenthesis. -sp_annotation_paren = ignore # ignore/add/remove/force - -# If true, vbrace tokens are dropped to the previous token and skipped. -sp_skip_vbrace_tokens = false # true/false - -# Add or remove space after 'noexcept'. -sp_after_noexcept = ignore # ignore/add/remove/force - -# Add or remove space after '_'. -sp_vala_after_translation = ignore # ignore/add/remove/force - -# If true, a is inserted after #define. -force_tab_after_define = false # true/false - -# -# Indenting options -# - -# The number of columns to indent per level. Usually 2, 3, 4, or 8. -# -# Default: 8 -indent_columns = 4 # unsigned number - -# The continuation indent. If non-zero, this overrides the indent of '(', '[' -# and '=' continuation indents. Negative values are OK; negative value is -# absolute and not increased for each '(' or '[' level. -# -# For FreeBSD, this is set to 4. -indent_continue = 0 # number - -# The continuation indent, only for class header line(s). If non-zero, this -# overrides the indent of 'class' continuation indents. -indent_continue_class_head = 0 # unsigned number - -# Whether to indent empty lines (i.e. lines which contain only spaces before -# the newline character). -indent_single_newlines = false # true/false - -# The continuation indent for func_*_param if they are true. If non-zero, this -# overrides the indent. -indent_param = 0 # 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 comments that are not at a brace level with tabs on a -# tabstop. Requires indent_with_tabs=2. If false, will use spaces. -indent_cmt_with_tabs = false # true/false - -# Whether to indent strings broken by '\' so that they line up. -indent_align_string = false # true/false - -# The number of spaces to indent multi-line XML strings. -# Requires indent_align_string=true. -indent_xml_string = 0 # unsigned number - -# Spaces to indent '{' from level. -indent_brace = 0 # unsigned number - -# Whether braces are indented to the body level. -indent_braces = false # true/false - -# Whether to disable indenting function braces if indent_braces=true. -indent_braces_no_func = false # true/false - -# Whether to disable indenting class braces if indent_braces=true. -indent_braces_no_class = false # true/false - -# Whether to disable indenting struct braces if indent_braces=true. -indent_braces_no_struct = false # true/false - -# Whether to indent based on the size of the brace parent, -# i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. -indent_brace_parent = false # true/false - -# Whether to indent based on the open parenthesis instead of the open brace -# in '({\n'. -indent_paren_open_brace = false # true/false - -# (C#) Whether to indent the brace of a C# delegate by another level. -indent_cs_delegate_brace = false # true/false - -# (C#) Whether to indent a C# delegate (to handle delegates with no brace) by -# another level. -indent_cs_delegate_body = false # true/false - -# Whether to indent the body of a 'namespace'. -indent_namespace = true # true/false - -# Whether to indent only the first namespace, and not any nested namespaces. -# Requires indent_namespace=true. -indent_namespace_single_indent = false # true/false - -# The number of spaces to indent a namespace block. -# If set to zero, use the value indent_columns -indent_namespace_level = 0 # unsigned number - -# If the body of the namespace is longer than this number, it won't be -# indented. Requires indent_namespace=true. 0 means no limit. -indent_namespace_limit = 0 # unsigned number - -# Whether the 'extern "C"' body is indented. -indent_extern = false # true/false - -# Whether the 'class' body is indented. -indent_class = true # true/false - -# Whether to indent the stuff after a leading base class colon. -indent_class_colon = false # true/false - -# Whether to indent based on a class colon instead of the stuff after the -# colon. Requires indent_class_colon=true. -indent_class_on_colon = false # true/false - -# Whether to indent the stuff after a leading class initializer colon. -indent_constr_colon = false # true/false - -# Virtual indent from the ':' for member initializers. -# -# Default: 2 -indent_ctor_init_leading = 2 # unsigned number - -# Additional indent for constructor initializer list. -# Negative values decrease indent down to the first column. -indent_ctor_init = 0 # number - -# Whether to indent 'if' following 'else' as a new block under the 'else'. -# If false, 'else\nif' is treated as 'else if' for indenting purposes. -indent_else_if = false # true/false - -# Amount to indent variable declarations after a open brace. -# -# <0: Relative -# >=0: Absolute -indent_var_def_blk = 0 # number - -# Whether to indent continued variable declarations instead of aligning. -indent_var_def_cont = false # true/false - -# Whether to indent continued shift expressions ('<<' and '>>') instead of -# aligning. Set align_left_shift=false when enabling this. -indent_shift = false # true/false - -# Whether to force indentation of function definitions to start in column 1. -indent_func_def_force_col1 = false # true/false - -# Whether to indent continued function call parameters one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_call_param = false # true/false - -# Whether to indent continued function definition parameters one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_def_param = false # true/false - -# for function definitions, only if indent_func_def_param is false -# Allows to align params when appropriate and indent them when not -# behave as if it was true if paren position is more than this value -# if paren position is more than the option value -indent_func_def_param_paren_pos_threshold = 0 # unsigned number - -# Whether to indent continued function call prototype one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_proto_param = false # true/false - -# Whether to indent continued function call declaration one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_class_param = false # true/false - -# Whether to indent continued class variable constructors one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_ctor_var_param = false # true/false - -# Whether to indent continued template parameter list one indent level, -# rather than aligning parameters under the open parenthesis. -indent_template_param = false # true/false - -# Double the indent for indent_func_xxx_param options. -# Use both values of the options indent_columns and indent_param. -indent_func_param_double = false # true/false - -# Indentation column for standalone 'const' qualifier on a function -# prototype. -indent_func_const = 0 # unsigned number - -# Indentation column for standalone 'throw' qualifier on a function -# prototype. -indent_func_throw = 0 # unsigned number - -# How to indent within a macro followed by a brace on the same line -# This allows reducing the indent in macros that have (for example) -# `do { ... } while (0)` blocks bracketing them. -# -# true: add an indent for the brace on the same line as the macro -# false: do not add an indent for the brace on the same line as the macro -# -# Default: true -indent_macro_brace = true # true/false - -# The number of spaces to indent a continued '->' or '.'. -# Usually set to 0, 1, or indent_columns. -indent_member = 0 # unsigned number - -# Whether lines broken at '.' or '->' should be indented by a single indent. -# The indent_member option will not be effective if this is set to true. -indent_member_single = false # true/false - -# Spaces to indent single line ('//') comments on lines before code. -indent_sing_line_comments = 0 # unsigned number - -# When opening a paren for a control statement (if, for, while, etc), increase -# the indent level by this value. Negative values decrease the indent level. -indent_sparen_extra = 0 # number - -# Whether to indent trailing single line ('//') comments relative to the code -# instead of trying to keep the same absolute column. -indent_relative_single_line_comments = false # true/false - -# Spaces to indent 'case' from 'switch'. Usually 0 or indent_columns. -indent_switch_case = 0 # unsigned number - -# indent 'break' with 'case' from 'switch'. -indent_switch_break_with_case = false # true/false - -# Whether to indent preprocessor statements inside of switch statements. -# -# Default: true -indent_switch_pp = true # true/false - -# Spaces to shift the 'case' line, without affecting any other lines. -# Usually 0. -indent_case_shift = 0 # unsigned number - -# Spaces to indent '{' from 'case'. By default, the brace will appear under -# the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK. -indent_case_brace = 0 # number - -# Whether to indent comments found in first column. -indent_col1_comment = false # true/false - -# Whether to indent multi string literal in first column. -indent_col1_multi_string_literal = false # true/false - -# How to indent goto labels. -# -# >0: Absolute column where 1 is the leftmost column -# <=0: Subtract from brace indent -# -# Default: 1 -indent_label = 1 # number - -# 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 indent the code after an access specifier by one level. -# If true, this option forces 'indent_access_spec=0'. -indent_access_spec_body = false # true/false - -# If an open parenthesis is followed by a newline, whether to indent the next -# line so that it lines up after the open parenthesis (not recommended). -indent_paren_nl = false # true/false - -# How to indent a close parenthesis after a newline. -# -# 0: Indent to body level (default) -# 1: Align under the open parenthesis -# 2: Indent to the brace level -indent_paren_close = 0 # unsigned number - -# Whether to indent the open parenthesis of a function definition, -# if the parenthesis is on its own line. -indent_paren_after_func_def = false # true/false - -# Whether to indent the open parenthesis of a function declaration, -# if the parenthesis is on its own line. -indent_paren_after_func_decl = false # true/false - -# Whether to indent the open parenthesis of a function call, -# if the parenthesis is on its own line. -indent_paren_after_func_call = false # true/false - -# Whether to indent a comma when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_comma_paren = false # true/false - -# Whether to indent a Boolean operator when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_bool_paren = false # true/false - -# Whether to indent a semicolon when inside a for parenthesis. -# If true, aligns under the open for parenthesis. -indent_semicolon_for_paren = false # true/false - -# Whether to align the first expression to following ones -# if indent_bool_paren=true. -indent_first_bool_expr = false # true/false - -# Whether to align the first expression to following ones -# if indent_semicolon_for_paren=true. -indent_first_for_expr = false # true/false - -# If an open square is followed by a newline, whether to indent the next line -# so that it lines up after the open square (not recommended). -indent_square_nl = false # true/false - -# (ESQL/C) Whether to preserve the relative indent of 'EXEC SQL' bodies. -indent_preserve_sql = false # true/false - -# Whether to align continued statements at the '='. If false or if the '=' is -# followed by a newline, the next line is indent one tab. -# -# Default: true -indent_align_assign = true # true/false - -# If true, the indentation of the chunks after a '=' sequence will be set at -# LHS token indentation column before '='. -indent_off_after_assign = false # true/false - -# Whether to align continued statements at the '('. If false or the '(' is -# followed by a newline, the next line indent is one tab. -# -# Default: true -indent_align_paren = true # true/false - -# (OC) Whether to indent Objective-C code inside message selectors. -indent_oc_inside_msg_sel = false # true/false - -# (OC) Whether to indent Objective-C blocks at brace level instead of usual -# rules. -indent_oc_block = false # true/false - -# (OC) Indent for Objective-C blocks in a message relative to the parameter -# name. -# -# =0: Use indent_oc_block rules -# >0: Use specified number of spaces to indent -indent_oc_block_msg = 0 # unsigned number - -# (OC) Minimum indent for subsequent parameters -indent_oc_msg_colon = 0 # unsigned number - -# (OC) Whether to prioritize aligning with initial colon (and stripping spaces -# from lines, if necessary). -# -# Default: true -indent_oc_msg_prioritize_first_colon = true # true/false - -# (OC) Whether to indent blocks the way that Xcode does by default -# (from the keyword if the parameter is on its own line; otherwise, from the -# previous indentation level). Requires indent_oc_block_msg=true. -indent_oc_block_msg_xcode_style = false # true/false - -# (OC) Whether to indent blocks from where the brace is, relative to a -# message keyword. Requires indent_oc_block_msg=true. -indent_oc_block_msg_from_keyword = false # true/false - -# (OC) Whether to indent blocks from where the brace is, relative to a message -# colon. Requires indent_oc_block_msg=true. -indent_oc_block_msg_from_colon = false # true/false - -# (OC) Whether to indent blocks from where the block caret is. -# Requires indent_oc_block_msg=true. -indent_oc_block_msg_from_caret = false # true/false - -# (OC) Whether to indent blocks from where the brace caret is. -# Requires indent_oc_block_msg=true. -indent_oc_block_msg_from_brace = false # true/false - -# When indenting after virtual brace open and newline add further spaces to -# reach this minimum indent. -indent_min_vbrace_open = 0 # unsigned number - -# Whether to add further spaces after regular indent to reach next tabstop -# when indenting after virtual brace open and newline. -indent_vbrace_open_on_tabstop = false # true/false - -# How to indent after a brace followed by another token (not a newline). -# true: indent all contained lines to match the token -# false: indent all contained lines to match the brace -# -# Default: true -indent_token_after_brace = true # true/false - -# Whether to indent the body of a C++11 lambda. -indent_cpp_lambda_body = false # true/false - -# How to indent compound literals that are being returned. -# true: add both the indent from return & the compound literal open brace (ie: -# 2 indent levels) -# false: only indent 1 level, don't add the indent for the open brace, only add -# the indent for the return. -# -# Default: true -indent_compound_literal_return = true # true/false - -# (C#) Whether to indent a 'using' block if no braces are used. -# -# Default: true -indent_using_block = true # true/false - -# How to indent the continuation of ternary operator. -# -# 0: Off (default) -# 1: When the `if_false` is a continuation, indent it under `if_false` -# 2: When the `:` is a continuation, indent it under `?` -indent_ternary_operator = 0 # unsigned number - -# Whether to indent the statments inside ternary operator. -indent_inside_ternary_operator = false # true/false - -# If true, the indentation of the chunks after a `return` sequence will be set at return indentation column. -indent_off_after_return = false # true/false - -# If true, the indentation of the chunks after a `return new` sequence will be set at return indentation column. -indent_off_after_return_new = false # true/false - -# If true, the tokens after return are indented with regular single indentation. By default (false) the indentation is after the return token. -indent_single_after_return = false # true/false - -# Whether to ignore indent and alignment for 'asm' blocks (i.e. assume they -# have their own indentation). -indent_ignore_asm_block = false # true/false - -# Don't indent the close parenthesis of a function definition, -# if the parenthesis is on its own line. -donot_indent_func_def_close_paren = false # true/false - -# -# Newline adding and removing options -# - -# Whether to collapse empty blocks between '{' and '}'. -# If true, overrides nl_inside_empty_func -nl_collapse_empty_body = true # true/false - -# Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'. -nl_assign_leave_one_liners = false # true/false - -# Don't split one-line braced statements inside a 'class xx { }' body. -nl_class_leave_one_liners = false # true/false - -# Don't split one-line enums, as in 'enum foo { BAR = 15 };' -nl_enum_leave_one_liners = false # true/false - -# Don't split one-line get or set functions. -nl_getset_leave_one_liners = false # true/false - -# (C#) Don't split one-line property get or set functions. -nl_cs_property_leave_one_liners = false # true/false - -# Don't split one-line function definitions, as in 'int foo() { return 0; }'. -# might modify nl_func_type_name -nl_func_leave_one_liners = false # true/false - -# Don't split one-line C++11 lambdas, as in '[]() { return 0; }'. -nl_cpp_lambda_leave_one_liners = false # true/false - -# Don't split one-line if/else statements, as in 'if(...) b++;'. -nl_if_leave_one_liners = false # true/false - -# Don't split one-line while statements, as in 'while(...) b++;'. -nl_while_leave_one_liners = false # true/false - -# Don't split one-line for statements, as in 'for(...) b++;'. -nl_for_leave_one_liners = false # true/false - -# (OC) Don't split one-line Objective-C messages. -nl_oc_msg_leave_one_liner = false # true/false - -# (OC) Add or remove newline between method declaration and '{'. -nl_oc_mdef_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove newline between Objective-C block signature and '{'. -nl_oc_block_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove blank line before '@interface' statement. -nl_oc_before_interface = ignore # ignore/add/remove/force - -# (OC) Add or remove blank line before '@implementation' statement. -nl_oc_before_implementation = ignore # ignore/add/remove/force - -# (OC) Add or remove blank line before '@end' statement. -nl_oc_before_end = ignore # ignore/add/remove/force - -# (OC) Add or remove newline between '@interface' and '{'. -nl_oc_interface_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove newline between '@implementation' and '{'. -nl_oc_implementation_brace = ignore # ignore/add/remove/force - -# Add or remove newlines at the start of the file. -nl_start_of_file = ignore # ignore/add/remove/force - -# The minimum number of newlines at the start of the file (only used if -# nl_start_of_file is 'add' or 'force'). -nl_start_of_file_min = 0 # unsigned number - -# Add or remove newline at the end of the file. -nl_end_of_file = ignore # ignore/add/remove/force - -# The minimum number of newlines at the end of the file (only used if -# nl_end_of_file is 'add' or 'force'). -nl_end_of_file_min = 0 # unsigned number - -# Add or remove newline between '=' and '{'. -nl_assign_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline between '=' and '['. -nl_assign_square = ignore # ignore/add/remove/force - -# Add or remove newline between '[]' and '{'. -nl_tsquare_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline after '= ['. Will also affect the newline before -# the ']'. -nl_after_square_assign = ignore # ignore/add/remove/force - -# Add or remove newline between a function call's ')' and '{', as in -# 'list_for_each(item, &list) { }'. -nl_fcall_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum' and '{'. -nl_enum_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum' and 'class'. -nl_enum_class = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum class' and the identifier. -nl_enum_class_identifier = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum class' type and ':'. -nl_enum_identifier_colon = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum class identifier :' and type. -nl_enum_colon_type = ignore # ignore/add/remove/force - -# Add or remove newline between 'struct and '{'. -nl_struct_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'union' and '{'. -nl_union_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'if' and '{'. -nl_if_brace = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'else'. -nl_brace_else = ignore # ignore/add/remove/force - -# Add or remove newline between 'else if' and '{'. If set to ignore, -# nl_if_brace is used instead. -nl_elseif_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'else' and '{'. -nl_else_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'else' and 'if'. -nl_else_if = ignore # ignore/add/remove/force - -# Add or remove newline before '{' opening brace -nl_before_opening_brace_func_class_def = ignore # ignore/add/remove/force - -# Add or remove newline before 'if'/'else if' closing parenthesis. -nl_before_if_closing_paren = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'finally'. -nl_brace_finally = ignore # ignore/add/remove/force - -# Add or remove newline between 'finally' and '{'. -nl_finally_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'try' and '{'. -nl_try_brace = ignore # ignore/add/remove/force - -# Add or remove newline between get/set and '{'. -nl_getset_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'for' and '{'. -nl_for_brace = ignore # ignore/add/remove/force - -# Add or remove newline before the '{' of a 'catch' statement, as in -# 'catch (decl) {'. -nl_catch_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove newline before the '{' of a '@catch' statement, as in -# '@catch (decl) {'. If set to ignore, nl_catch_brace is used. -nl_oc_catch_brace = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'catch'. -nl_brace_catch = ignore # ignore/add/remove/force - -# (OC) Add or remove newline between '}' and '@catch'. If set to ignore, -# nl_brace_catch is used. -nl_oc_brace_catch = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and ']'. -nl_brace_square = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and ')' in a function invocation. -nl_brace_fparen = ignore # ignore/add/remove/force - -# Add or remove newline between 'while' and '{'. -nl_while_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline between 'scope (x)' and '{'. -nl_scope_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline between 'unittest' and '{'. -nl_unittest_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline between 'version (x)' and '{'. -nl_version_brace = ignore # ignore/add/remove/force - -# (C#) Add or remove newline between 'using' and '{'. -nl_using_brace = ignore # ignore/add/remove/force - -# Add or remove newline between two open or close braces. Due to general -# newline/brace handling, REMOVE may not work. -nl_brace_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'do' and '{'. -nl_do_brace = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'while' of 'do' statement. -nl_brace_while = ignore # ignore/add/remove/force - -# Add or remove newline between 'switch' and '{'. -nl_switch_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'synchronized' and '{'. -nl_synchronized_brace = ignore # ignore/add/remove/force - -# Add a newline between ')' and '{' if the ')' is on a different line than the -# if/for/etc. -# -# Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch and -# nl_catch_brace. -nl_multi_line_cond = false # true/false - -# Add a newline after '(' if an if/for/while/switch condition spans multiple -# lines -nl_multi_line_sparen_open = ignore # ignore/add/remove/force - -# Add a newline before ')' if an if/for/while/switch condition spans multiple -# lines. Overrides nl_before_if_closing_paren if both are specified. -nl_multi_line_sparen_close = ignore # ignore/add/remove/force - -# Force a newline in a define after the macro name for multi-line defines. -nl_multi_line_define = false # true/false - -# Whether to add a newline before 'case', and a blank line before a 'case' -# statement that follows a ';' or '}'. -nl_before_case = false # true/false - -# Whether to add a newline after a 'case' statement. -nl_after_case = false # true/false - -# Add or remove newline between a case ':' and '{'. -# -# Overrides nl_after_case. -nl_case_colon_brace = ignore # ignore/add/remove/force - -# Add or remove newline between ')' and 'throw'. -nl_before_throw = ignore # ignore/add/remove/force - -# Add or remove newline between 'namespace' and '{'. -nl_namespace_brace = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template class. -nl_template_class = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template class declaration. -# -# Overrides nl_template_class. -nl_template_class_decl = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<>' of a specialized class declaration. -# -# Overrides nl_template_class_decl. -nl_template_class_decl_special = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template class definition. -# -# Overrides nl_template_class. -nl_template_class_def = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<>' of a specialized class definition. -# -# Overrides nl_template_class_def. -nl_template_class_def_special = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template function. -nl_template_func = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template function -# declaration. -# -# Overrides nl_template_func. -nl_template_func_decl = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<>' of a specialized function -# declaration. -# -# Overrides nl_template_func_decl. -nl_template_func_decl_special = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template function -# definition. -# -# Overrides nl_template_func. -nl_template_func_def = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<>' of a specialized function -# definition. -# -# Overrides nl_template_func_def. -nl_template_func_def_special = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template variable. -nl_template_var = ignore # ignore/add/remove/force - -# Add or remove newline between 'template<...>' and 'using' of a templated -# type alias. -nl_template_using = ignore # ignore/add/remove/force - -# Add or remove newline between 'class' and '{'. -nl_class_brace = ignore # ignore/add/remove/force - -# Add or remove newline before or after (depending on pos_class_comma, -# may not be IGNORE) each',' in the base class list. -nl_class_init_args = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in the constructor member -# initialization. Related to nl_constr_colon, pos_constr_colon and -# pos_constr_comma. -nl_constr_init_args = ignore # ignore/add/remove/force - -# Add or remove newline before first element, after comma, and after last -# element, in 'enum'. -nl_enum_own_lines = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name in a function -# definition. -# might be modified by nl_func_leave_one_liners -nl_func_type_name = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name inside a class -# definition. If set to ignore, nl_func_type_name or nl_func_proto_type_name -# is used instead. -nl_func_type_name_class = ignore # ignore/add/remove/force - -# Add or remove newline between class specification and '::' -# in 'void A::f() { }'. Only appears in separate member implementation (does -# not appear with in-line implementation). -nl_func_class_scope = ignore # ignore/add/remove/force - -# Add or remove newline between function scope and name, as in -# 'void A :: f() { }'. -nl_func_scope_name = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name in a prototype. -nl_func_proto_type_name = ignore # ignore/add/remove/force - -# Add or remove newline between a function name and the opening '(' in the -# declaration. -nl_func_paren = ignore # ignore/add/remove/force - -# Overrides nl_func_paren for functions with no parameters. -nl_func_paren_empty = ignore # ignore/add/remove/force - -# Add or remove newline between a function name and the opening '(' in the -# definition. -nl_func_def_paren = ignore # ignore/add/remove/force - -# Overrides nl_func_def_paren for functions with no parameters. -nl_func_def_paren_empty = ignore # ignore/add/remove/force - -# Add or remove newline between a function name and the opening '(' in the -# call. -nl_func_call_paren = ignore # ignore/add/remove/force - -# Overrides nl_func_call_paren for functions with no parameters. -nl_func_call_paren_empty = ignore # ignore/add/remove/force - -# Add or remove newline after '(' in a function declaration. -nl_func_decl_start = ignore # ignore/add/remove/force - -# Add or remove newline after '(' in a function definition. -nl_func_def_start = ignore # ignore/add/remove/force - -# Overrides nl_func_decl_start when there is only one parameter. -nl_func_decl_start_single = ignore # ignore/add/remove/force - -# Overrides nl_func_def_start when there is only one parameter. -nl_func_def_start_single = ignore # ignore/add/remove/force - -# Whether to add a newline after '(' in a function declaration if '(' and ')' -# are in different lines. If false, nl_func_decl_start is used instead. -nl_func_decl_start_multi_line = false # true/false - -# Whether to add a newline after '(' in a function definition if '(' and ')' -# are in different lines. If false, nl_func_def_start is used instead. -nl_func_def_start_multi_line = false # true/false - -# Add or remove newline after each ',' in a function declaration. -nl_func_decl_args = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in a function definition. -nl_func_def_args = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in a function call. -nl_func_call_args = ignore # ignore/add/remove/force - -# Whether to add a newline after each ',' in a function declaration if '(' -# and ')' are in different lines. If false, nl_func_decl_args is used instead. -nl_func_decl_args_multi_line = false # true/false - -# Whether to add a newline after each ',' in a function definition if '(' -# and ')' are in different lines. If false, nl_func_def_args is used instead. -nl_func_def_args_multi_line = false # true/false - -# Add or remove newline before the ')' in a function declaration. -nl_func_decl_end = ignore # ignore/add/remove/force - -# Add or remove newline before the ')' in a function definition. -nl_func_def_end = ignore # ignore/add/remove/force - -# Overrides nl_func_decl_end when there is only one parameter. -nl_func_decl_end_single = ignore # ignore/add/remove/force - -# Overrides nl_func_def_end when there is only one parameter. -nl_func_def_end_single = ignore # ignore/add/remove/force - -# Whether to add a newline before ')' in a function declaration if '(' and ')' -# are in different lines. If false, nl_func_decl_end is used instead. -nl_func_decl_end_multi_line = false # true/false - -# Whether to add a newline before ')' in a function definition if '(' and ')' -# are in different lines. If false, nl_func_def_end is used instead. -nl_func_def_end_multi_line = false # true/false - -# Add or remove newline between '()' in a function declaration. -nl_func_decl_empty = ignore # ignore/add/remove/force - -# Add or remove newline between '()' in a function definition. -nl_func_def_empty = ignore # ignore/add/remove/force - -# Add or remove newline between '()' in a function call. -nl_func_call_empty = ignore # ignore/add/remove/force - -# Whether to add a newline after '(' in a function call, -# has preference over nl_func_call_start_multi_line. -nl_func_call_start = ignore # ignore/add/remove/force - -# Whether to add a newline before ')' in a function call. -nl_func_call_end = ignore # ignore/add/remove/force - -# Whether to add a newline after '(' in a function call if '(' and ')' are in -# different lines. -nl_func_call_start_multi_line = false # true/false - -# Whether to add a newline after each ',' in a function call if '(' and ')' -# are in different lines. -nl_func_call_args_multi_line = false # true/false - -# Whether to add a newline before ')' in a function call if '(' and ')' are in -# different lines. -nl_func_call_end_multi_line = false # true/false - -# Whether to respect nl_func_call_XXX option incase of closure args. -nl_func_call_args_multi_line_ignore_closures = false # true/false - -# Whether to add a newline after '<' of a template parameter list. -nl_template_start = false # true/false - -# Whether to add a newline after each ',' in a template parameter list. -nl_template_args = false # true/false - -# Whether to add a newline before '>' of a template parameter list. -nl_template_end = false # true/false - -# (OC) Whether to put each Objective-C message parameter on a separate line. -# See nl_oc_msg_leave_one_liner. -nl_oc_msg_args = false # true/false - -# Add or remove newline between function signature and '{'. -nl_fdef_brace = ignore # ignore/add/remove/force - -# Add or remove newline between function signature and '{', -# if signature ends with ')'. Overrides nl_fdef_brace. -nl_fdef_brace_cond = ignore # ignore/add/remove/force - -# Add or remove newline between C++11 lambda signature and '{'. -nl_cpp_ldef_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'return' and the return expression. -nl_return_expr = ignore # ignore/add/remove/force - -# Whether to add a newline after semicolons, except in 'for' statements. -nl_after_semicolon = false # true/false - -# (Java) Add or remove newline between the ')' and '{{' of the double brace -# initializer. -nl_paren_dbrace_open = ignore # ignore/add/remove/force - -# Whether to add a newline after the type in an unnamed temporary -# direct-list-initialization. -nl_type_brace_init_lst = ignore # ignore/add/remove/force - -# Whether to add a newline after the open brace in an unnamed temporary -# direct-list-initialization. -nl_type_brace_init_lst_open = ignore # ignore/add/remove/force - -# Whether to add a newline before the close brace in an unnamed temporary -# direct-list-initialization. -nl_type_brace_init_lst_close = ignore # ignore/add/remove/force - -# Whether to add a newline after '{'. This also adds a newline before the -# matching '}'. -nl_after_brace_open = false # true/false - -# Whether to add a newline between the open brace and a trailing single-line -# comment. Requires nl_after_brace_open=true. -nl_after_brace_open_cmt = false # true/false - -# Whether to add a newline after a virtual brace open with a non-empty body. -# These occur in un-braced if/while/do/for statement bodies. -nl_after_vbrace_open = false # true/false - -# Whether to add a newline after a virtual brace open with an empty body. -# These occur in un-braced if/while/do/for statement bodies. -nl_after_vbrace_open_empty = false # true/false - -# Whether to add a newline after '}'. Does not apply if followed by a -# necessary ';'. -nl_after_brace_close = false # true/false - -# Whether to add a newline after a virtual brace close, -# as in 'if (foo) a++; return;'. -nl_after_vbrace_close = false # true/false - -# Add or remove newline between the close brace and identifier, -# as in 'struct { int a; } b;'. Affects enumerations, unions and -# structures. If set to ignore, uses nl_after_brace_close. -nl_brace_struct_var = ignore # ignore/add/remove/force - -# Whether to alter newlines in '#define' macros. -nl_define_macro = false # true/false - -# Whether to alter newlines between consecutive parenthesis closes. The number -# of closing parentheses in a line will depend on respective open parenthesis -# lines. -nl_squeeze_paren_close = false # true/false - -# Whether to remove blanks after '#ifxx' and '#elxx', or before '#elxx' and -# '#endif'. Does not affect top-level #ifdefs. -nl_squeeze_ifdef = false # true/false - -# Makes the nl_squeeze_ifdef option affect the top-level #ifdefs as well. -nl_squeeze_ifdef_top_level = false # true/false - -# Add or remove blank line before 'if'. -nl_before_if = ignore # ignore/add/remove/force - -# Add or remove blank line after 'if' statement. Add/Force work only if the -# next token is not a closing brace. -nl_after_if = ignore # ignore/add/remove/force - -# Add or remove blank line before 'for'. -nl_before_for = ignore # ignore/add/remove/force - -# Add or remove blank line after 'for' statement. -nl_after_for = ignore # ignore/add/remove/force - -# Add or remove blank line before 'while'. -nl_before_while = ignore # ignore/add/remove/force - -# Add or remove blank line after 'while' statement. -nl_after_while = ignore # ignore/add/remove/force - -# Add or remove blank line before 'switch'. -nl_before_switch = ignore # ignore/add/remove/force - -# Add or remove blank line after 'switch' statement. -nl_after_switch = ignore # ignore/add/remove/force - -# Add or remove blank line before 'synchronized'. -nl_before_synchronized = ignore # ignore/add/remove/force - -# Add or remove blank line after 'synchronized' statement. -nl_after_synchronized = ignore # ignore/add/remove/force - -# Add or remove blank line before 'do'. -nl_before_do = ignore # ignore/add/remove/force - -# Add or remove blank line after 'do/while' statement. -nl_after_do = ignore # ignore/add/remove/force - -# Whether to put a blank line before 'return' statements, unless after an open -# brace. -nl_before_return = false # true/false - -# Whether to put a blank line after 'return' statements, unless followed by a -# close brace. -nl_after_return = false # true/false - -# Whether to put a blank line before a member '.' or '->' operators. -nl_before_member = ignore # ignore/add/remove/force - -# (Java) Whether to put a blank line after a member '.' or '->' operators. -nl_after_member = ignore # ignore/add/remove/force - -# Whether to double-space commented-entries in 'struct'/'union'/'enum'. -nl_ds_struct_enum_cmt = false # true/false - -# Whether to force a newline before '}' of a 'struct'/'union'/'enum'. -# (Lower priority than eat_blanks_before_close_brace.) -nl_ds_struct_enum_close_brace = false # true/false - -# Add or remove newline before or after (depending on pos_class_colon) a class -# colon, as in 'class Foo : public Bar'. -nl_class_colon = ignore # ignore/add/remove/force - -# Add or remove newline around a class constructor colon. The exact position -# depends on nl_constr_init_args, pos_constr_colon and pos_constr_comma. -nl_constr_colon = ignore # ignore/add/remove/force - -# Whether to collapse a two-line namespace, like 'namespace foo\n{ decl; }' -# into a single line. If true, prevents other brace newline rules from turning -# such code into four lines. -nl_namespace_two_to_one_liner = false # true/false - -# Whether to remove a newline in simple unbraced if statements, turning them -# into one-liners, as in 'if(b)\n i++;' => 'if(b) i++;'. -nl_create_if_one_liner = false # true/false - -# Whether to remove a newline in simple unbraced for statements, turning them -# into one-liners, as in 'for (...)\n stmt;' => 'for (...) stmt;'. -nl_create_for_one_liner = false # true/false - -# Whether to remove a newline in simple unbraced while statements, turning -# them into one-liners, as in 'while (expr)\n stmt;' => 'while (expr) stmt;'. -nl_create_while_one_liner = false # true/false - -# Whether to collapse a function definition whose body (not counting braces) -# is only one line so that the entire definition (prototype, braces, body) is -# a single line. -nl_create_func_def_one_liner = false # true/false - -# Whether to collapse a function definition whose body (not counting braces) -# is only one line so that the entire definition (prototype, braces, body) is -# a single line. -nl_create_list_one_liner = false # true/false - -# Whether to split one-line simple unbraced if statements into two lines by -# adding a newline, as in 'if(b) i++;'. -nl_split_if_one_liner = false # true/false - -# Whether to split one-line simple unbraced for statements into two lines by -# adding a newline, as in 'for (...) stmt;'. -nl_split_for_one_liner = false # true/false - -# Whether to split one-line simple unbraced while statements into two lines by -# adding a newline, as in 'while (expr) stmt;'. -nl_split_while_one_liner = false # true/false - -# Don't add a newline before a cpp-comment in a parameter list of a function -# call. -donot_add_nl_before_cpp_comment = false # true/false - -# -# Blank line options -# - -# The maximum number of consecutive newlines (3 = 2 blank lines). -nl_max = 0 # unsigned number - -# The maximum number of consecutive newlines in a function. -nl_max_blank_in_func = 0 # unsigned number - -# The number of newlines inside an empty function body. -# This option is overridden by nl_collapse_empty_body=true -nl_inside_empty_func = 0 # unsigned number - -# The number of newlines before a function prototype. -nl_before_func_body_proto = 0 # unsigned number - -# The number of newlines before a multi-line function definition. -nl_before_func_body_def = 0 # unsigned number - -# The number of newlines before a class constructor/destructor prototype. -nl_before_func_class_proto = 0 # unsigned number - -# The number of newlines before a class constructor/destructor definition. -nl_before_func_class_def = 0 # unsigned number - -# The number of newlines after a function prototype. -nl_after_func_proto = 0 # unsigned number - -# The number of newlines after a function prototype, if not followed by -# another function prototype. -nl_after_func_proto_group = 0 # unsigned number - -# The number of newlines after a class constructor/destructor prototype. -nl_after_func_class_proto = 0 # unsigned number - -# The number of newlines after a class constructor/destructor prototype, -# if not followed by another constructor/destructor prototype. -nl_after_func_class_proto_group = 0 # unsigned number - -# Whether one-line method definitions inside a class body should be treated -# as if they were prototypes for the purposes of adding newlines. -# -# Requires nl_class_leave_one_liners=true. Overrides nl_before_func_body_def -# and nl_before_func_class_def for one-liners. -nl_class_leave_one_liner_groups = false # true/false - -# The number of newlines after '}' of a multi-line function body. -nl_after_func_body = 0 # unsigned number - -# The number of newlines after '}' of a multi-line function body in a class -# declaration. Also affects class constructors/destructors. -# -# Overrides nl_after_func_body. -nl_after_func_body_class = 0 # unsigned number - -# The number of newlines after '}' of a single line function body. Also -# affects class constructors/destructors. -# -# Overrides nl_after_func_body and nl_after_func_body_class. -nl_after_func_body_one_liner = 0 # unsigned number - -# The number of blank lines after a block of variable definitions at the top -# of a function body. -# -# 0: No change (default). -nl_func_var_def_blk = 0 # unsigned number - -# The number of newlines before a block of typedefs. If nl_after_access_spec -# is non-zero, that option takes precedence. -# -# 0: No change (default). -nl_typedef_blk_start = 0 # unsigned number - -# The number of newlines after a block of typedefs. -# -# 0: No change (default). -nl_typedef_blk_end = 0 # unsigned number - -# The maximum number of consecutive newlines within a block of typedefs. -# -# 0: No change (default). -nl_typedef_blk_in = 0 # unsigned number - -# The number of newlines before a block of variable definitions not at the top -# of a function body. If nl_after_access_spec is non-zero, that option takes -# precedence. -# -# 0: No change (default). -nl_var_def_blk_start = 0 # unsigned number - -# The number of newlines after a block of variable definitions not at the top -# of a function body. -# -# 0: No change (default). -nl_var_def_blk_end = 0 # unsigned number - -# The maximum number of consecutive newlines within a block of variable -# definitions. -# -# 0: No change (default). -nl_var_def_blk_in = 0 # unsigned number - -# The minimum number of newlines before a multi-line comment. -# Doesn't apply if after a brace open or another multi-line comment. -nl_before_block_comment = 0 # unsigned number - -# The minimum number of newlines before a single-line C comment. -# Doesn't apply if after a brace open or other single-line C comments. -nl_before_c_comment = 0 # unsigned number - -# The minimum number of newlines before a CPP comment. -# Doesn't apply if after a brace open or other CPP comments. -nl_before_cpp_comment = 0 # unsigned number - -# Whether to force a newline after a multi-line comment. -nl_after_multiline_comment = false # true/false - -# Whether to force a newline after a label's colon. -nl_after_label_colon = false # true/false - -# The number of newlines after '}' or ';' of a struct/enum/union definition. -nl_after_struct = 0 # unsigned number - -# The number of newlines before a class definition. -nl_before_class = 0 # unsigned number - -# The number of newlines after '}' or ';' of a class definition. -nl_after_class = 0 # unsigned number - -# The number of newlines before a namespace. -nl_before_namespace = 0 # unsigned number - -# The number of newlines after '{' of a namespace. This also adds newlines -# before the matching '}'. -# -# 0: Apply eat_blanks_after_open_brace or eat_blanks_before_close_brace if -# applicable, otherwise no change. -# -# Overrides eat_blanks_after_open_brace and eat_blanks_before_close_brace. -nl_inside_namespace = 0 # unsigned number - -# The number of newlines after '}' of a namespace. -nl_after_namespace = 0 # unsigned number - -# The number of newlines before an access specifier label. This also includes -# the Qt-specific 'signals:' and 'slots:'. Will not change the newline count -# if after a brace open. -# -# 0: No change (default). -nl_before_access_spec = 0 # unsigned number - -# The number of newlines after an access specifier label. This also includes -# the Qt-specific 'signals:' and 'slots:'. Will not change the newline count -# if after a brace open. -# -# 0: No change (default). -# -# Overrides nl_typedef_blk_start and nl_var_def_blk_start. -nl_after_access_spec = 0 # unsigned number - -# The number of newlines between a function definition and the function -# comment, as in '// comment\n void foo() {...}'. -# -# 0: No change (default). -nl_comment_func_def = 0 # unsigned number - -# The number of newlines after a try-catch-finally block that isn't followed -# by a brace close. -# -# 0: No change (default). -nl_after_try_catch_finally = 0 # unsigned number - -# (C#) The number of newlines before and after a property, indexer or event -# declaration. -# -# 0: No change (default). -nl_around_cs_property = 0 # unsigned number - -# (C#) The number of newlines between the get/set/add/remove handlers. -# -# 0: No change (default). -nl_between_get_set = 0 # unsigned number - -# (C#) Add or remove newline between property and the '{'. -nl_property_brace = ignore # ignore/add/remove/force - -# Whether to remove blank lines after '{'. -eat_blanks_after_open_brace = false # true/false - -# Whether to remove blank lines before '}'. -eat_blanks_before_close_brace = false # true/false - -# How aggressively to remove extra newlines not in preprocessor. -# -# 0: No change (default) -# 1: Remove most newlines not handled by other config -# 2: Remove all newlines and reformat completely by config -nl_remove_extra_newlines = 0 # unsigned number - -# (Java) Add or remove newline after an annotation statement. Only affects -# annotations that are after a newline. -nl_after_annotation = ignore # ignore/add/remove/force - -# (Java) Add or remove newline between two annotations. -nl_between_annotation = ignore # ignore/add/remove/force - -# The number of newlines before a whole-file #ifdef. -# -# 0: No change (default). -nl_before_whole_file_ifdef = 0 # unsigned number - -# The number of newlines after a whole-file #ifdef. -# -# 0: No change (default). -nl_after_whole_file_ifdef = 0 # unsigned number - -# The number of newlines before a whole-file #endif. -# -# 0: No change (default). -nl_before_whole_file_endif = 0 # unsigned number - -# The number of newlines after a whole-file #endif. -# -# 0: No change (default). -nl_after_whole_file_endif = 0 # unsigned number - -# -# Positioning options -# - -# The position of arithmetic operators in wrapped expressions. -pos_arith = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of assignment in wrapped expressions. Do not affect '=' -# followed by '{'. -pos_assign = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of Boolean operators in wrapped expressions. -pos_bool = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of comparison operators in wrapped expressions. -pos_compare = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of conditional operators, as in the '?' and ':' of -# 'expr ? stmt : stmt', in wrapped expressions. -pos_conditional = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of the comma in wrapped expressions. -pos_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of the comma in enum entries. -pos_enum_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of the comma in the base class list if there is more than one -# line. Affects nl_class_init_args. -pos_class_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of the comma in the constructor initialization list. -# Related to nl_constr_colon, nl_constr_init_args and pos_constr_colon. -pos_constr_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of trailing/leading class colon, between class and base class -# list. Affects nl_class_colon. -pos_class_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of colons between constructor and member initialization. -# Related to nl_constr_colon, nl_constr_init_args and pos_constr_comma. -pos_constr_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of shift operators in wrapped expressions. -pos_shift = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# -# Line splitting options -# - -# Try to limit code width to N columns. -code_width = 0 # unsigned number - -# Whether to fully split long 'for' statements at semi-colons. -ls_for_split_full = false # true/false - -# Whether to fully split long function prototypes/calls at commas. -# The option ls_code_width has priority over the option ls_func_split_full. -ls_func_split_full = false # true/false - -# Whether to split lines as close to code_width as possible and ignore some -# groupings. -# The option ls_code_width has priority over the option ls_func_split_full. -ls_code_width = false # true/false - -# -# Code alignment options (not left column spaces/tabs) -# - -# Whether to keep non-indenting tabs. -align_keep_tabs = false # true/false - -# Whether to use tabs for aligning. -align_with_tabs = false # true/false - -# Whether to bump out to the next tab when aligning. -align_on_tabstop = false # true/false - -# Whether to right-align numbers. -align_number_right = false # true/false - -# Whether to keep whitespace not required for alignment. -align_keep_extra_space = false # true/false - -# Whether to align variable definitions in prototypes and functions. -align_func_params = false # true/false - -# The span for aligning parameter definitions in function on parameter name. -# -# 0: Don't align (default). -align_func_params_span = 0 # unsigned number - -# The threshold for aligning function parameter definitions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_func_params_thresh = 0 # number - -# The gap for aligning function parameter definitions. -align_func_params_gap = 0 # unsigned number - -# The span for aligning constructor value. -# -# 0: Don't align (default). -align_constr_value_span = 0 # unsigned number - -# The threshold for aligning constructor value. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_constr_value_thresh = 0 # number - -# The gap for aligning constructor value. -align_constr_value_gap = 0 # unsigned number - -# Whether to align parameters in single-line functions that have the same -# name. The function names must already be aligned with each other. -align_same_func_call_params = false # true/false - -# The span for aligning function-call parameters for single line functions. -# -# 0: Don't align (default). -align_same_func_call_params_span = 0 # unsigned number - -# The threshold for aligning function-call parameters for single line -# functions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_same_func_call_params_thresh = 0 # number - -# The span for aligning variable definitions. -# -# 0: Don't align (default). -align_var_def_span = 0 # unsigned number - -# How to consider (or treat) the '*' in the alignment of variable definitions. -# -# 0: Part of the type 'void * foo;' (default) -# 1: Part of the variable 'void *foo;' -# 2: Dangling 'void *foo;' -# Dangling: the '*' will not be taken into account when aligning. -align_var_def_star_style = 0 # unsigned number - -# How to consider (or treat) the '&' in the alignment of variable definitions. -# -# 0: Part of the type 'long & foo;' (default) -# 1: Part of the variable 'long &foo;' -# 2: Dangling 'long &foo;' -# Dangling: the '&' will not be taken into account when aligning. -align_var_def_amp_style = 0 # unsigned number - -# The threshold for aligning variable definitions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_var_def_thresh = 0 # number - -# The gap for aligning variable definitions. -align_var_def_gap = 0 # unsigned number - -# Whether to align the colon in struct bit fields. -align_var_def_colon = false # true/false - -# The gap for aligning the colon in struct bit fields. -align_var_def_colon_gap = 0 # unsigned number - -# Whether to align any attribute after the variable name. -align_var_def_attribute = false # true/false - -# Whether to align inline struct/enum/union variable definitions. -align_var_def_inline = false # true/false - -# The span for aligning on '=' in assignments. -# -# 0: Don't align (default). -align_assign_span = 0 # unsigned number - -# The span for aligning on '=' in function prototype modifier. -# -# 0: Don't align (default). -align_assign_func_proto_span = 0 # unsigned number - -# The threshold for aligning on '=' in assignments. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_assign_thresh = 0 # number - -# How to apply align_assign_span to function declaration "assignments", i.e. -# 'virtual void foo() = 0' or '~foo() = {default|delete}'. -# -# 0: Align with other assignments (default) -# 1: Align with each other, ignoring regular assignments -# 2: Don't align -align_assign_decl_func = 0 # unsigned number - -# The span for aligning on '=' in enums. -# -# 0: Don't align (default). -align_enum_equ_span = 0 # unsigned number - -# The threshold for aligning on '=' in enums. -# Use a negative number for absolute thresholds. -# -# 0: no limit (default). -align_enum_equ_thresh = 0 # number - -# The span for aligning class member definitions. -# -# 0: Don't align (default). -align_var_class_span = 0 # unsigned number - -# The threshold for aligning class member definitions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_var_class_thresh = 0 # number - -# The gap for aligning class member definitions. -align_var_class_gap = 0 # unsigned number - -# The span for aligning struct/union member definitions. -# -# 0: Don't align (default). -align_var_struct_span = 0 # unsigned number - -# The threshold for aligning struct/union member definitions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_var_struct_thresh = 0 # number - -# The gap for aligning struct/union member definitions. -align_var_struct_gap = 0 # unsigned number - -# The span for aligning struct initializer values. -# -# 0: Don't align (default). -align_struct_init_span = 0 # unsigned number - -# The span for aligning single-line typedefs. -# -# 0: Don't align (default). -align_typedef_span = 0 # unsigned number - -# The minimum space between the type and the synonym of a typedef. -align_typedef_gap = 0 # unsigned number - -# How to align typedef'd functions with other typedefs. -# -# 0: Don't mix them at all (default) -# 1: Align the open parenthesis with the types -# 2: Align the function type name with the other type names -align_typedef_func = 0 # unsigned number - -# How to consider (or treat) the '*' in the alignment of typedefs. -# -# 0: Part of the typedef type, 'typedef int * pint;' (default) -# 1: Part of type name: 'typedef int *pint;' -# 2: Dangling: 'typedef int *pint;' -# Dangling: the '*' will not be taken into account when aligning. -align_typedef_star_style = 0 # unsigned number - -# How to consider (or treat) the '&' in the alignment of typedefs. -# -# 0: Part of the typedef type, 'typedef int & intref;' (default) -# 1: Part of type name: 'typedef int &intref;' -# 2: Dangling: 'typedef int &intref;' -# Dangling: the '&' will not be taken into account when aligning. -align_typedef_amp_style = 0 # unsigned number - -# The span for aligning comments that end lines. -# -# 0: Don't align (default). -align_right_cmt_span = 0 # unsigned number - -# Minimum number of columns between preceding text and a trailing comment in -# order for the comment to qualify for being aligned. Must be non-zero to have -# an effect. -align_right_cmt_gap = 0 # unsigned number - -# If aligning comments, whether to mix with comments after '}' and #endif with -# less than three spaces before the comment. -align_right_cmt_mix = false # true/false - -# Whether to only align trailing comments that are at the same brace level. -align_right_cmt_same_level = false # true/false - -# Minimum column at which to align trailing comments. Comments which are -# aligned beyond this column, but which can be aligned in a lesser column, -# may be "pulled in". -# -# 0: Ignore (default). -align_right_cmt_at_col = 0 # unsigned number - -# The span for aligning function prototypes. -# -# 0: Don't align (default). -align_func_proto_span = 0 # unsigned number - -# The threshold for aligning function prototypes. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_func_proto_thresh = 0 # number - -# Minimum gap between the return type and the function name. -align_func_proto_gap = 0 # unsigned number - -# Whether to align function prototypes on the 'operator' keyword instead of -# what follows. -align_on_operator = false # true/false - -# Whether to mix aligning prototype and variable declarations. If true, -# align_var_def_XXX options are used instead of align_func_proto_XXX options. -align_mix_var_proto = false # true/false - -# Whether to align single-line functions with function prototypes. -# Uses align_func_proto_span. -align_single_line_func = false # true/false - -# Whether to align the open brace of single-line functions. -# Requires align_single_line_func=true. Uses align_func_proto_span. -align_single_line_brace = false # true/false - -# Gap for align_single_line_brace. -align_single_line_brace_gap = 0 # unsigned number - -# (OC) The span for aligning Objective-C message specifications. -# -# 0: Don't align (default). -align_oc_msg_spec_span = 0 # unsigned number - -# Whether to align macros wrapped with a backslash and a newline. This will -# not work right if the macro contains a multi-line comment. -align_nl_cont = false # true/false - -# Whether to align macro functions and variables together. -align_pp_define_together = false # true/false - -# The span for aligning on '#define' bodies. -# -# =0: Don't align (default) -# >0: Number of lines (including comments) between blocks -align_pp_define_span = 0 # unsigned number - -# The minimum space between label and value of a preprocessor define. -align_pp_define_gap = 0 # unsigned number - -# Whether to align lines that start with '<<' with previous '<<'. -# -# Default: true -align_left_shift = true # true/false - -# Whether to align comma-separated statements following '<<' (as used to -# initialize Eigen matrices). -align_eigen_comma_init = false # true/false - -# Whether to align text after 'asm volatile ()' colons. -align_asm_colon = false # true/false - -# (OC) Span for aligning parameters in an Objective-C message call -# on the ':'. -# -# 0: Don't align. -align_oc_msg_colon_span = 0 # unsigned number - -# (OC) Whether to always align with the first parameter, even if it is too -# short. -align_oc_msg_colon_first = false # true/false - -# (OC) Whether to align parameters in an Objective-C '+' or '-' declaration -# on the ':'. -align_oc_decl_colon = false # true/false - -# (OC) Whether to not align parameters in an Objectve-C message call if first -# colon is not on next line of the message call (the same way Xcode does -# aligment) -align_oc_msg_colon_xcode_like = false # true/false - -# -# Comment modification options -# - -# Try to wrap comments at N columns. -cmt_width = 0 # unsigned number - -# How to reflow comments. -# -# 0: No reflowing (apart from the line wrapping due to cmt_width) (default) -# 1: No touching at all -# 2: Full reflow -cmt_reflow_mode = 0 # unsigned number - -# 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 - -# Whether to apply changes to multi-line comments, including cmt_width, -# keyword substitution and leading chars. -# -# Default: true -cmt_indent_multi = true # true/false - -# Whether to group c-comments that look like they are in a block. -cmt_c_group = false # true/false - -# Whether to put an empty '/*' on the first line of the combined c-comment. -cmt_c_nl_start = false # true/false - -# Whether to add a newline before the closing '*/' of the combined c-comment. -cmt_c_nl_end = false # true/false - -# Whether to change cpp-comments into c-comments. -cmt_cpp_to_c = false # true/false - -# Whether to group cpp-comments that look like they are in a block. Only -# meaningful if cmt_cpp_to_c=true. -cmt_cpp_group = false # true/false - -# Whether to put an empty '/*' on the first line of the combined cpp-comment -# when converting to a c-comment. -# -# Requires cmt_cpp_to_c=true and cmt_cpp_group=true. -cmt_cpp_nl_start = false # true/false - -# Whether to add a newline before the closing '*/' of the combined cpp-comment -# when converting to a c-comment. -# -# Requires cmt_cpp_to_c=true and cmt_cpp_group=true. -cmt_cpp_nl_end = false # true/false - -# Whether to put a star on subsequent comment lines. -cmt_star_cont = false # true/false - -# The number of spaces to insert at the start of subsequent comment lines. -cmt_sp_before_star_cont = 0 # unsigned number - -# The number of spaces to insert after the star on subsequent comment lines. -cmt_sp_after_star_cont = 0 # unsigned number - -# For multi-line comments with a '*' lead, remove leading spaces if the first -# and last lines of the comment are the same length. -# -# Default: true -cmt_multi_check_last = true # true/false - -# For multi-line comments with a '*' lead, remove leading spaces if the first -# and last lines of the comment are the same length AND if the length is -# bigger as the first_len minimum. -# -# Default: 4 -cmt_multi_first_len_minimum = 4 # unsigned number - -# Path to a file that contains text to insert at the beginning of a file if -# the file doesn't start with a C/C++ comment. If the inserted text contains -# '$(filename)', that will be replaced with the current file's name. -cmt_insert_file_header = "" # string - -# Path to a file that contains text to insert at the end of a file if the -# file doesn't end with a C/C++ comment. If the inserted text contains -# '$(filename)', that will be replaced with the current file's name. -cmt_insert_file_footer = "" # string - -# Path to a file that contains text to insert before a function definition if -# the function isn't preceded by a C/C++ comment. If the inserted text -# contains '$(function)', '$(javaparam)' or '$(fclass)', these will be -# replaced with, respectively, the name of the function, the javadoc '@param' -# and '@return' stuff, or the name of the class to which the member function -# belongs. -cmt_insert_func_header = "" # string - -# Path to a file that contains text to insert before a class if the class -# isn't preceded by a C/C++ comment. If the inserted text contains '$(class)', -# that will be replaced with the class name. -cmt_insert_class_header = "" # string - -# Path to a file that contains text to insert before an Objective-C message -# specification, if the method isn't preceded by a C/C++ comment. If the -# inserted text contains '$(message)' or '$(javaparam)', these will be -# replaced with, respectively, the name of the function, or the javadoc -# '@param' and '@return' stuff. -cmt_insert_oc_msg_header = "" # string - -# Whether a comment should be inserted if a preprocessor is encountered when -# stepping backwards from a function name. -# -# Applies to cmt_insert_oc_msg_header, cmt_insert_func_header and -# cmt_insert_class_header. -cmt_insert_before_preproc = false # true/false - -# Whether a comment should be inserted if a function is declared inline to a -# class definition. -# -# Applies to cmt_insert_func_header. -# -# Default: true -cmt_insert_before_inlines = true # true/false - -# Whether a comment should be inserted if the function is a class constructor -# or destructor. -# -# Applies to cmt_insert_func_header. -cmt_insert_before_ctor_dtor = false # true/false - -# -# Code modifying options (non-whitespace) -# - -# Add or remove braces on a single-line 'do' statement. -mod_full_brace_do = ignore # ignore/add/remove/force - -# Add or remove braces on a single-line 'for' statement. -mod_full_brace_for = ignore # ignore/add/remove/force - -# (Pawn) Add or remove braces on a single-line function definition. -mod_full_brace_function = ignore # ignore/add/remove/force - -# Add or remove braces on a single-line 'if' statement. Braces will not be -# removed if the braced statement contains an 'else'. -mod_full_brace_if = ignore # ignore/add/remove/force - -# Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either -# have, or do not have, braces. If true, braces will be added if any block -# needs braces, and will only be removed if they can be removed from all -# blocks. -# -# Overrides mod_full_brace_if. -mod_full_brace_if_chain = false # true/false - -# Whether to add braces to all blocks of an 'if'/'else if'/'else' chain. -# If true, mod_full_brace_if_chain will only remove braces from an 'if' that -# does not have an 'else if' or 'else'. -mod_full_brace_if_chain_only = false # true/false - -# Add or remove braces on single-line 'while' statement. -mod_full_brace_while = ignore # ignore/add/remove/force - -# Add or remove braces on single-line 'using ()' statement. -mod_full_brace_using = ignore # ignore/add/remove/force - -# Don't remove braces around statements that span N newlines -mod_full_brace_nl = 0 # unsigned number - -# Whether to prevent removal of braces from 'if'/'for'/'while'/etc. blocks -# which span multiple lines. -# -# Affects: -# mod_full_brace_for -# mod_full_brace_if -# mod_full_brace_if_chain -# mod_full_brace_if_chain_only -# mod_full_brace_while -# mod_full_brace_using -# -# Does not affect: -# mod_full_brace_do -# mod_full_brace_function -mod_full_brace_nl_block_rem_mlcond = false # true/false - -# Add or remove unnecessary parenthesis on 'return' statement. -mod_paren_on_return = ignore # ignore/add/remove/force - -# (Pawn) Whether to change optional semicolons to real semicolons. -mod_pawn_semicolon = false # true/false - -# Whether to fully parenthesize Boolean expressions in 'while' and 'if' -# statement, as in 'if (a && b > c)' => 'if (a && (b > c))'. -mod_full_paren_if_bool = false # true/false - -# Whether to remove superfluous semicolons. -mod_remove_extra_semicolon = false # true/false - -# If a function body exceeds the specified number of newlines and doesn't have -# a comment after the close brace, a comment will be added. -mod_add_long_function_closebrace_comment = 0 # unsigned number - -# If a namespace body exceeds the specified number of newlines and doesn't -# have a comment after the close brace, a comment will be added. -mod_add_long_namespace_closebrace_comment = 0 # unsigned number - -# If a class body exceeds the specified number of newlines and doesn't have a -# comment after the close brace, a comment will be added. -mod_add_long_class_closebrace_comment = 0 # unsigned number - -# If a switch body exceeds the specified number of newlines and doesn't have a -# comment after the close brace, a comment will be added. -mod_add_long_switch_closebrace_comment = 0 # unsigned number - -# If an #ifdef body exceeds the specified number of newlines and doesn't have -# a comment after the #endif, a comment will be added. -mod_add_long_ifdef_endif_comment = 0 # unsigned number - -# If an #ifdef or #else body exceeds the specified number of newlines and -# doesn't have a comment after the #else, a comment will be added. -mod_add_long_ifdef_else_comment = 0 # unsigned number - -# Whether to take care of the case by the mod_sort_xx options. -mod_sort_case_sensitive = false # true/false - -# Whether to sort consecutive single-line 'import' statements. -mod_sort_import = false # true/false - -# (C#) Whether to sort consecutive single-line 'using' statements. -mod_sort_using = false # true/false - -# Whether to sort consecutive single-line '#include' statements (C/C++) and -# '#import' statements (Objective-C). Be aware that this has the potential to -# break your code if your includes/imports have ordering dependencies. -mod_sort_include = false # true/false - -# Whether to prioritize '#include' and '#import' statements that contain -# filename without extension when sorting is enabled. -mod_sort_incl_import_prioritize_filename = false # true/false - -# Whether to prioritize '#include' and '#import' statements that does not -# contain extensions when sorting is enabled. -mod_sort_incl_import_prioritize_extensionless = false # true/false - -# Whether to prioritize '#include' and '#import' statements that contain -# angle over quotes when sorting is enabled. -mod_sort_incl_import_prioritize_angle_over_quotes = false # true/false - -# Whether to ignore file extension in '#include' and '#import' statements -# for sorting comparison. -mod_sort_incl_import_ignore_extension = false # true/false - -# Whether to group '#include' and '#import' statements when sorting is enabled. -mod_sort_incl_import_grouping_enabled = false # true/false - -# Whether to move a 'break' that appears after a fully braced 'case' before -# the close brace, as in 'case X: { ... } break;' => 'case X: { ... break; }'. -mod_move_case_break = false # true/false - -# Add or remove braces around a fully braced case statement. Will only remove -# braces if there are no variable declarations in the block. -mod_case_brace = ignore # ignore/add/remove/force - -# Whether to remove a void 'return;' that appears as the last statement in a -# function. -mod_remove_empty_return = false # true/false - -# Add or remove the comma after the last value of an enumeration. -mod_enum_last_comma = ignore # ignore/add/remove/force - -# (OC) Whether to organize the properties. If true, properties will be -# rearranged according to the mod_sort_oc_property_*_weight factors. -mod_sort_oc_properties = false # true/false - -# (OC) Weight of a class property modifier. -mod_sort_oc_property_class_weight = 0 # number - -# (OC) Weight of 'atomic' and 'nonatomic'. -mod_sort_oc_property_thread_safe_weight = 0 # number - -# (OC) Weight of 'readwrite' when organizing properties. -mod_sort_oc_property_readwrite_weight = 0 # number - -# (OC) Weight of a reference type specifier ('retain', 'copy', 'assign', -# 'weak', 'strong') when organizing properties. -mod_sort_oc_property_reference_weight = 0 # number - -# (OC) Weight of getter type ('getter=') when organizing properties. -mod_sort_oc_property_getter_weight = 0 # number - -# (OC) Weight of setter type ('setter=') when organizing properties. -mod_sort_oc_property_setter_weight = 0 # number - -# (OC) Weight of nullability type ('nullable', 'nonnull', 'null_unspecified', -# 'null_resettable') when organizing properties. -mod_sort_oc_property_nullability_weight = 0 # number - -# -# Preprocessor options -# - -# Add or remove indentation of preprocessor directives inside #if blocks -# at brace level 0 (file-level). -pp_indent = ignore # ignore/add/remove/force - -# Whether to indent #if/#else/#endif at the brace level. If false, these are -# indented from column 1. -pp_indent_at_level = false # true/false - -# Specifies the number of columns to indent preprocessors per level -# at brace level 0 (file-level). If pp_indent_at_level=false, also specifies -# the number of columns to indent preprocessors per level -# at brace level > 0 (function-level). -# -# Default: 1 -pp_indent_count = 1 # unsigned number - -# Add or remove space after # based on pp_level of #if blocks. -pp_space = ignore # ignore/add/remove/force - -# Sets the number of spaces per level added with pp_space. -pp_space_count = 0 # unsigned number - -# The indent for '#region' and '#endregion' in C# and '#pragma region' in -# C/C++. Negative values decrease indent down to the first column. -pp_indent_region = 0 # number - -# Whether to indent the code between #region and #endregion. -pp_region_indent_code = false # true/false - -# If pp_indent_at_level=true, sets the indent for #if, #else and #endif when -# not at file-level. Negative values decrease indent down to the first column. -# -# =0: Indent preprocessors using output_tab_size -# >0: Column at which all preprocessors will be indented -pp_indent_if = 0 # number - -# Whether to indent the code between #if, #else and #endif. -pp_if_indent_code = false # true/false - -# Whether to indent '#define' at the brace level. If false, these are -# indented from column 1. -pp_define_at_level = false # true/false - -# Whether to ignore the '#define' body while formatting. -pp_ignore_define_body = false # true/false - -# Whether to indent case statements between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the case statements -# directly inside of. -# -# Default: true -pp_indent_case = true # true/false - -# Whether to indent whole function definitions between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the function definition -# is directly inside of. -# -# Default: true -pp_indent_func_def = true # true/false - -# Whether to indent extern C blocks between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the extern block is -# directly inside of. -# -# Default: true -pp_indent_extern = true # true/false - -# Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly -# inside of. -# -# Default: true -pp_indent_brace = true # true/false - -# -# Sort includes options -# - -# The regex for include category with priority 0. -include_category_0 = "" # string - -# The regex for include category with priority 1. -include_category_1 = "" # string - -# The regex for include category with priority 2. -include_category_2 = "" # string - -# -# Use or Do not Use options -# - -# true: indent_func_call_param will be used (default) -# false: indent_func_call_param will NOT be used -# -# Default: true -use_indent_func_call_param = true # true/false - -# The value of the indentation for a continuation line is calculated -# differently if the statement is: -# - a declaration: your case with QString fileName ... -# - an assignment: your case with pSettings = new QSettings( ... -# -# At the second case the indentation value might be used twice: -# - at the assignment -# - at the function call (if present) -# -# To prevent the double use of the indentation value, use this option with the -# value 'true'. -# -# true: indent_continue will be used only once -# false: indent_continue will be used every time (default) -use_indent_continue_only_once = false # true/false - -# 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'. +# 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 - -# Whether sp_after_angle takes precedence over sp_inside_fparen. This was the -# historic behavior, but is probably not the desired behavior, so this is off -# by default. -use_sp_after_angle_always = false # true/false - -# Whether to apply special formatting for Qt SIGNAL/SLOT macros. Essentially, -# this tries to format these so that they match Qt's normalized form (i.e. the -# result of QMetaObject::normalizedSignature), which can slightly improve the -# performance of the QObject::connect call, rather than how they would -# otherwise be formatted. -# -# See options_for_QT.cpp for details. -# -# Default: true -use_options_overriding_for_qt_macros = true # true/false - -# If true: the form feed character is removed from the list -# of whitespace characters. -# See https://en.cppreference.com/w/cpp/string/byte/isspace -use_form_feed_no_more_as_whitespace_character = false # true/false - -# -# Warn levels - 1: error, 2: warning (default), 3: note -# - -# (C#) Warning is given if doing tab-to-\t replacement and we have found one -# in a C# verbatim string literal. -# -# Default: 2 -warn_level_tabs_found_in_verbatim_string_literals = 2 # unsigned number - -# Limit the number of loops. -# Used by uncrustify.cpp to exit from infinite loop. -# 0: no limit. -debug_max_number_of_loops = 0 # number - -# Set the number of the line to protocol; -# Used in the function prot_the_line if the 2. parameter is zero. -# 0: nothing protocol. -debug_line_number_to_protocol = 0 # number - -# Set the number of second(s) before terminating formatting the current file, -# 0: no timeout. -# only for linux -debug_timeout = 0 # number - -# Meaning of the settings: -# Ignore - do not do any changes -# Add - makes sure there is 1 or more space/brace/newline/etc -# Force - makes sure there is exactly 1 space/brace/newline/etc, -# behaves like Add in some contexts -# Remove - removes space/brace/newline/etc -# -# -# - Token(s) can be treated as specific type(s) with the 'set' option: -# `set tokenType tokenString [tokenString...]` -# -# Example: -# `set BOOL __AND__ __OR__` -# -# tokenTypes are defined in src/token_enum.h, use them without the -# 'CT_' prefix: 'CT_BOOL' => 'BOOL' -# -# -# - Token(s) can be treated as type(s) with the 'type' option. -# `type tokenString [tokenString...]` -# -# Example: -# `type int c_uint_8 Rectangle` -# -# This can also be achieved with `set TYPE int c_uint_8 Rectangle` -# -# -# To embed whitespace in tokenStrings use the '\' escape character, or quote -# the tokenStrings. These quotes are supported: "'` -# -# -# - Support for the auto detection of languages through the file ending can be -# added using the 'file_ext' command. -# `file_ext langType langString [langString..]` -# -# Example: -# `file_ext CPP .ch .cxx .cpp.in` -# -# langTypes are defined in uncrusify_types.h in the lang_flag_e enum, use -# them without the 'LANG_' prefix: 'LANG_CPP' => 'CPP' -# -# -# - Custom macro-based indentation can be set up using 'macro-open', -# 'macro-else' and 'macro-close'. -# `(macro-open | macro-else | macro-close) tokenString` -# -# Example: -# `macro-open BEGIN_TEMPLATE_MESSAGE_MAP` -# `macro-open BEGIN_MESSAGE_MAP` -# `macro-close END_MESSAGE_MAP` -# -# -# option(s) with 'not default' value: 24 -# diff --git a/AUTHORS b/AUTHORS index cf99e476365..6c72fe81730 100644 --- a/AUTHORS +++ b/AUTHORS @@ -22,12 +22,14 @@ Alexey Eryomenko Alexey Zhikhartsev Alfi Maulana Ali Can Demiralp +Allen Winter Alon Alexander Alon Liberman Ameen Ali Andreas Bacher Andreas Bießmann Andreas Grob +Andreas Lutsch Andreas Pokorny Andreas Rönnquist Andreas Vollenweider @@ -46,6 +48,7 @@ Antti Tuppurainen Anurag Garg Armin Müller Arpit Chaudhary +Artemis Meursault Gerrard August Sodora Ayaz Salikhov Balázs Tóth @@ -63,6 +66,7 @@ Ben T Bernd Buschinski Bill Egert Björge Dijkstra +Björn Blissing booga Boris Barbulovski Boris Egorov @@ -74,7 +78,9 @@ 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 @@ -128,6 +134,7 @@ Felix Wolff Florin Iucha Francesc Elies François Berder +Frank Winklmeier Frank Zingsheim Frederik Schwarzer fu7mu4 @@ -181,6 +188,7 @@ Jesse Boswell Jim Kuhn Jim Zhou jlguardi +Joel Johnson Johan Bertrand Johan Samuelson John Marshall @@ -209,6 +217,7 @@ Ketil Skjerve Kevin Christian Kevin Kendzia Kimmo Varis +Kitsios Konstantinos Kleber Tarcísio Konrad Grochowski Konrad Windszus @@ -219,6 +228,7 @@ Lars Even Almaas larudwer Lau bakman Lauri Nurmi +Leander Schulten Leandro Lisboa Penz Leila F. Rahman Lena Herscheid @@ -229,6 +239,7 @@ Lionel Gimbert Lucas Manuel Rodriguez Ludvig Gunne Lindström Luis Díaz Más +Luís Pereira Lukas Grützmacher Lukasz Czajczyk Łukasz Jankowski @@ -253,6 +264,7 @@ Márton Csordás Masafumi Koba Massimo Paladin Mateusz Michalak +Mateusz Patyk Mateusz Pusz Mathias De Maré Mathias Schmid @@ -305,6 +317,7 @@ Peter Schops Philip Chimento Philipp Kloke Pierre Schweitzer +Pieter Duchi Pino Toscano Pranav Khanna Radek Jarecki @@ -341,6 +354,7 @@ Sandeep Dutta Savvas Etairidis Scott Ehlert Scott Furry +Seafarix Ltd. Sebastian Held Sebastian Matuschka Sébastien Debrard @@ -367,7 +381,9 @@ Steve Duan Steve Mokris Steven Cook Steven Myint +Sune Stolborg Vuorela Susi Lehtola +Sven Wienand Swasti Shrivastava Sylvain Joubert Tam Do Thanh @@ -384,10 +400,12 @@ 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 @@ -401,6 +419,7 @@ Ville Skyttä Vincent Le Garrec Vladimir Petrigo Wang Haoyu +Wang Yang WenChung Chiu Wolfgang Stöggl x29a diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e1b78c2442..e2cd3029058 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,12 @@ -cmake_minimum_required(VERSION 3.5) -if(MSVC) - cmake_minimum_required(VERSION 3.13) -endif() -project(Cppcheck VERSION 2.14.99 LANGUAGES CXX) +cmake_minimum_required(VERSION 3.13) +project(Cppcheck VERSION 2.18.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) @@ -14,7 +14,6 @@ include(GNUInstallDirs) include(cmake/compilerCheck.cmake) include(cmake/versions.cmake) -include(cmake/options.cmake) include(cmake/findDependencies.cmake) include(cmake/compileroptions.cmake) include(cmake/compilerDefinitions.cmake) @@ -25,7 +24,8 @@ endif() include(cmake/printInfo.cmake) -file(GLOB addons "addons/*.py") +file(GLOB addons_py "addons/*.py") +file(GLOB addons_json "addons/*.json") file(GLOB cfgs "cfg/*.cfg") file(GLOB platforms "platforms/*.xml") @@ -69,6 +69,12 @@ if(LIBXML2_XMLLINT_EXECUTABLE) 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 + if(BUILD_TESTS) enable_testing() endif() @@ -78,6 +84,7 @@ add_custom_target(copy_cfg ALL "${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" @@ -94,10 +101,10 @@ if(USE_BUNDLED_TINYXML2) endif() add_subdirectory(externals/simplecpp) 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/triage) # Triage tool add_subdirectory(tools) add_subdirectory(man) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..e80e4a3b581 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# 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/danmar/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/danmar/cppcheck/tree/main/test)) or integration ([Python](https://github.com/danmar/cppcheck/tree/main/test/cli)) test to ensure that it doesn't regress with future changes. Negative tests (testing the opposite behavior) would be favorable but might not be required or might already exist depending on the change. Tests which introduce `TODO_ASSERT_` or `@pytest.mark.skip`/`@pytest.mark.xfail` should have tickets filed. + +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. + +[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) + +## 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/Makefile b/Makefile index 7124e4f9482..9ba42bb6bb1 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ ifndef CPPFLAGS endif ifdef FILESDIR - CPPFLAGS+=-DFILESDIR=\"$(FILESDIR)\" + override CPPFLAGS+=-DFILESDIR=\"$(FILESDIR)\" endif RDYNAMIC=-rdynamic @@ -120,10 +120,6 @@ ifdef CYGWIN $(info CYGWIN found) endif - # Set the flag to address compile time warnings - # with tinyxml2 and Cygwin. - CPPFLAGS+=-U__STRICT_ANSI__ - # Increase stack size for Cygwin builds to avoid segmentation fault in limited recursive tests. CXXFLAGS+=-Wl,--stack,8388608 endif # CYGWIN @@ -136,19 +132,13 @@ ifeq (clang++, $(findstring clang++,$(CXX))) CPPCHK_GLIBCXX_DEBUG= endif ifndef CXXFLAGS - CXXFLAGS=-pedantic -Wall -Wextra -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar -Woverloaded-virtual $(CPPCHK_GLIBCXX_DEBUG) -g + CXXFLAGS=-pedantic -Wall -Wextra -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-sign-compare -Wno-multichar -Woverloaded-virtual $(CPPCHK_GLIBCXX_DEBUG) -g endif ifeq (g++, $(findstring g++,$(CXX))) - override CXXFLAGS += -std=gnu++0x -pipe -else ifeq (clang++, $(findstring clang++,$(CXX))) - override CXXFLAGS += -std=c++0x -else ifeq ($(CXX), c++) - ifeq ($(shell uname -s), Darwin) - override CXXFLAGS += -std=c++0x - endif + override CXXFLAGS += -pipe endif - +override CXXFLAGS += -std=c++11 ifeq ($(HAVE_RULES),yes) PCRE_CONFIG = $(shell which pcre-config) ifeq ($(PCRE_CONFIG),) @@ -172,12 +162,16 @@ ifndef INCLUDE_FOR_LIB INCLUDE_FOR_LIB=-Ilib -isystem externals -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml2 endif +ifndef INCLUDE_FOR_FE + INCLUDE_FOR_FE=-Ilib +endif + ifndef INCLUDE_FOR_CLI - INCLUDE_FOR_CLI=-Ilib -isystem externals/simplecpp -isystem externals/tinyxml2 + INCLUDE_FOR_CLI=-Ilib -Ifrontend -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml2 endif ifndef INCLUDE_FOR_TEST - INCLUDE_FOR_TEST=-Ilib -Icli -isystem externals/simplecpp -isystem externals/tinyxml2 + INCLUDE_FOR_TEST=-Ilib -Ifrontend -Icli -isystem externals/simplecpp -isystem externals/tinyxml2 endif BIN=$(DESTDIR)$(PREFIX)/bin @@ -201,11 +195,11 @@ LIBOBJ = $(libcppdir)/valueflow.o \ $(libcppdir)/checkassert.o \ $(libcppdir)/checkautovariables.o \ $(libcppdir)/checkbool.o \ - $(libcppdir)/checkboost.o \ $(libcppdir)/checkbufferoverrun.o \ $(libcppdir)/checkclass.o \ $(libcppdir)/checkcondition.o \ $(libcppdir)/checkers.o \ + $(libcppdir)/checkersidmapping.o \ $(libcppdir)/checkersreport.o \ $(libcppdir)/checkexceptionsafety.o \ $(libcppdir)/checkfunctions.o \ @@ -230,6 +224,7 @@ LIBOBJ = $(libcppdir)/valueflow.o \ $(libcppdir)/ctu.o \ $(libcppdir)/errorlogger.o \ $(libcppdir)/errortypes.o \ + $(libcppdir)/findtoken.o \ $(libcppdir)/forwardanalyzer.o \ $(libcppdir)/fwdanalysis.o \ $(libcppdir)/importproject.o \ @@ -245,6 +240,7 @@ LIBOBJ = $(libcppdir)/valueflow.o \ $(libcppdir)/programmemory.o \ $(libcppdir)/reverseanalyzer.o \ $(libcppdir)/settings.o \ + $(libcppdir)/standards.o \ $(libcppdir)/summaries.o \ $(libcppdir)/suppressions.o \ $(libcppdir)/templatesimplifier.o \ @@ -252,40 +248,23 @@ LIBOBJ = $(libcppdir)/valueflow.o \ $(libcppdir)/token.o \ $(libcppdir)/tokenlist.o \ $(libcppdir)/utils.o \ - $(libcppdir)/vf_array.o \ - $(libcppdir)/vf_arraybool.o \ - $(libcppdir)/vf_arrayelement.o \ - $(libcppdir)/vf_bailout.o \ - $(libcppdir)/vf_bitand.o \ + $(libcppdir)/vf_analyzers.o \ $(libcppdir)/vf_common.o \ - $(libcppdir)/vf_debug.o \ - $(libcppdir)/vf_enumvalue.o \ - $(libcppdir)/vf_functionreturn.o \ - $(libcppdir)/vf_globalconstvar.o \ - $(libcppdir)/vf_globalstaticvar.o \ - $(libcppdir)/vf_impossiblevalues.o \ - $(libcppdir)/vf_iteratorinfer.o \ - $(libcppdir)/vf_iterators.o \ - $(libcppdir)/vf_number.o \ - $(libcppdir)/vf_pointeralias.o \ - $(libcppdir)/vf_rightshift.o \ - $(libcppdir)/vf_sameexpressions.o \ $(libcppdir)/vf_settokenvalue.o \ - $(libcppdir)/vf_string.o \ - $(libcppdir)/vf_symbolicinfer.o \ - $(libcppdir)/vf_unknownfunctionreturn.o \ $(libcppdir)/vfvalue.o EXTOBJ = externals/simplecpp/simplecpp.o \ externals/tinyxml2/tinyxml2.o +FEOBJ = frontend/frontend.o + CLIOBJ = cli/cmdlineparser.o \ cli/cppcheckexecutor.o \ - cli/cppcheckexecutorseh.o \ cli/executor.o \ cli/filelister.o \ cli/main.o \ cli/processexecutor.o \ + cli/sehwrapper.o \ cli/signalhandler.o \ cli/singleexecutor.o \ cli/stacktrace.o \ @@ -301,7 +280,6 @@ TESTOBJ = test/fixture.o \ test/testastutils.o \ test/testautovariables.o \ test/testbool.o \ - test/testboost.o \ test/testbufferoverrun.o \ test/testcharvar.o \ test/testcheck.o \ @@ -314,8 +292,10 @@ TESTOBJ = test/fixture.o \ test/testcppcheck.o \ test/testerrorlogger.o \ test/testexceptionsafety.o \ + test/testexecutor.o \ test/testfilelister.o \ test/testfilesettings.o \ + test/testfrontend.o \ test/testfunctions.o \ test/testgarbage.o \ test/testimportproject.o \ @@ -343,6 +323,7 @@ TESTOBJ = test/fixture.o \ test/testsimplifyusing.o \ test/testsingleexecutor.o \ test/testsizeof.o \ + test/teststandards.o \ test/teststl.o \ test/teststring.o \ test/testsummaries.o \ @@ -362,19 +343,20 @@ TESTOBJ = test/fixture.o \ test/testutils.o \ test/testvaarg.o \ test/testvalueflow.o \ - test/testvarid.o + test/testvarid.o \ + test/testvfvalue.o .PHONY: run-dmake tags ###### Targets -cppcheck: $(EXTOBJ) $(LIBOBJ) $(CLIOBJ) +cppcheck: $(EXTOBJ) $(LIBOBJ) $(FEOBJ) $(CLIOBJ) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS) $(RDYNAMIC) all: cppcheck testrunner -testrunner: $(EXTOBJ) $(TESTOBJ) $(LIBOBJ) cli/executor.o cli/processexecutor.o cli/singleexecutor.o cli/threadexecutor.o cli/cmdlineparser.o cli/cppcheckexecutor.o cli/cppcheckexecutorseh.o cli/signalhandler.o cli/stacktrace.o cli/filelister.o +testrunner: $(EXTOBJ) $(TESTOBJ) $(LIBOBJ) $(FEOBJ) cli/cmdlineparser.o cli/cppcheckexecutor.o cli/executor.o cli/filelister.o cli/processexecutor.o cli/sehwrapper.o cli/signalhandler.o cli/singleexecutor.o cli/stacktrace.o cli/threadexecutor.o $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS) $(RDYNAMIC) test: all @@ -393,7 +375,7 @@ run-dmake: dmake ./dmake clean: - rm -f build/*.cpp build/*.o lib/*.o cli/*.o test/*.o tools/dmake/*.o externals/*/*.o testrunner dmake cppcheck cppcheck.exe cppcheck.1 + rm -f build/*.cpp build/*.o lib/*.o cli/*.o frontend/*.o test/*.o tools/dmake/*.o externals/*/*.o testrunner dmake cppcheck cppcheck.exe cppcheck.1 man: man/cppcheck.1 @@ -411,6 +393,7 @@ install: cppcheck ifdef FILESDIR install -d ${DESTDIR}${FILESDIR} install -d ${DESTDIR}${FILESDIR}/addons + install -m 644 addons/*.json ${DESTDIR}${FILESDIR}/addons install -m 644 addons/*.py ${DESTDIR}${FILESDIR}/addons install -d ${DESTDIR}${FILESDIR}/cfg install -m 644 cfg/*.cfg ${DESTDIR}${FILESDIR}/cfg @@ -432,16 +415,6 @@ ifdef FILESDIR rm -rf ${DESTDIR}${FILESDIR}; \ fi endif -ifdef CFGDIR - @if test -d ${DESTDIR}${CFGDIR}; then \ - files="`cd cfg 2>/dev/null && ls`"; \ - if test -n "$$files"; then \ - echo '(' cd ${DESTDIR}${CFGDIR} '&&' rm -f $$files ')'; \ - ( cd ${DESTDIR}${CFGDIR} && rm -f $$files ); \ - fi; \ - fi -endif - # Validation of library files: ConfigFiles := $(wildcard cfg/*.cfg) ConfigFilesCHECKED := $(patsubst %.cfg,%.checked,$(ConfigFiles)) @@ -483,136 +456,139 @@ validateRules: ###### Build -$(libcppdir)/valueflow.o: lib/valueflow.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/calculate.h lib/check.h lib/checkuninitvar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/findtoken.h lib/forwardanalyzer.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/reverseanalyzer.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vf_analyze.h lib/vf_array.h lib/vf_arraybool.h lib/vf_arrayelement.h lib/vf_bailout.h lib/vf_bitand.h lib/vf_common.h lib/vf_debug.h lib/vf_enumvalue.h lib/vf_functionreturn.h lib/vf_globalconstvar.h lib/vf_globalstaticvar.h lib/vf_impossiblevalues.h lib/vf_iteratorinfer.h lib/vf_iterators.h lib/vf_number.h lib/vf_pointeralias.h lib/vf_rightshift.h lib/vf_sameexpressions.h lib/vf_settokenvalue.h lib/vf_string.h lib/vf_symbolicinfer.h lib/vf_unknownfunctionreturn.h lib/vfvalue.h +$(libcppdir)/valueflow.o: lib/valueflow.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/calculate.h lib/check.h lib/checkers.h lib/checkuninitvar.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/findtoken.h lib/forwardanalyzer.h lib/infer.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/programmemory.h lib/reverseanalyzer.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vf_analyzers.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/valueflow.cpp -$(libcppdir)/tokenize.o: lib/tokenize.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/summaries.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/tokenize.o: lib/tokenize.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/summaries.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/tokenize.cpp -$(libcppdir)/symboldatabase.o: lib/symboldatabase.cpp lib/addoninfo.h lib/astutils.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/keywords.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/symboldatabase.o: lib/symboldatabase.cpp lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/keywords.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/symboldatabase.cpp $(libcppdir)/addoninfo.o: lib/addoninfo.cpp externals/picojson/picojson.h lib/addoninfo.h lib/config.h lib/json.h lib/path.h lib/standards.h lib/utils.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/addoninfo.cpp -$(libcppdir)/analyzerinfo.o: lib/analyzerinfo.cpp externals/tinyxml2/tinyxml2.h lib/analyzerinfo.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/path.h lib/platform.h lib/standards.h lib/utils.h lib/xml.h +$(libcppdir)/analyzerinfo.o: lib/analyzerinfo.cpp externals/tinyxml2/tinyxml2.h lib/analyzerinfo.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h lib/utils.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/analyzerinfo.cpp -$(libcppdir)/astutils.o: lib/astutils.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkclass.h lib/config.h lib/errortypes.h lib/findtoken.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vfvalue.h +$(libcppdir)/astutils.o: lib/astutils.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkclass.h lib/checkers.h lib/config.h lib/errortypes.h lib/findtoken.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/astutils.cpp -$(libcppdir)/check.o: lib/check.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/check.o: lib/check.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/check.cpp -$(libcppdir)/check64bit.o: lib/check64bit.cpp lib/addoninfo.h lib/check.h lib/check64bit.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/check64bit.o: lib/check64bit.cpp lib/addoninfo.h lib/check.h lib/check64bit.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/check64bit.cpp -$(libcppdir)/checkassert.o: lib/checkassert.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkassert.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkassert.o: lib/checkassert.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkassert.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkassert.cpp -$(libcppdir)/checkautovariables.o: lib/checkautovariables.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkautovariables.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/checkautovariables.o: lib/checkautovariables.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkautovariables.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkautovariables.cpp -$(libcppdir)/checkbool.o: lib/checkbool.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkbool.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkbool.o: lib/checkbool.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkbool.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkbool.cpp -$(libcppdir)/checkboost.o: lib/checkboost.cpp lib/check.h lib/checkboost.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkboost.cpp - -$(libcppdir)/checkbufferoverrun.o: lib/checkbufferoverrun.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/checkbufferoverrun.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h lib/xml.h +$(libcppdir)/checkbufferoverrun.o: lib/checkbufferoverrun.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/checkbufferoverrun.h lib/checkers.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkbufferoverrun.cpp -$(libcppdir)/checkclass.o: lib/checkclass.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h lib/xml.h +$(libcppdir)/checkclass.o: lib/checkclass.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/checkclass.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkclass.cpp -$(libcppdir)/checkcondition.o: lib/checkcondition.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkcondition.h lib/checkother.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkcondition.o: lib/checkcondition.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkcondition.h lib/checkers.h lib/checkother.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkcondition.cpp $(libcppdir)/checkers.o: lib/checkers.cpp lib/checkers.h lib/config.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkers.cpp -$(libcppdir)/checkersreport.o: lib/checkersreport.cpp lib/addoninfo.h lib/checkers.h lib/checkersreport.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h +$(libcppdir)/checkersidmapping.o: lib/checkersidmapping.cpp lib/checkers.h lib/config.h + $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkersidmapping.cpp + +$(libcppdir)/checkersreport.o: lib/checkersreport.cpp lib/addoninfo.h lib/checkers.h lib/checkersreport.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkersreport.cpp -$(libcppdir)/checkexceptionsafety.o: lib/checkexceptionsafety.cpp lib/addoninfo.h lib/check.h lib/checkexceptionsafety.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkexceptionsafety.o: lib/checkexceptionsafety.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkexceptionsafety.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkexceptionsafety.cpp -$(libcppdir)/checkfunctions.o: lib/checkfunctions.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkfunctions.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/checkfunctions.o: lib/checkfunctions.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkfunctions.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkfunctions.cpp -$(libcppdir)/checkinternal.o: lib/checkinternal.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkinternal.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkinternal.o: lib/checkinternal.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkinternal.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkinternal.cpp -$(libcppdir)/checkio.o: lib/checkio.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkio.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkio.o: lib/checkio.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkio.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkio.cpp -$(libcppdir)/checkleakautovar.o: lib/checkleakautovar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkleakautovar.h lib/checkmemoryleak.h lib/checknullpointer.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkleakautovar.o: lib/checkleakautovar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkleakautovar.h lib/checkmemoryleak.h lib/checknullpointer.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkleakautovar.cpp -$(libcppdir)/checkmemoryleak.o: lib/checkmemoryleak.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkmemoryleak.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkmemoryleak.o: lib/checkmemoryleak.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkmemoryleak.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkmemoryleak.cpp -$(libcppdir)/checknullpointer.o: lib/checknullpointer.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checknullpointer.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/findtoken.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/checknullpointer.o: lib/checknullpointer.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checknullpointer.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/findtoken.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checknullpointer.cpp -$(libcppdir)/checkother.o: lib/checkother.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkother.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/checkother.o: lib/checkother.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkother.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkother.cpp -$(libcppdir)/checkpostfixoperator.o: lib/checkpostfixoperator.cpp lib/addoninfo.h lib/check.h lib/checkpostfixoperator.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkpostfixoperator.o: lib/checkpostfixoperator.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkpostfixoperator.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkpostfixoperator.cpp -$(libcppdir)/checksizeof.o: lib/checksizeof.cpp lib/addoninfo.h lib/check.h lib/checksizeof.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checksizeof.o: lib/checksizeof.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checksizeof.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checksizeof.cpp -$(libcppdir)/checkstl.o: lib/checkstl.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checknullpointer.h lib/checkstl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/pathanalysis.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/checkstl.o: lib/checkstl.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checknullpointer.h lib/checkstl.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/pathanalysis.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkstl.cpp -$(libcppdir)/checkstring.o: lib/checkstring.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkstring.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkstring.o: lib/checkstring.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkstring.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkstring.cpp -$(libcppdir)/checktype.o: lib/checktype.cpp lib/addoninfo.h lib/check.h lib/checktype.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/checktype.o: lib/checktype.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checktype.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checktype.cpp -$(libcppdir)/checkuninitvar.o: lib/checkuninitvar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checknullpointer.h lib/checkuninitvar.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkuninitvar.o: lib/checkuninitvar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checknullpointer.h lib/checkuninitvar.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkuninitvar.cpp -$(libcppdir)/checkunusedfunctions.o: lib/checkunusedfunctions.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/checkunusedfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h +$(libcppdir)/checkunusedfunctions.o: lib/checkunusedfunctions.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/checkunusedfunctions.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkunusedfunctions.cpp -$(libcppdir)/checkunusedvar.o: lib/checkunusedvar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkunusedvar.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/checkunusedvar.o: lib/checkunusedvar.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkunusedvar.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkunusedvar.cpp -$(libcppdir)/checkvaarg.o: lib/checkvaarg.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkvaarg.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/checkvaarg.o: lib/checkvaarg.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/checkvaarg.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkvaarg.cpp -$(libcppdir)/clangimport.o: lib/clangimport.cpp lib/addoninfo.h lib/clangimport.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/clangimport.o: lib/clangimport.cpp lib/addoninfo.h lib/checkers.h lib/clangimport.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/clangimport.cpp $(libcppdir)/color.o: lib/color.cpp lib/color.h lib/config.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/color.cpp -$(libcppdir)/cppcheck.o: lib/cppcheck.cpp externals/picojson/picojson.h externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkunusedfunctions.h lib/clangimport.h lib/color.h lib/config.h lib/cppcheck.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/version.h lib/vfvalue.h lib/xml.h +$(libcppdir)/cppcheck.o: lib/cppcheck.cpp externals/picojson/picojson.h externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/checkunusedfunctions.h lib/clangimport.h lib/color.h lib/config.h lib/cppcheck.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/version.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/cppcheck.cpp -$(libcppdir)/ctu.o: lib/ctu.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h +$(libcppdir)/ctu.o: lib/ctu.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/ctu.cpp -$(libcppdir)/errorlogger.o: lib/errorlogger.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h +$(libcppdir)/errorlogger.o: lib/errorlogger.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/errorlogger.cpp $(libcppdir)/errortypes.o: lib/errortypes.cpp lib/config.h lib/errortypes.h lib/utils.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/errortypes.cpp -$(libcppdir)/forwardanalyzer.o: lib/forwardanalyzer.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/forwardanalyzer.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueptr.h lib/vfvalue.h +$(libcppdir)/findtoken.o: lib/findtoken.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/findtoken.h lib/library.h lib/mathlib.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h + $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/findtoken.cpp + +$(libcppdir)/forwardanalyzer.o: lib/forwardanalyzer.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/forwardanalyzer.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueptr.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/forwardanalyzer.cpp -$(libcppdir)/fwdanalysis.o: lib/fwdanalysis.cpp lib/addoninfo.h lib/astutils.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h +$(libcppdir)/fwdanalysis.o: lib/fwdanalysis.cpp lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/fwdanalysis.cpp -$(libcppdir)/importproject.o: lib/importproject.cpp externals/picojson/picojson.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/config.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h +$(libcppdir)/importproject.o: lib/importproject.cpp externals/picojson/picojson.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/importproject.cpp -$(libcppdir)/infer.o: lib/infer.cpp lib/calculate.h lib/config.h lib/errortypes.h lib/infer.h lib/mathlib.h lib/valueptr.h lib/vfvalue.h +$(libcppdir)/infer.o: lib/infer.cpp lib/calculate.h lib/config.h lib/errortypes.h lib/infer.h lib/mathlib.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueptr.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/infer.cpp $(libcppdir)/keywords.o: lib/keywords.cpp lib/config.h lib/keywords.h lib/standards.h lib/utils.h @@ -621,7 +597,7 @@ $(libcppdir)/keywords.o: lib/keywords.cpp lib/config.h lib/keywords.h lib/standa $(libcppdir)/library.o: lib/library.cpp externals/tinyxml2/tinyxml2.h lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/library.cpp -$(libcppdir)/mathlib.o: lib/mathlib.cpp externals/simplecpp/simplecpp.h lib/config.h lib/errortypes.h lib/mathlib.h lib/utils.h +$(libcppdir)/mathlib.o: lib/mathlib.cpp externals/simplecpp/simplecpp.h lib/config.h lib/errortypes.h lib/mathlib.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/mathlib.cpp $(libcppdir)/path.o: lib/path.cpp externals/simplecpp/simplecpp.h lib/config.h lib/path.h lib/standards.h lib/utils.h @@ -630,369 +606,327 @@ $(libcppdir)/path.o: lib/path.cpp externals/simplecpp/simplecpp.h lib/config.h l $(libcppdir)/pathanalysis.o: lib/pathanalysis.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/pathanalysis.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/pathanalysis.cpp -$(libcppdir)/pathmatch.o: lib/pathmatch.cpp lib/config.h lib/path.h lib/pathmatch.h lib/standards.h lib/utils.h +$(libcppdir)/pathmatch.o: lib/pathmatch.cpp lib/config.h lib/path.h lib/pathmatch.h lib/standards.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/pathmatch.cpp -$(libcppdir)/platform.o: lib/platform.cpp externals/tinyxml2/tinyxml2.h lib/config.h lib/path.h lib/platform.h lib/standards.h lib/utils.h lib/xml.h +$(libcppdir)/platform.o: lib/platform.cpp externals/tinyxml2/tinyxml2.h lib/config.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/platform.cpp -$(libcppdir)/preprocessor.o: lib/preprocessor.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h +$(libcppdir)/preprocessor.o: lib/preprocessor.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/preprocessor.cpp -$(libcppdir)/programmemory.o: lib/programmemory.cpp lib/addoninfo.h lib/astutils.h lib/calculate.h lib/config.h lib/errortypes.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vfvalue.h +$(libcppdir)/programmemory.o: lib/programmemory.cpp lib/addoninfo.h lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/infer.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/programmemory.cpp -$(libcppdir)/reverseanalyzer.o: lib/reverseanalyzer.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/config.h lib/errortypes.h lib/forwardanalyzer.h lib/library.h lib/mathlib.h lib/platform.h lib/reverseanalyzer.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueptr.h lib/vfvalue.h +$(libcppdir)/reverseanalyzer.o: lib/reverseanalyzer.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/forwardanalyzer.h lib/library.h lib/mathlib.h lib/platform.h lib/reverseanalyzer.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueptr.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/reverseanalyzer.cpp -$(libcppdir)/settings.o: lib/settings.cpp externals/picojson/picojson.h lib/addoninfo.h lib/config.h lib/errortypes.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/summaries.h lib/suppressions.h lib/utils.h lib/vfvalue.h +$(libcppdir)/settings.o: lib/settings.cpp externals/picojson/picojson.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/summaries.h lib/suppressions.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/settings.cpp -$(libcppdir)/summaries.o: lib/summaries.cpp lib/addoninfo.h lib/analyzerinfo.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/summaries.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/standards.o: lib/standards.cpp externals/simplecpp/simplecpp.h lib/config.h lib/standards.h lib/utils.h + $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/standards.cpp + +$(libcppdir)/summaries.o: lib/summaries.cpp lib/addoninfo.h lib/analyzerinfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/summaries.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/summaries.cpp -$(libcppdir)/suppressions.o: lib/suppressions.cpp externals/tinyxml2/tinyxml2.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h +$(libcppdir)/suppressions.o: lib/suppressions.cpp externals/tinyxml2/tinyxml2.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/suppressions.cpp -$(libcppdir)/templatesimplifier.o: lib/templatesimplifier.cpp lib/addoninfo.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/templatesimplifier.o: lib/templatesimplifier.cpp lib/addoninfo.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/templatesimplifier.cpp $(libcppdir)/timer.o: lib/timer.cpp lib/config.h lib/timer.h lib/utils.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/timer.cpp -$(libcppdir)/token.o: lib/token.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/tokenrange.h lib/utils.h lib/valueflow.h lib/vfvalue.h +$(libcppdir)/token.o: lib/token.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/tokenrange.h lib/utils.h lib/valueflow.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/token.cpp -$(libcppdir)/tokenlist.o: lib/tokenlist.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/keywords.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h +$(libcppdir)/tokenlist.o: lib/tokenlist.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/keywords.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/tokenlist.cpp $(libcppdir)/utils.o: lib/utils.cpp lib/config.h lib/utils.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/utils.cpp -$(libcppdir)/vf_array.o: lib/vf_array.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_array.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_array.cpp - -$(libcppdir)/vf_arraybool.o: lib/vf_arraybool.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_arraybool.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_arraybool.cpp - -$(libcppdir)/vf_arrayelement.o: lib/vf_arrayelement.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_arrayelement.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_arrayelement.cpp - -$(libcppdir)/vf_bailout.o: lib/vf_bailout.cpp lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/path.h lib/standards.h lib/tokenlist.h lib/utils.h lib/vf_bailout.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_bailout.cpp +$(libcppdir)/vf_analyzers.o: lib/vf_analyzers.cpp lib/addoninfo.h lib/analyzer.h lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/valueptr.h lib/vf_analyzers.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h + $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_analyzers.cpp -$(libcppdir)/vf_bitand.o: lib/vf_bitand.cpp lib/config.h lib/errortypes.h lib/mathlib.h lib/sourcelocation.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_bitand.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_bitand.cpp - -$(libcppdir)/vf_common.o: lib/vf_common.cpp lib/addoninfo.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h +$(libcppdir)/vf_common.o: lib/vf_common.cpp lib/addoninfo.h lib/astutils.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_common.cpp -$(libcppdir)/vf_debug.o: lib/vf_debug.cpp lib/addoninfo.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_common.h lib/vf_debug.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_debug.cpp - -$(libcppdir)/vf_enumvalue.o: lib/vf_enumvalue.cpp lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/vf_enumvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_enumvalue.cpp - -$(libcppdir)/vf_functionreturn.o: lib/vf_functionreturn.cpp lib/addoninfo.h lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/programmemory.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_bailout.h lib/vf_functionreturn.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_functionreturn.cpp - -$(libcppdir)/vf_globalconstvar.o: lib/vf_globalconstvar.cpp lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_globalconstvar.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_globalconstvar.cpp - -$(libcppdir)/vf_globalstaticvar.o: lib/vf_globalstaticvar.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_globalstaticvar.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_globalstaticvar.cpp - -$(libcppdir)/vf_impossiblevalues.o: lib/vf_impossiblevalues.cpp lib/astutils.h lib/calculate.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_impossiblevalues.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_impossiblevalues.cpp - -$(libcppdir)/vf_iteratorinfer.o: lib/vf_iteratorinfer.cpp lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_common.h lib/vf_iteratorinfer.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_iteratorinfer.cpp - -$(libcppdir)/vf_iterators.o: lib/vf_iterators.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_iterators.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_iterators.cpp - -$(libcppdir)/vf_number.o: lib/vf_number.cpp lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_common.h lib/vf_number.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_number.cpp - -$(libcppdir)/vf_pointeralias.o: lib/vf_pointeralias.cpp lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_pointeralias.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_pointeralias.cpp - -$(libcppdir)/vf_rightshift.o: lib/vf_rightshift.cpp lib/addoninfo.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_rightshift.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_rightshift.cpp - -$(libcppdir)/vf_sameexpressions.o: lib/vf_sameexpressions.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_sameexpressions.h lib/vf_settokenvalue.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_sameexpressions.cpp - -$(libcppdir)/vf_settokenvalue.o: lib/vf_settokenvalue.cpp lib/addoninfo.h lib/astutils.h lib/calculate.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h +$(libcppdir)/vf_settokenvalue.o: lib/vf_settokenvalue.cpp lib/addoninfo.h lib/astutils.h lib/calculate.h lib/checkers.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueflow.h lib/vf_common.h lib/vf_settokenvalue.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_settokenvalue.cpp -$(libcppdir)/vf_string.o: lib/vf_string.cpp lib/config.h lib/errortypes.h lib/mathlib.h lib/sourcelocation.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_settokenvalue.h lib/vf_string.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_string.cpp - -$(libcppdir)/vf_symbolicinfer.o: lib/vf_symbolicinfer.cpp lib/astutils.h lib/config.h lib/errortypes.h lib/infer.h lib/library.h lib/mathlib.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/valueptr.h lib/vf_settokenvalue.h lib/vf_symbolicinfer.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_symbolicinfer.cpp - -$(libcppdir)/vf_unknownfunctionreturn.o: lib/vf_unknownfunctionreturn.cpp lib/addoninfo.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vf_common.h lib/vf_settokenvalue.h lib/vf_unknownfunctionreturn.h lib/vfvalue.h - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vf_unknownfunctionreturn.cpp - $(libcppdir)/vfvalue.o: lib/vfvalue.cpp lib/config.h lib/errortypes.h lib/mathlib.h lib/templatesimplifier.h lib/token.h lib/utils.h lib/vfvalue.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/vfvalue.cpp -cli/cmdlineparser.o: cli/cmdlineparser.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/cppcheckexecutor.h cli/filelister.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h lib/xml.h +frontend/frontend.o: frontend/frontend.cpp frontend/frontend.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h + $(CXX) ${INCLUDE_FOR_FE} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ frontend/frontend.cpp + +cli/cmdlineparser.o: cli/cmdlineparser.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/filelister.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h lib/xml.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/cmdlineparser.cpp -cli/cppcheckexecutor.o: cli/cppcheckexecutor.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/cppcheckexecutor.h cli/cppcheckexecutorseh.h cli/executor.h cli/processexecutor.h cli/signalhandler.h cli/singleexecutor.h cli/threadexecutor.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkersreport.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h +cli/cppcheckexecutor.o: cli/cppcheckexecutor.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/cppcheckexecutor.h cli/executor.h cli/processexecutor.h cli/sehwrapper.h cli/signalhandler.h cli/singleexecutor.h cli/threadexecutor.h externals/picojson/picojson.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/checkersreport.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/json.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/cppcheckexecutor.cpp -cli/cppcheckexecutorseh.o: cli/cppcheckexecutorseh.cpp cli/cppcheckexecutor.h cli/cppcheckexecutorseh.h lib/config.h lib/filesettings.h lib/path.h lib/platform.h lib/standards.h lib/utils.h - $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/cppcheckexecutorseh.cpp - -cli/executor.o: cli/executor.cpp cli/executor.h lib/addoninfo.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h +cli/executor.o: cli/executor.cpp cli/executor.h lib/addoninfo.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/executor.cpp -cli/filelister.o: cli/filelister.cpp cli/filelister.h lib/config.h lib/filesettings.h lib/path.h lib/pathmatch.h lib/platform.h lib/standards.h lib/utils.h +cli/filelister.o: cli/filelister.cpp cli/filelister.h lib/config.h lib/filesettings.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/standards.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/filelister.cpp -cli/main.o: cli/main.cpp cli/cppcheckexecutor.h lib/config.h lib/errortypes.h lib/filesettings.h lib/path.h lib/platform.h lib/standards.h lib/utils.h +cli/main.o: cli/main.cpp cli/cppcheckexecutor.h lib/config.h lib/errortypes.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/main.cpp -cli/processexecutor.o: cli/processexecutor.cpp cli/executor.h cli/processexecutor.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h +cli/processexecutor.o: cli/processexecutor.cpp cli/executor.h cli/processexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/processexecutor.cpp -cli/signalhandler.o: cli/signalhandler.cpp cli/signalhandler.h cli/stacktrace.h lib/config.h +cli/sehwrapper.o: cli/sehwrapper.cpp cli/sehwrapper.h lib/config.h lib/utils.h + $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/sehwrapper.cpp + +cli/signalhandler.o: cli/signalhandler.cpp cli/signalhandler.h cli/stacktrace.h lib/config.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/signalhandler.cpp -cli/singleexecutor.o: cli/singleexecutor.cpp cli/executor.h cli/singleexecutor.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h +cli/singleexecutor.o: cli/singleexecutor.cpp cli/executor.h cli/singleexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/timer.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/singleexecutor.cpp cli/stacktrace.o: cli/stacktrace.cpp cli/stacktrace.h lib/config.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/stacktrace.cpp -cli/threadexecutor.o: cli/threadexecutor.cpp cli/executor.h cli/threadexecutor.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h +cli/threadexecutor.o: cli/threadexecutor.cpp cli/executor.h cli/threadexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/threadexecutor.cpp -test/fixture.o: test/fixture.cpp externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/fixture.h test/helpers.h test/options.h test/redirect.h +test/fixture.o: test/fixture.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/fixture.h test/helpers.h test/options.h test/redirect.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/fixture.cpp -test/helpers.o: test/helpers.cpp cli/filelister.h externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/config.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/helpers.h +test/helpers.o: test/helpers.cpp cli/filelister.h externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/helpers.cpp -test/main.o: test/main.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/options.h +test/main.o: test/main.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h test/options.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/main.cpp test/options.o: test/options.cpp test/options.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/options.cpp -test/test64bit.o: test/test64bit.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/check64bit.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/test64bit.o: test/test64bit.cpp lib/addoninfo.h lib/check.h lib/check64bit.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/test64bit.cpp -test/testanalyzerinformation.o: test/testanalyzerinformation.cpp lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h +test/testanalyzerinformation.o: test/testanalyzerinformation.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/xml.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testanalyzerinformation.cpp -test/testassert.o: test/testassert.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkassert.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testassert.o: test/testassert.cpp lib/addoninfo.h lib/check.h lib/checkassert.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testassert.cpp -test/testastutils.o: test/testastutils.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/astutils.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testastutils.o: test/testastutils.cpp lib/addoninfo.h lib/astutils.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testastutils.cpp -test/testautovariables.o: test/testautovariables.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkautovariables.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testautovariables.o: test/testautovariables.cpp lib/addoninfo.h lib/check.h lib/checkautovariables.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testautovariables.cpp -test/testbool.o: test/testbool.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkbool.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testbool.o: test/testbool.cpp lib/addoninfo.h lib/check.h lib/checkbool.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testbool.cpp -test/testboost.o: test/testboost.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkboost.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h - $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testboost.cpp - -test/testbufferoverrun.o: test/testbufferoverrun.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkbufferoverrun.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testbufferoverrun.o: test/testbufferoverrun.cpp lib/addoninfo.h lib/check.h lib/checkbufferoverrun.h lib/checkers.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testbufferoverrun.cpp -test/testcharvar.o: test/testcharvar.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testcharvar.o: test/testcharvar.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcharvar.cpp -test/testcheck.o: test/testcheck.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h +test/testcheck.o: test/testcheck.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcheck.cpp -test/testclangimport.o: test/testclangimport.cpp lib/addoninfo.h lib/check.h lib/clangimport.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h +test/testclangimport.o: test/testclangimport.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/clangimport.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testclangimport.cpp -test/testclass.o: test/testclass.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testclass.o: test/testclass.cpp lib/addoninfo.h lib/check.h lib/checkclass.h lib/checkers.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testclass.cpp -test/testcmdlineparser.o: test/testcmdlineparser.cpp cli/cmdlinelogger.h cli/cmdlineparser.h cli/cppcheckexecutor.h externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h +test/testcmdlineparser.o: test/testcmdlineparser.cpp cli/cmdlinelogger.h cli/cmdlineparser.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcmdlineparser.cpp -test/testcolor.o: test/testcolor.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h +test/testcolor.o: test/testcolor.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcolor.cpp -test/testcondition.o: test/testcondition.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkcondition.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testcondition.o: test/testcondition.cpp lib/addoninfo.h lib/check.h lib/checkcondition.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcondition.cpp -test/testconstructors.o: test/testconstructors.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testconstructors.o: test/testconstructors.cpp lib/addoninfo.h lib/check.h lib/checkclass.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testconstructors.cpp -test/testcppcheck.o: test/testcppcheck.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testcppcheck.o: test/testcppcheck.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcppcheck.cpp -test/testerrorlogger.o: test/testerrorlogger.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h test/fixture.h +test/testerrorlogger.o: test/testerrorlogger.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/xml.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testerrorlogger.cpp -test/testexceptionsafety.o: test/testexceptionsafety.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkexceptionsafety.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testexceptionsafety.o: test/testexceptionsafety.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkexceptionsafety.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testexceptionsafety.cpp -test/testfilelister.o: test/testfilelister.cpp cli/filelister.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h +test/testexecutor.o: test/testexecutor.cpp cli/executor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h + $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testexecutor.cpp + +test/testfilelister.o: test/testfilelister.cpp cli/filelister.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilelister.cpp -test/testfilesettings.o: test/testfilesettings.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h +test/testfilesettings.o: test/testfilesettings.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilesettings.cpp -test/testfunctions.o: test/testfunctions.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testfrontend.o: test/testfrontend.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h + $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfrontend.cpp + +test/testfunctions.o: test/testfunctions.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfunctions.cpp -test/testgarbage.o: test/testgarbage.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testgarbage.o: test/testgarbage.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testgarbage.cpp -test/testimportproject.o: test/testimportproject.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/redirect.h +test/testimportproject.o: test/testimportproject.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h test/fixture.h test/redirect.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testimportproject.cpp -test/testincompletestatement.o: test/testincompletestatement.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testincompletestatement.o: test/testincompletestatement.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testincompletestatement.cpp -test/testinternal.o: test/testinternal.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkinternal.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testinternal.o: test/testinternal.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkinternal.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testinternal.cpp -test/testio.o: test/testio.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkio.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testio.o: test/testio.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkio.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testio.cpp -test/testleakautovar.o: test/testleakautovar.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkleakautovar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testleakautovar.o: test/testleakautovar.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkleakautovar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testleakautovar.cpp -test/testlibrary.o: test/testlibrary.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testlibrary.o: test/testlibrary.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testlibrary.cpp -test/testmathlib.o: test/testmathlib.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h +test/testmathlib.o: test/testmathlib.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testmathlib.cpp -test/testmemleak.o: test/testmemleak.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkmemoryleak.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testmemleak.o: test/testmemleak.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkmemoryleak.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testmemleak.cpp -test/testnullpointer.o: test/testnullpointer.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checknullpointer.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testnullpointer.o: test/testnullpointer.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checknullpointer.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testnullpointer.cpp -test/testoptions.o: test/testoptions.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/options.h +test/testoptions.o: test/testoptions.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h test/options.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testoptions.cpp -test/testother.o: test/testother.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testother.o: test/testother.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkother.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testother.cpp -test/testpath.o: test/testpath.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testpath.o: test/testpath.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpath.cpp -test/testpathmatch.o: test/testpathmatch.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h +test/testpathmatch.o: test/testpathmatch.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpathmatch.cpp -test/testplatform.o: test/testplatform.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h test/fixture.h +test/testplatform.o: test/testplatform.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/xml.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testplatform.cpp -test/testpostfixoperator.o: test/testpostfixoperator.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkpostfixoperator.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testpostfixoperator.o: test/testpostfixoperator.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkpostfixoperator.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpostfixoperator.cpp -test/testpreprocessor.o: test/testpreprocessor.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testpreprocessor.o: test/testpreprocessor.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpreprocessor.cpp -test/testprocessexecutor.o: test/testprocessexecutor.cpp cli/executor.h cli/processexecutor.h externals/simplecpp/simplecpp.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h +test/testprocessexecutor.o: test/testprocessexecutor.cpp cli/executor.h cli/processexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testprocessexecutor.cpp -test/testprogrammemory.o: test/testprogrammemory.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/programmemory.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testprogrammemory.o: test/testprogrammemory.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/programmemory.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testprogrammemory.cpp -test/testsettings.o: test/testsettings.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testsettings.o: test/testsettings.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsettings.cpp -test/testsimplifytemplate.o: test/testsimplifytemplate.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testsimplifytemplate.o: test/testsimplifytemplate.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytemplate.cpp -test/testsimplifytokens.o: test/testsimplifytokens.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testsimplifytokens.o: test/testsimplifytokens.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytokens.cpp -test/testsimplifytypedef.o: test/testsimplifytypedef.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testsimplifytypedef.o: test/testsimplifytypedef.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytypedef.cpp -test/testsimplifyusing.o: test/testsimplifyusing.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testsimplifyusing.o: test/testsimplifyusing.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifyusing.cpp -test/testsingleexecutor.o: test/testsingleexecutor.cpp cli/executor.h cli/singleexecutor.h externals/simplecpp/simplecpp.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h +test/testsingleexecutor.o: test/testsingleexecutor.cpp cli/executor.h cli/singleexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsingleexecutor.cpp -test/testsizeof.o: test/testsizeof.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checksizeof.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testsizeof.o: test/testsizeof.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checksizeof.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsizeof.cpp -test/teststl.o: test/teststl.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkstl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/teststandards.o: test/teststandards.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h + $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststandards.cpp + +test/teststl.o: test/teststl.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkstl.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststl.cpp -test/teststring.o: test/teststring.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkstring.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/teststring.o: test/teststring.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkstring.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/teststring.cpp -test/testsummaries.o: test/testsummaries.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/summaries.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testsummaries.o: test/testsummaries.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/summaries.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsummaries.cpp -test/testsuppressions.o: test/testsuppressions.cpp cli/cppcheckexecutor.h cli/executor.h cli/processexecutor.h cli/singleexecutor.h cli/threadexecutor.h externals/simplecpp/simplecpp.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testsuppressions.o: test/testsuppressions.cpp cli/cppcheckexecutor.h cli/executor.h cli/processexecutor.h cli/singleexecutor.h cli/threadexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsuppressions.cpp -test/testsymboldatabase.o: test/testsymboldatabase.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testsymboldatabase.o: test/testsymboldatabase.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsymboldatabase.cpp -test/testthreadexecutor.o: test/testthreadexecutor.cpp cli/executor.h cli/threadexecutor.h externals/simplecpp/simplecpp.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h +test/testthreadexecutor.o: test/testthreadexecutor.cpp cli/executor.h cli/threadexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h test/redirect.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testthreadexecutor.cpp -test/testtimer.o: test/testtimer.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h test/fixture.h +test/testtimer.o: test/testtimer.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/timer.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtimer.cpp -test/testtoken.o: test/testtoken.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testtoken.o: test/testtoken.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtoken.cpp -test/testtokenize.o: test/testtokenize.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testtokenize.o: test/testtokenize.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenize.cpp -test/testtokenlist.o: test/testtokenlist.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testtokenlist.o: test/testtokenlist.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenlist.cpp -test/testtokenrange.o: test/testtokenrange.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/tokenrange.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testtokenrange.o: test/testtokenrange.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/tokenrange.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenrange.cpp -test/testtype.o: test/testtype.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checktype.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testtype.o: test/testtype.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checktype.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtype.cpp -test/testuninitvar.o: test/testuninitvar.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkuninitvar.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testuninitvar.o: test/testuninitvar.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkuninitvar.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testuninitvar.cpp -test/testunusedfunctions.o: test/testunusedfunctions.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkunusedfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testunusedfunctions.o: test/testunusedfunctions.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkunusedfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedfunctions.cpp -test/testunusedprivfunc.o: test/testunusedprivfunc.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/sourcelocation.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testunusedprivfunc.o: test/testunusedprivfunc.cpp lib/addoninfo.h lib/check.h lib/checkclass.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedprivfunc.cpp -test/testunusedvar.o: test/testunusedvar.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkunusedvar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testunusedvar.o: test/testunusedvar.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkers.h lib/checkunusedvar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedvar.cpp -test/testutils.o: test/testutils.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h +test/testutils.o: test/testutils.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testutils.cpp -test/testvaarg.o: test/testvaarg.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/checkvaarg.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h +test/testvaarg.o: test/testvaarg.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/checkvaarg.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvaarg.cpp -test/testvalueflow.o: test/testvalueflow.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testvalueflow.o: test/testvalueflow.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvalueflow.cpp -test/testvarid.o: test/testvarid.cpp externals/simplecpp/simplecpp.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testvarid.o: test/testvarid.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvarid.cpp +test/testvfvalue.o: test/testvfvalue.cpp lib/addoninfo.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/utils.h lib/vfvalue.h test/fixture.h + $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvfvalue.cpp + externals/simplecpp/simplecpp.o: externals/simplecpp/simplecpp.cpp externals/simplecpp/simplecpp.h $(CXX) $(CPPFLAGS) $(CXXFLAGS) -w -c -o $@ externals/simplecpp/simplecpp.cpp externals/tinyxml2/tinyxml2.o: externals/tinyxml2/tinyxml2.cpp externals/tinyxml2/tinyxml2.h - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -w -c -o $@ externals/tinyxml2/tinyxml2.cpp + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -w -D_LARGEFILE_SOURCE -c -o $@ externals/tinyxml2/tinyxml2.cpp -tools/dmake/dmake.o: tools/dmake/dmake.cpp cli/filelister.h lib/config.h lib/filesettings.h lib/path.h lib/pathmatch.h lib/platform.h lib/standards.h lib/utils.h +tools/dmake/dmake.o: tools/dmake/dmake.cpp cli/filelister.h lib/config.h lib/filesettings.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/standards.h lib/utils.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ tools/dmake/dmake.cpp diff --git a/TUNING.md b/TUNING.md new file mode 100644 index 00000000000..081846d9ea9 --- /dev/null +++ b/TUNING.md @@ -0,0 +1,153 @@ +# Tuning Cppcheck Analysis + +There are several ways you can potentially improve the runtime of a Cppcheck analysis. + +Note: Most of these suggestions highly depend on your code base so they need to be evaluated before being applied. They might also depend the code of Cppcheck itself and your environment. So you might want to evaluate these on a regular basis. + +## Collecting Information + +To see the time each file took to analyze just specify the `--showtime=file-total` CLI option. + +## Tuning At Build-Level + +It is most likely that a pre-built binary is being used - either an official one or one provided by the packaging manager of my operating system. + +But if you build your own binary it is possible to apply several steps to potentially improve the performance. + +Note: Recently more distribution have opted to use more advanced optimization for their packages so several of the following suggestions might have already been applied. +Please refer to the documentation of your distribution for more insight on this. + +### Use Matchcompiler + +(TODO: document how to use it when using the in-tree Visual Studio project) +(TODO: check with a CMake generated Visual Studio project) + +### Use Boost + +Boost.Container (https://www.boost.org/doc/libs/release/libs/container) is being used for some containers which have a smaller overhead. + +As the used library is header-only implementation you only need to install the package on the system you build the binary on but not on the system you run the analysis on. + +The official Windows binary is currently not using this (TODO: file ticket). + +(TODO: enable usage by default / bail out when it is enforced) + +### Use A Different Compiler + +Analyzing our own code base has shown that using a different compiler might lead to slightly better performance. + +In our case Clang is mostly faster than GCC. See https://trac.cppcheck.net/ticket/10778 for some details. + +### Use More Advanced Optimizations + +By default we enforce the `-O2` optimization level. Even when using the `Release` build type in CMake which defaults to `-O3`. It might be possible that building with `-O3` might yield a perfomance increase. + +There are also no additional code generation flags provided so the resulting binary can run on any system. You might be able to tune this and apply more optimization which is tailored to the system you will be running the binary on. + +Needs to be evaluated. (TODO: file tickets) + +### Use LTO + +Needs to be evaluated. See https://trac.cppcheck.net/ticket/11671. + +### Use profile-guided optimizations (PGO/BOLT/AutoFDO/Propeller) + +Needs to be evaluated. See https://trac.cppcheck.net/ticket/11672. + +## Tuning At Analysis-Level + +### Use A More Performant Platform + +It seems people assume that you need to run the analysis on the same system you build your code on/for. That is not necessary as the analysis is system-agnostic. +As system headers are not required for analyzing your code you only need to specify the configuration which matches the system you run your code on. + +In case you are using a project as input which can only be generated on the build/target system you can just transfer that to a different system and still run the analysis. + +### Specify A Build Dir + +Using the `--cppcheck-build-dir` allows you to perform incremental runs which omit files which have not been changed. + +Important: As this is currently seriously lacking in testing coverage it might have shortcomings and need to be used with care. (TODO: file ticket) + +### Exclude Static/Generated Files + +If your code base contains files which rarely change (e.g. local copies of external dependencies) or you have generated files (e.g. `moc_*.cpp` for Qt projects) you might consider excluding these from the analysis. +This can be done by using the `-i` option on the CLI, `` in GUI projects or by including them to begin with into the files passed to the analysis. + +Depending on your setup you might also consider to scan these files in a less frequent run (e.g. only when the files have changed or Cppcheck was updated). + +This could also be handled using `--cppcheck-build-dir` (see above). + +### Exclude System Headers + +System headers are not necessary to perform the analysis. So you might consider not providing those to the analysis and specify a library configuration via `--library` instead. + +`pkg-config` for instance will always provide non-system includes. + +(TODO: file ticket about ignoring all braced includes) + +### Limit The Configuration + +By default configuration to analyze will be determined automatically for each file based on the code. The maximum amount is limited and can be controlled by CLI options. + +Depending on your setup you might want to limit it to specific configuration by using `-D` (CLI) or `--project-configuration=` (Visual Studio project). +When you are using a compilation database generated by CMake it is already using a fixed configuration. + +### Use Multiple Jobs + +By default only a single process/thread is being used. You might to scale this up using the `-j` CLI option. Please note that specifying a value that will max out your systems resources might have a detrimental effect. + +### Use A Different Threading Model + +When using multiple job for the analysis (see above) on Linux it will default to using processes. This is done so the analysis is not aborted prematurely aborted in case of a crash. +Unfortunately it has overhead because of a suboptimal implementation and the fact that data needs to be transferred from the child processes to the main process. +So if you do not require the additional safety you might want to switch to the usage of thread instead using `--executor=thread`. + +Note: For Windows binaries we currently do not provide the possibility of using processes so this does not apply. + +## Advanced Tuning + +### Re-order The Files + +Files which take longer to analyze should be processed at first so they might not extended the run time. As the order how the files provided on the CLI or via the project are being honored it is as simple as that. + +### Adjust Thresholds + +There are lots of internal thresholds which limit the work which is put into parts of the analysis. The defaults were chosen as a compromise of time being spent vs. issues being detected but not might not be a good fit in all cases. + +These thresholds are currently neither exposed nor documented so they cannot be changed without the modifying the source which is *highly discouraged*. + +They are being utilized internally by `-check-level` though (see below). + +(TODO: file ticket about providing all bailouts) +(TODO: file ticket about expose these) +(TODO: file ticket about specifying these per file) + +Note: As these will lead to less data being collected for the analysis it might lead to false negatives *and* false positives. + +### Adjust Check Level + +There are several check levels which are basically a collection of different threshold values (see above). This can be adjusted by the CLI option `--check-level`. + +Note: The current default is the lowest available check level. + +Note: As these will lead to less data being collected for the analysis it might lead to false negatives *and* false positives. + +## Reporting Issues + +If you encounter a file which has an unreasonable slow analysis please consider reporting this as an issue. + +Also consider reporting major upticks in the runtime of the analysis after updating to a newer version. Some of these might be expected as the analysis is constantly improved but out-of-the-box we still need aim for reasonable times. + +In all cases please try to provide a small reproducer if possible. + +Note: There might even be cases the analysis will never finish because it is stuck in a cycle. This is quite uncommon but there are still several unresolved known cases so it is possible to encounter this. + +### Known Issues + +https://trac.cppcheck.net/ticket/10663 +https://trac.cppcheck.net/ticket/10765 +https://trac.cppcheck.net/ticket/10778 +https://trac.cppcheck.net/ticket/11262 +https://trac.cppcheck.net/ticket/12528 +https://trac.cppcheck.net/ticket/13698 \ No newline at end of file diff --git a/addons/cppcheck.py b/addons/cppcheck.py index 1649815e070..735269d32c5 100644 --- a/addons/cppcheck.py +++ b/addons/cppcheck.py @@ -1,5 +1,7 @@ -import cppcheckdata, sys, os +import cppcheckdata +import sys +import os __checkers__ = [] diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py index 5340e3d5ade..b0e53161f3a 100755 --- a/addons/cppcheckdata.py +++ b/addons/cppcheckdata.py @@ -166,7 +166,7 @@ class ValueType: Attributes: type nonstd/pod/record/smart-pointer/container/iterator/void/bool/char/short/wchar_t/int/long/long long/unknown int/float/double/long double sign signed/unsigned - bits + bits bit count for bit-fields, otherwise None pointer constness reference @@ -178,7 +178,7 @@ class ValueType: type = None sign = None - bits = 0 + bits = None constness = 0 pointer = 0 typeScopeId = None @@ -188,7 +188,8 @@ class ValueType: def __init__(self, element): self.type = element.get('valueType-type') self.sign = element.get('valueType-sign') - self.bits = int(element.get('valueType-bits', 0)) + self.bits = element.get('valueType-bits', None) + self.bits = int(self.bits) if self.bits else None self.pointer = int(element.get('valueType-pointer', 0)) self.constness = int(element.get('valueType-constness', 0)) self.reference = element.get('valueType-reference') @@ -262,6 +263,7 @@ class Token: isComplex isRestrict isAttributeExport + isAnonymous varId varId for token, each variable has a unique non-zero id exprId exprId for token, each expression has a unique non-zero id variable Variable information for this token. See the Variable class. @@ -323,6 +325,7 @@ class Token: isComplex = False isRestrict = False isAttributeExport = False + isAnonymous = False exprId = None varId = None variableId = None @@ -406,6 +409,8 @@ def __init__(self, element): self.isRestrict = True if element.get('isAttributeExport'): self.isAttributeExport = True + if element.get('isAnonymous'): + self.isAnonymous = True self.linkId = element.get('link') self.link = None if element.get('varId'): @@ -439,7 +444,7 @@ def __repr__(self): "isChar", "isBoolean", "isOp", "isArithmeticalOp", "isAssignmentOp", "isComparisonOp", "isLogicalOp", "isCast", "externLang", "isExpandedMacro", "isRemovedVoidParameter", "isSplittedVarDeclComma", "isSplittedVarDeclEq", - "isImplicitInt", "isComplex", "isRestrict", "isAttributeExport", "linkId", + "isImplicitInt", "isComplex", "isRestrict", "isAttributeExport", "isAnonymous", "linkId", "varId", "variableId", "functionId", "valuesId", "valueType", "typeScopeId", "astParentId", "astOperand1Id", "file", "linenr", "column"] @@ -532,6 +537,7 @@ def tokAt(self, n): for i, t in enumerate(tl): if i == n: return t + return None def linkAt(self, n): token = self.tokAt(n) @@ -588,14 +594,14 @@ def __init__(self, element): self.bodyEnd = None self.nestedInId = element.get('nestedIn') self.nestedIn = None - self.nestedList = list() + self.nestedList = [] self.type = element.get('type') self.definedType = element.get('definedType') self.isExecutable = (self.type in ('Function', 'If', 'Else', 'For', 'While', 'Do', 'Switch', 'Try', 'Catch', 'Unconditional', 'Lambda')) - self.varlistId = list() - self.varlist = list() + self.varlistId = [] + self.varlist = [] def __repr__(self): attrs = ["Id", "className", "functionId", "bodyStartId", "bodyEndId", @@ -1217,6 +1223,7 @@ def __init__(self, filename): """ :param filename: Path to Cppcheck dump file """ + self.language = None self.filename = filename self.rawTokens = [] self.platform = None @@ -1233,6 +1240,8 @@ def __init__(self, filename): for event, node in ElementTree.iterparse(self.filename, events=('start', 'end')): if platform_done and rawtokens_done and suppressions_done: break + if node.tag == 'dumps': + self.language = node.get('language') if node.tag == 'platform' and event == 'start': self.platform = Platform(node) platform_done = True @@ -1293,7 +1302,7 @@ def iterconfigurations(self): if event == 'start': cfg = Configuration(node.get('cfg')) continue - elif event == 'end': + if event == 'end': cfg.setIdMap(cfg_arguments) yield cfg cfg = None @@ -1353,7 +1362,7 @@ def iterconfigurations(self): if event == 'start': cfg_function = Function(node, cfg.scopes[-1]) continue - elif event == 'end': + if event == 'end': cfg.functions.append(cfg_function) cfg_function = None @@ -1397,7 +1406,7 @@ def iterconfigurations(self): if event == 'start': cfg_valueflow = ValueFlow(node) continue - elif event == 'end': + if event == 'end': cfg.valueflow.append(cfg_valueflow) cfg_valueflow = None @@ -1593,8 +1602,7 @@ def __nonzero__(self): def __getattr__(self, k): if k in self._keys: return None - else: - raise AttributeError + raise AttributeError def bind_split(s): if '@' in s: @@ -1688,11 +1696,14 @@ def reportError(location, severity, message, addon, errorId, extra='', columnOve EXIT_CODE = 1 def reportSummary(dumpfile, summary_type, summary_data): - # dumpfile ends with ".dump" - ctu_info_file = dumpfile[:-4] + "ctu-info" - with open(ctu_info_file, 'at') as f: - msg = {'summary': summary_type, 'data': summary_data} - f.write(json.dumps(msg) + '\n') + msg = {'summary': summary_type, 'data': summary_data} + if '--cli' in sys.argv: + sys.stdout.write(json.dumps(msg) + '\n') + else: + # dumpfile ends with ".dump" + ctu_info_file = dumpfile[:-4] + "ctu-info" + with open(ctu_info_file, 'at') as f: + f.write(json.dumps(msg) + '\n') def get_path_premium_addon(): @@ -1708,8 +1719,9 @@ def get_path_premium_addon(): def cmd_output(cmd): with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p: - comm = p.communicate() - out = comm[0] - if p.returncode == 1 and len(comm[1]) > 2: - out = comm[1] - return out.decode(encoding='utf-8', errors='ignore') + stdout, stderr = p.communicate() + rc = p.returncode + out = stdout + if rc == 1 and len(stderr) > 2: + out = stderr + return out.decode(encoding='utf-8', errors='ignore') diff --git a/addons/misra.py b/addons/misra.py index fc68b0038d4..ca8eb2bfb69 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -1,14 +1,13 @@ #!/usr/bin/env python3 # -# MISRA C 2012 checkers -# Partially reused for "MISRA C++ 2008" checking +# MISRA C 2012 checkers (including amendment 1 and 2) # # Example usage of this addon (scan a sourcefile main.cpp) # cppcheck --dump main.cpp # python misra.py --rule-texts= main.cpp.dump # -# Limitations: This addon is released as open source. Rule texts can't be freely -# distributed. https://www.misra.org.uk/forum/viewtopic.php?f=56&t=1189 +# Limitations: This addon is released as open source. We are not allowed by +# MISRA to distribute rule texts openly. # # The MISRA standard documents may be obtained from https://www.misra.org.uk # @@ -46,7 +45,28 @@ def grouped(iterable, n): ['int', 'uint', 'int_least', 'uint_least', 'int_fast', 'uint_fast'], [8, 16, 32, 64])] +STDINT_H_DEFINES_MIN = ['%s%d_MIN' % (n, v) for n, v in itertools.product( + ['INT', 'INT_LEAST', 'INT_FAST',], + [8, 16, 32, 64])] + +STDINT_H_DEFINES_MAX = ['%s%d_MAX' % (n, v) for n, v in itertools.product( + ['INT', 'UINT','INT_LEAST','UINT_LEAST', 'INT_FAST', 'UINT_FAST',], + [8, 16, 32, 64])] + +STDINT_H_DEFINES_C = ['%s%d_C' % (n, v) for n, v in itertools.product( + ['INT', 'UINT'], + [8, 16, 32, 64])] + +INTTYPES_H_DEFINES = ['%s%d' % (n, v) for n, v in itertools.product( + ['PRId', 'PRIi', 'PRIo', 'PRIu', 'PRIx', 'PRIX', 'SCNd', + 'SCNi', 'SCNo', 'SCNu', 'SCNx', 'PRIdLEAST', 'PRIiLEAST', + 'PRIoLEAST', 'PRIuLEAST', 'PRIxLEAST', 'PRIXLEAST', + 'SCNdLEAST', 'SCNiLEAST', 'SCNoLEAST', 'SCNuLEAST', + 'SCNxLEAST', 'PRIdFAST', 'PRIiFAST', 'PRIoFAST', 'PRIuFAST', + 'PRIxFAST', 'PRIXFAST', 'SCNdFAST', 'SCNiFAST', 'SCNoFAST', + 'SCNuFAST', 'SCNxFAST', ], + [8, 16, 32, 64])] typeBits = { 'CHAR': None, 'SHORT': None, @@ -170,7 +190,8 @@ def rawlink(rawtoken): # Identifiers described in Section 7 "Library" of C99 Standard -# Based on ISO/IEC 9899 WF14/N1256 Annex B -- Library summary +# Based on ISO/IEC 9899:1999 (E) Annex B -- Library summary +# (https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) C99_STDLIB_IDENTIFIERS = { # B.1 Diagnostics 'assert.h': C90_STDLIB_IDENTIFIERS['assert.h'], @@ -221,9 +242,13 @@ def rawlink(rawtoken): 'float.h': C90_STDLIB_IDENTIFIERS['float.h'] + ['FLT_EVAL_METHOD'], # B.7 Format conversion of integer types 'inttypes.h': [ + 'PRIdMAX', 'PRIiMAX', 'PRIoMAX', 'PRIuMAX', 'PRIxMAX', 'PRIXMAX', + 'SCNdMAX', 'SCNiMAX', 'SCNoMAX', 'SCNuMAX', 'SCNxMAX', 'PRIdPTR', + 'PRIiPTR', 'PRIoPTR', 'PRIuPTR', 'PRIxPTR', 'PRIXPTR', 'SCNdPTR', + 'SCNiPTR', 'SCNoPTR', 'SCNuPTR', 'SCNxPTR', 'imaxdiv_t', 'imaxabs', 'imaxdiv', 'strtoimax', 'strtoumax', 'wcstoimax', 'wcstoumax', - ], + ] + INTTYPES_H_DEFINES, # B.8 Alternative spellings 'iso646.h': [ 'and', 'and_eq', 'bitand', 'bitor', 'compl', 'not', 'not_eq', @@ -247,11 +272,12 @@ def rawlink(rawtoken): 'acoshl', 'asinh', 'asinhf', 'asinhl', 'atanh', 'atanhf', 'atanhl', 'cosh', 'coshf', 'coshl', 'sinh', 'sinhf', 'sinhl', 'tanh', 'tanhf', 'tanhl', 'expf', 'expl', 'exp2', 'exp2f', 'exp2l', 'expm1', 'expm1f', - 'expm1l', 'frexpf', 'frexpl', 'ilogb', 'ilogbf', 'ilogbl', 'float', + 'expm1l', 'frexpf', 'frexpl', 'ilogb', 'ilogbf', 'ilogbl', 'ldexpf', 'ldexpl', 'logf', 'logl', 'log10f', 'log10l', 'log1p', 'log1pf', 'log1pl', 'log2', 'log2f', 'log2l', 'logb', 'logbf', 'logbl', 'modff', 'modfl', 'scalbn', 'scalbnf', 'scalbnl', 'scalbln', 'scalblnf', - 'scalblnl', 'hypotl', 'powf', 'powl', 'sqrtf', 'sqrtl', 'erf', 'erff', + 'scalblnl','cbrt', 'cbrtf','cbrtl', 'fabs', 'fabsf', 'fabsl', + 'hypotl', 'hypotf', 'powf', 'powl', 'sqrtf', 'sqrtl', 'erf', 'erff', 'erfl', 'erfc', 'erfcf', 'erfcl', 'lgamma', 'lgammaf', 'lgammal', 'tgamma', 'tgammaf', 'tgammal', 'ceilf', 'ceill', 'floorf', 'floorl', 'nearbyint', 'nearbyintf', 'nearbyintl', 'rint', 'rintf', 'rintl', @@ -262,7 +288,7 @@ def rawlink(rawtoken): 'remquol', 'copysign', 'copysignf', 'copysignl', 'nan', 'nanf', 'nanl', 'nextafter', 'nextafterf', 'nextafterl', 'nexttoward', 'nexttowardf', 'nexttowardl', 'fdim', 'fdimf', 'fdiml', 'fmax', - 'fmaxf', 'fmaxl', 'fmin', 'fminf', 'fminl', 'fmal', 'isgreater', + 'fmaxf', 'fmaxl', 'fmin', 'fminf', 'fminl', 'fmaf','fmal', 'isgreater', 'isgreaterequal', 'isless', 'islessequal', 'islessgreater', 'isunordered', ], @@ -285,11 +311,11 @@ def rawlink(rawtoken): 'UINTMAX_MAX', 'PTRDIFF_MIN', 'PTRDIFF_MAX', 'SIG_ATOMIC_MIN', 'SIG_ATOMIC_MAX', 'SIZE_MAX', 'WCHAR_MIN', 'WCHAR_MAX', 'WINT_MIN', 'WINT_MAX', 'INTN_C', 'UINTN_C', 'INTMAX_C', 'UINTMAX_C', - ] + STDINT_TYPES, + ] + STDINT_TYPES + STDINT_H_DEFINES_MIN + STDINT_H_DEFINES_MAX + STDINT_H_DEFINES_C, # B.18 Input/output 'stdio.h': C90_STDLIB_IDENTIFIERS['stdio.h'] + [ 'mode', 'restrict', 'snprintf', 'vfscanf', 'vscanf', - 'vsnprintf', 'vsscanf', + 'vsnprintf', 'vsscanf','ftell' ], # B.19 General utilities 'stdlib.h': C90_STDLIB_IDENTIFIERS['stdlib.h'] + [ @@ -318,28 +344,154 @@ def rawlink(rawtoken): 'vfwprintf', 'vfwscanf', 'vswprintf', 'vswscanf', 'vwprintf', 'vwscanf', 'wprintf', 'wscanf', 'fgetwc', 'fgetws', 'fputwc', 'fputws', 'fwide', 'getwc', 'getwchar', 'putwc', 'putwchar', 'ungetwc', 'wcstod', - 'wcstof', 'double', 'int', 'long', 'long', 'long', 'wcscpy', 'wcsncpy', - 'wmemcpy', 'wmemmove', 'wcscat', 'wcsncat', 'wcscmp', 'wcscoll', + 'wcstof', 'wcstold', 'wcstol', 'wcstoll', 'wcstoul', 'wcstoull', 'wcscpy', + 'wcsncpy', 'wmemcpy', 'wmemmove', 'wcscat', 'wcsncat', 'wcscmp', 'wcscoll', 'wcsncmp', 'wcsxfrm', 'wmemcmp', 'wcschr', 'wcscspn', 'wcspbrk', 'wcsrchr', 'wcsspn', 'wcsstr', 'wcstok', 'wmemchr', 'wcslen', 'wmemset', 'wcsftime', 'btowc', 'wctob', 'mbsinit', 'mbrlen', 'mbrtowc', 'wcrtomb', 'mbsrtowcs', 'wcsrtombs', ], + # B.24 Wide character classification and mapping utilities + 'wctype.h': ['wint_t', 'wctrans_t', 'wctype_t', 'WEOF', + 'iswalnum', 'iswalpha', 'iswblank', 'iswcntrl', 'iswdigit', + 'iswgraph', 'iswlower', 'iswprint', 'iswpunct', 'iswspace', 'iswupper', + 'iswxdigit', 'iswctype', 'wctype', 'towlower', 'towupper', 'towctrans', + 'wctrans'], } +# Identifiers described in Section 7 "Library" of C11 Standard +# Based on ISO/IEC 9899:201x N1570 (Draft 12.04.2011) Annex B -- Library summary +# (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf) +C11_STDLIB_IDENTIFIERS = { + # B.1 Diagnostics + 'assert.h': C99_STDLIB_IDENTIFIERS['assert.h']+ ['static_assert'], + # B.2 Complex + 'complex.h': C99_STDLIB_IDENTIFIERS['complex.h']+['__STDC_NO_COMPLEX__','CMPLX','CMPLXF','CMPLXL'], + # B.3 Character handling + 'ctype.h': C99_STDLIB_IDENTIFIERS['ctype.h'], + # B.4 Errors + 'errno.h': C99_STDLIB_IDENTIFIERS['errno.h']+['__STDC_WANT_LIB_EXT1__', 'errno_t'], + # B.5 Floating-point environment + 'fenv.h': C99_STDLIB_IDENTIFIERS['fenv.h'], + # B.6 Characteristics of floating types + 'float.h': C99_STDLIB_IDENTIFIERS['float.h']+[ + 'FLT_HAS_SUBNORM','DBL_HAS_SUBNORM','LDBL_HAS_SUBNORM', + 'FLT_DECIMAL_DIG','DBL_DECIMAL_DIG','LDBL_DECIMAL_DIG', + 'FLT_TRUE_MIN','DBL_TRUE_MIN','LDBL_TRUE_MIN'], + # B.7 Format conversion of integer types + 'inttypes.h': C99_STDLIB_IDENTIFIERS["inttypes.h"], + # B.8 Alternative spellings + 'iso646.h': C99_STDLIB_IDENTIFIERS["iso646.h"], + # B.9 Size of integer types + 'limits.h': C99_STDLIB_IDENTIFIERS['limits.h'], + # B.10 Localization + 'locale.h': C99_STDLIB_IDENTIFIERS['locale.h'], + # B.11 Mathematics + 'math.h': C99_STDLIB_IDENTIFIERS['math.h'], + # B.12 Nonlocal jumps + 'setjmp.h': C99_STDLIB_IDENTIFIERS['setjmp.h'], + # B.13 Signal handling + 'signal.h': C99_STDLIB_IDENTIFIERS['signal.h'], + # B.14 Alignment + 'stdalign.h': ['alignas','__alignas_is_defined'], + # B.15 Variable arguments + 'stdarg.h': C99_STDLIB_IDENTIFIERS['stdarg.h'], + # B.16 Atomics + 'stdatomic.h': ['ATOMIC_BOOL_LOCK_FREE', 'ATOMIC_CHAR_LOCK_FREE', + 'ATOMIC_CHAR16_T_LOCK_FREE', 'ATOMIC_CHAR32_T_LOCK_FREE', 'ATOMIC_WCHAR_T_LOCK_FREE', + 'ATOMIC_SHORT_LOCK_FREE', 'ATOMIC_INT_LOCK_FREE', 'ATOMIC_LONG_LOCK_FREE', + 'ATOMIC_LLONG_LOCK_FREE', 'ATOMIC_POINTER_LOCK_FREE', 'ATOMIC_FLAG_INIT', + 'memory_order', 'atomic_flag', 'memory_order_relaxed', 'memory_order_consume', + 'memory_order_acquire', 'memory_order_release', 'memory_order_acq_rel', 'memory_order_seq_cst', + 'atomic_bool', 'atomic_char', 'atomic_schar', 'atomic_uchar', 'atomic_short', 'atomic_ushort', + 'atomic_int', 'atomic_uint', 'atomic_long', 'atomic_ulong', 'atomic_llong', 'atomic_ullong', + 'atomic_char16_t', 'atomic_char32_t', 'atomic_wchar_t', 'atomic_int_least8_t', + 'atomic_uint_least8_t', 'atomic_int_least16_t', 'atomic_uint_least16_t', + 'atomic_int_least32_t', 'atomic_uint_least32_t', 'atomic_int_least64_t', + 'atomic_uint_least64_t', 'atomic_int_fast8_t', 'atomic_uint_fast8_t', + 'atomic_int_fast16_t', 'atomic_uint_fast16_t', 'atomic_int_fast32_t', + 'atomic_uint_fast32_t', 'atomic_int_fast64_t', 'atomic_uint_fast64_t', + 'atomic_intptr_t', 'atomic_uintptr_t', 'atomic_size_t', 'atomic_ptrdiff_t', + 'atomic_intmax_t', 'atomic_uintmax_t', 'ATOMIC_VAR_INIT', 'type kill_dependency', + 'atomic_thread_fence', 'atomic_signal_fence', 'atomic_is_lock_free', + 'atomic_store', 'atomic_store_explicit', 'atomic_load', 'atomic_load_explicit', + 'atomic_exchange', 'atomic_exchange_explicit', 'atomic_compare_exchange_strong', + 'atomic_compare_exchange_strong_explicit', 'atomic_compare_exchange_weak', + 'atomic_compare_exchange_weak_explicit', 'atomic_fetch_key', 'atomic_fetch_key_explicit', + 'atomic_flag_test_and_set', 'atomic_flag_test_and_set_explicit', + 'atomic_flag_clear', 'atomic_flag_clear_explicit', ], + # B.17 Boolean type and values + 'stdbool.h': C99_STDLIB_IDENTIFIERS['stdbool.h'], + # B.18 Common definitions + 'stddef.h': C99_STDLIB_IDENTIFIERS['stddef.h'] + + ['max_align_t','__STDC_WANT_LIB_EXT1__', 'rsize_t'], + # B.19 Integer types + 'stdint.h': C99_STDLIB_IDENTIFIERS['stdint.h']+ + ['__STDC_WANT_LIB_EXT1__', 'RSIZE_MAX'], + # B.20 Input/output + 'stdio.h': C99_STDLIB_IDENTIFIERS['stdio.h'] + + ['__STDC_WANT_LIB_EXT1__', 'L_tmpnam_s', 'TMP_MAX_S', 'errno_t', 'rsize_t', + 'tmpfile_s', 'tmpnam_s', 'fopen_s', 'freopen_s', 'fprintf_s', 'fscanf_s', + 'printf_s','scanf_s','snprintf_s','sprintf_s','sscanf_s','vfprintf_s', + 'vfscanf_s', 'vsprintf_s', 'vsscanf_s', 'gets_s' + ], + # B.21 General utilities + 'stdlib.h': C99_STDLIB_IDENTIFIERS['stdlib.h'] + + ['constraint_handler_t', 'set_constraint_handler_s', 'abort_handler_s', + 'ignore_handler_s', 'getenv_s', 'bsearch_s', 'qsort_s', 'wctomb_s', + 'mbstowcs_s', 'wcstombs_s'], + # B.22 Noretrun + 'stdnoreturn.h': ['noreturn'], + # B.23 String handling + 'string.h': C99_STDLIB_IDENTIFIERS['string.h'] + + ['memcpy_s', 'memmoce_s', 'strcpy_s', 'strncpy_s','strcat_s', + 'strtok_s', 'memset_s', 'strerror_s', 'strerrorlen_s', 'strnlen_s'], + # B.24 Type-generic math + 'tgmath.h': C99_STDLIB_IDENTIFIERS['tgmath.h'], + # B.25 Threads + 'threads.h': ['thread_local', 'ONCE_FLAG_INIT', 'TSS_DTOR_ITERATIONS', + 'cnd_t', 'thrd_t', 'tss_t', 'mtx_t', 'tss_dtor_t', 'thrd_start_t', + 'once_flag', 'mtx_plain', 'mtx_recursive', 'mtx_timed', 'thrd_timedout', + 'thrd_success', 'thrd_busy', 'thrd_error', 'thrd_nomem', 'call_once', + 'cnd_broadcast', 'cnd_destroy','cnd_init', 'cnd_signal', 'cnd_timedwait', + 'cnd_wait','mtx_destroy', 'mtx_init', 'mtx_lock', 'mtx_timedlock', + 'mtx_trylock', 'mtx_unlock', 'thrd_create', 'thrd_current', + 'thrd_detach', 'thrd_equal', 'thrd_exit', 'thrd_join', 'thrd_sleep', + 'thrd_yield', 'tss_create', 'tss_delete', 'tss_get', 'tss_set' ], + # B.26 Date and time + 'time.h': C99_STDLIB_IDENTIFIERS['time.h'] + [ + 'asctime_s', 'ctime_s', 'gmtime_s', 'localtime_s' + ], + # B.27 Unicode utilities + 'uchar.h': ['mbstate_t', 'size_t', 'char16_t', 'char32_t', + 'mbrtoc16', 'c16rtomb', 'mbrtoc32', 'c32rtomb' + ], + # B.28 Extended multibyte/wide character utilities + 'wchar.h': C99_STDLIB_IDENTIFIERS["wchar.h"]+[ + 'fwprintf_s', 'fwscanf_s', 'snwprintf_s', 'swprintf_s', 'swscanf_s', + 'vfwprintf_s', 'vfwscanf_s', 'vsnwprintf_s', 'vswprintf_s', 'vswscanf_s', + 'vwprintf_s', 'vwscanf_s', 'wprintf_s', 'wscanf_s', 'wcscpy_s', 'wcsncpy_s', + 'wmemcpy_s', 'wmemmove_s', 'wcscat_s', 'wcsncat_s', 'wcstok_s', 'wcsnlen_s', + 'wcrtomb_s', 'mbsrtowcs_s', 'wcsrtombs_s', + ], + # B.29 Wide character classification and mapping utilities + 'wctype.h': C99_STDLIB_IDENTIFIERS['wctype.h'], +} -def isStdLibId(id_, standard='c99'): - id_lists = [] +def getStdLib(standard): if standard == 'c89': - id_lists = C90_STDLIB_IDENTIFIERS.values() - elif standard in ('c99', 'c11'): - id_lists = C99_STDLIB_IDENTIFIERS.values() + return C90_STDLIB_IDENTIFIERS + if standard == 'c99': + return C99_STDLIB_IDENTIFIERS + return C11_STDLIB_IDENTIFIERS + +def isStdLibId(id_, standard='c99'): + id_lists = getStdLib(standard).values() for l in id_lists: if id_ in l: return True return False - # Reserved keywords defined in ISO/IEC9899:1990 -- ch 6.1.1 C90_KEYWORDS = { 'auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'do', @@ -350,16 +502,23 @@ def isStdLibId(id_, standard='c99'): } -# Reserved keywords defined in ISO/IEC 9899 WF14/N1256 -- ch. 6.4.1 +# Reserved keywords defined in Section 6.4.1 "Language" of C99 Standard +# Based on ISO/IEC 9899:1999 (E) 6.4.1 Keywords +# Adding the expanding macros from Section 7 too +# (https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) C99_ADDED_KEYWORDS = { 'inline', 'restrict', '_Bool', '_Complex', '_Imaginary', 'bool', 'complex', 'imaginary' } +# Reserved keywords defined in Section 6.4.1 "Language" of C11 Standard +# Based on ISO/IEC 9899:201x N1570 (Draft 12.04.2011) 6.4.1 Keywords +# Adding the expanding macros from Section 7 too +# (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf) C11_ADDED_KEYWORDS = { '_Alignas', '_Alignof', '_Atomic', '_Generic', '_Noreturn', - '_Statis_assert', '_Thread_local' , - 'alignas', 'alignof', 'noreturn', 'static_assert' + '_Static_assert', '_Thread_local' , + 'alignas', 'alignof', 'noreturn', 'static_assert','thread_local' } def isKeyword(keyword, standard='c99'): @@ -601,8 +760,7 @@ def getEssentialType(expr): return e if bitsOfEssentialType(e2) >= bitsOfEssentialType(e1): return e2 - else: - return e1 + return e1 elif expr.str == "~": e1 = getEssentialType(expr.astOperand1) @@ -830,6 +988,7 @@ def isFloatCounterInWhileLoop(whileToken): lpar = whileToken.next rpar = lpar.link counterTokens = findCounterTokens(lpar.astOperand2) + tok_varid = tuple(tok.varId for tok in counterTokens if tok.varId) whileBodyStart = None if simpleMatch(rpar, ') {'): whileBodyStart = rpar.next @@ -840,13 +999,21 @@ def isFloatCounterInWhileLoop(whileToken): token = whileBodyStart while token != whileBodyStart.link: token = token.next - for counterToken in counterTokens: - if not counterToken.valueType or not counterToken.valueType.isFloat(): - continue - if token.isAssignmentOp and token.astOperand1.str == counterToken.str: + if not token.varId: + continue + if token.varId not in tok_varid: + continue + if not token.astParent or not token.valueType or not token.valueType.isFloat(): + continue + parent = token.astParent + if parent.str in ('++', '--'): + return True + while parent: + if parent.isAssignmentOp and parent.str != "=" and parent.astOperand1 == token: return True - if token.str == counterToken.str and token.astParent and token.astParent.str in ('++', '--'): + if parent.str == "=" and parent.astOperand1.str == token.str and parent.astOperand1 != token: return True + parent = parent.astParent return False @@ -1284,7 +1451,7 @@ def remove_file_prefix(file_path, prefix): return result -class Rule(object): +class Rule(): """Class to keep rule text and metadata""" MISRA_SEVERITY_LEVELS = ['Required', 'Mandatory', 'Advisory'] @@ -1318,7 +1485,7 @@ def __repr__(self): return "%d.%d (%s)" % (self.num1, self.num2, self.misra_severity) -class MisraSettings(object): +class MisraSettings(): """Hold settings for misra.py script.""" __slots__ = ["verify", "quiet", "show_summary"] @@ -1359,17 +1526,17 @@ def __init__(self, settings, stdversion="c89"): self.settings = settings # Test validation rules lists - self.verify_expected = list() - self.verify_actual = list() + self.verify_expected = [] + self.verify_actual = [] # List of formatted violation messages - self.violations = dict() + self.violations = {} # if --rule-texts is specified this dictionary # is loaded with descriptions of each rule # by rule number (in hundreds). # ie rule 1.2 becomes 102 - self.ruleTexts = dict() + self.ruleTexts = {} self.ruleText_filename = None # Dictionary of dictionaries for rules to suppress @@ -1380,13 +1547,13 @@ def __init__(self, settings, stdversion="c89"): # or an item of None which indicates suppress rule for the entire file. # The line and symbol name tuple may have None as either of its elements but # should not be None for both. - self.suppressedRules = dict() + self.suppressedRules = {} # Prefix to ignore when matching suppression files. self.filePrefix = None # Number of all violations suppressed per rule - self.suppressionStats = dict() + self.suppressionStats = {} self.stdversion = stdversion @@ -1413,8 +1580,7 @@ def __repr__(self): def get_num_significant_naming_chars(self, cfg): if cfg.standards and cfg.standards.c == "c89": return 31 - else: - return 63 + return 63 def _save_ctu_summary_typedefs(self, dumpfile, typedef_info): if self._ctu_summary_typedefs: @@ -1541,7 +1707,7 @@ def misra_1_4(self, cfg): for token in cfg.tokenlist: if token.str in ('_Atomic', '_Noreturn', '_Generic', '_Thread_local', '_Alignas', '_Alignof'): self.reportError(token, 1, 4) - if token.str.endswith('_s') and isFunctionCall(token.next): + if token.str.endswith('_s') and isFunctionCall(token.next, cfg.standards.c): # See C specification C11 - Annex K, page 578 if token.str in ('tmpfile_s', 'tmpnam_s', 'fopen_s', 'freopen_s', 'fprintf_s', 'fscanf_s', 'printf_s', 'scanf_s', 'snprintf_s', 'sprintf_s', 'sscanf_s', 'vfprintf_s', 'vfscanf_s', 'vprintf_s', 'vscanf_s', @@ -1581,17 +1747,29 @@ def misra_2_4(self, dumpfile, cfg): self._save_ctu_summary_tagnames(dumpfile, cfg) def misra_2_5(self, dumpfile, cfg): - used_macros = list() + used_macros = [] + unused_macro = {} for m in cfg.macro_usage: used_macros.append(m.name) - summary = [] for directive in cfg.directives: - res = re.match(r'#define[ \t]+([a-zA-Z_][a-zA-Z_0-9]*).*', directive.str) - if res: - macro_name = res.group(1) - summary.append({'name': macro_name, 'used': (macro_name in used_macros), 'file': directive.file, 'line': directive.linenr, 'column': directive.column}) - if len(summary) > 0: - cppcheckdata.reportSummary(dumpfile, 'MisraMacro', summary) + res_define = re.match(r'#define[ \t]+([a-zA-Z_][a-zA-Z_0-9]*).*', directive.str) + res_undef = re.match(r'#undef[ \t]+([a-zA-Z_][a-zA-Z_0-9]*).*', directive.str) + if res_define: + macro_name = res_define.group(1) + unused_macro[macro_name] = {'name': macro_name, 'used': (macro_name in used_macros), + 'file': directive.file, 'line': directive.linenr, 'column': directive.column} + elif res_undef: + macro_name = res_undef.group(1) + # assuming that if we have #undef, we also have #define somewhere + if macro_name in unused_macro: + unused_macro[macro_name]['used'] = True + else: + unused_macro[macro_name] = {'name': macro_name, 'used': True, 'file': directive.file, + 'line': directive.linenr, 'column': directive.column} + used_macros.append(macro_name) + + if unused_macro: + cppcheckdata.reportSummary(dumpfile, 'MisraMacro', list(unused_macro.values())) def misra_2_7(self, data): for func in data.functions: @@ -1599,7 +1777,7 @@ def misra_2_7(self, data): if len(func.argument) == 0: continue # Setup list of function parameters - func_param_list = list() + func_param_list = [] for arg in func.argument: func_arg = func.argument[arg] if func_arg.typeStartToken and func_arg.typeStartToken.str == '...': @@ -1645,20 +1823,6 @@ def misra_3_1(self, rawTokens): self.reportError(token, 3, 1) break - def misra_3_2(self, rawTokens): - for token in rawTokens: - if token.str.startswith('//'): - # Check for comment ends with trigraph which might be replaced - # by a backslash. - if token.str.endswith('??/'): - self.reportError(token, 3, 2) - # Check for comment which has been merged with subsequent line - # because it ends with backslash. - # The last backslash is no more part of the comment token thus - # check if next token exists and compare line numbers. - elif (token.next is not None) and (token.linenr == token.next.linenr): - self.reportError(token, 3, 2) - def misra_4_1(self, rawTokens): for token in rawTokens: if (token.str[0] != '"') and (token.str[0] != '\''): @@ -1685,8 +1849,7 @@ def misra_4_1(self, rawTokens): if (isHexEscapeSequence(sequence) or isOctalEscapeSequence(sequence) or isSimpleEscapeSequence(sequence)): continue - else: - self.reportError(token, 4, 1) + self.reportError(token, 4, 1) def misra_4_2(self, rawTokens): for token in rawTokens: @@ -1840,7 +2003,7 @@ def misra_6_1(self, data): for token in data.tokenlist: if not token.valueType: continue - if token.valueType.bits == 0: + if token.valueType.bits is None: continue if not token.variable: continue @@ -1897,7 +2060,9 @@ def misra_7_2(self, data): self.reportError(token, 7, 2) def misra_7_3(self, rawTokens): - compiled = re.compile(r'^[0-9.]+[Uu]*l+[Uu]*$') + # Match decimal digits, hex digits, decimal point, and e/E p/P floating + # point constant exponent separators. + compiled = re.compile(r'^(0[xX])?[0-9a-fA-FpP.]+[Uu]*l+[Uu]*$') for tok in rawTokens: if compiled.match(tok.str): self.reportError(tok, 7, 3) @@ -1925,7 +2090,7 @@ def reportErrorIfVariableIsNotConst(variable, stringLiteral): self.reportError(token, 7, 4) # Check use as function parameter - if isFunctionCall(token) and token.astOperand1 and token.astOperand1.function: + if isFunctionCall(token, data.standards.c) and token.astOperand1 and token.astOperand1.function: functionDeclaration = token.astOperand1.function if functionDeclaration.tokenDef: @@ -2750,10 +2915,10 @@ def misra_12_3(self, data): if prev.str == ';': self.reportError(token, 12, 3) break - elif prev.str in ')}]': - prev = prev.link - elif prev.str in '({[': + if prev.str in '({[': break + if prev.str in ')}]': + prev = prev.link prev = prev.previous def misra_12_4_check_expr(self, expr): @@ -2802,7 +2967,7 @@ def misra_12_4(self, cfg): while expr.str not in (";", "{", "}"): expr = expr.next continue - elif known_value == 0: + if known_value == 0: expr = expr.astOperand2 self.misra_12_4_check_expr(expr) @@ -2825,8 +2990,7 @@ def misra_13_1(self, data): if tn and tn.next and tn.next.str == '=': tn = tn.next.next continue - else: - break + break if tn.str == '.' and tn.next and tn.next.isName: tn = tn.next if tn.next and tn.next.str == '=': @@ -3141,15 +3305,15 @@ def misra_16_3(self, rawTokens): STATE_OK = 2 # a case/default is allowed (we have seen 'break;'/'comment'/'{'/attribute) STATE_SWITCH = 3 # walking through switch statement scope - define = None + directive = None state = STATE_NONE end_switch_token = None # end '}' for the switch scope for token in rawTokens: - if simpleMatch(token, '# define'): - define = token - if define: - if token.linenr != define.linenr: - define = None + if simpleMatch(token, '# define') or simpleMatch(token, '# pragma'): + directive = token + if directive: + if token.linenr != directive.linenr: + directive = None else: continue @@ -3215,7 +3379,7 @@ def misra_16_5(self, data): for token in data.tokenlist: if token.str != 'default': continue - if token.previous and token.previous.str == '{': + if token.previous and (token.previous.str == '{'): continue tok2 = token while tok2: @@ -3253,7 +3417,7 @@ def misra_16_7(self, data): def misra_17_1(self, data): for token in data.tokenlist: - if isFunctionCall(token) and token.astOperand1.str in ( + if isFunctionCall(token, data.standards.c) and token.astOperand1.str in ( 'va_list', 'va_arg', 'va_start', 'va_end', 'va_copy'): self.reportError(token, 17, 1) elif token.str == 'va_list': @@ -3310,22 +3474,23 @@ def find_recursive_call(search_for_function, direct_call, calls_map, visited=Non tok = tok.next def misra_17_3(self, cfg): + # Check for Clang warnings related to implicit function declarations for w in cfg.clang_warnings: if w['message'].endswith('[-Wimplicit-function-declaration]'): self.reportError(cppcheckdata.Location(w), 17, 3) + + # Additional check for implicit function calls in expressions for token in cfg.tokenlist: - if token.str not in ["while", "if"]: - continue - if token.next.str != "(": - continue - tok = token.next - end_token = token.next.link - while tok != end_token: - if tok.isName and tok.function is None and tok.valueType is None and tok.next.str == "(" and \ - tok.next.valueType is None and not isKeyword(tok.str) and not isStdLibId(tok.str): - self.reportError(tok, 17, 3) - break - tok = tok.next + if token.isName and token.function is None and token.valueType is None: + if token.next and token.next.str == "(" and token.next.valueType is None: + if token.next.next.str == "*" and \ + token.next.next.next.isName and token.next.next.next.valueType is not None and \ + token.next.next.next.valueType.pointer > 0 : + # this is a function pointer definition the tokens look like this int16_t ( * misra_8_2_p_a ) () + # and the int16_t causes the detection as the '(' follows + continue + if not isKeyword(token.str,cfg.standards.c) and not isStdLibId(token.str,cfg.standards.c): + self.reportError(token, 17, 3) def misra_config(self, data): for var in data.variables: @@ -3375,7 +3540,7 @@ def misra_config(self, data): continue if tok.next.str == "(" or tok.str in ["EOF"]: continue - if isKeyword(tok.str) or isStdLibId(tok.str): + if isKeyword(tok.str, data.standards.c) or isStdLibId(tok.str, data.standards.c): continue if tok.astParent is None: continue @@ -3640,7 +3805,7 @@ def misra_20_9(self, cfg): break for s in cond.E.split(' '): if (s[0] >= 'A' and s[0] <= 'Z') or (s[0] >= 'a' and s[0] <= 'z'): - if isKeyword(s): + if isKeyword(s, cfg.standards.c): continue if s in defined: continue @@ -3774,7 +3939,7 @@ def misra_21_2(self, cfg): def misra_21_3(self, data): for token in data.tokenlist: - if isFunctionCall(token) and (token.astOperand1.str in ('malloc', 'calloc', 'realloc', 'free')): + if isFunctionCall(token, data.standards.c) and (token.astOperand1.str in ('malloc', 'calloc', 'realloc', 'free')): self.reportError(token, 21, 3) def misra_21_4(self, data): @@ -3788,21 +3953,22 @@ def misra_21_5(self, data): self.reportError(directive, 21, 5) def misra_21_6(self, data): - dir_stdio = findInclude(data.directives, '') - dir_wchar = findInclude(data.directives, '') - if dir_stdio: - self.reportError(dir_stdio, 21, 6) - if dir_wchar: - self.reportError(dir_wchar, 21, 6) + for token in data.tokenlist: + if not isFunctionCall(token) or token.previous.function: + continue + standard_id = getStdLib(data.standards.c) + funcname = token.previous.str + if funcname in standard_id.get("stdio.h", []) or funcname in standard_id.get("wchar.h", []): + self.reportError(token, 21, 6) def misra_21_7(self, data): for token in data.tokenlist: - if isFunctionCall(token) and (token.astOperand1.str in ('atof', 'atoi', 'atol', 'atoll')): + if isFunctionCall(token, data.standards.c) and (token.astOperand1.str in ('atof', 'atoi', 'atol', 'atoll')): self.reportError(token, 21, 7) def misra_21_8(self, data): for token in data.tokenlist: - if isFunctionCall(token) and (token.astOperand1.str in ('abort', 'exit', 'getenv')): + if isFunctionCall(token, data.standards.c) and (token.astOperand1.str in ('abort', 'exit', 'getenv')): self.reportError(token, 21, 8) def misra_21_9(self, data): @@ -3829,7 +3995,7 @@ def misra_21_12(self, data): for token in data.tokenlist: if token.str == 'fexcept_t' and token.isName: self.reportError(token, 21, 12) - if isFunctionCall(token) and (token.astOperand1.str in ( + if isFunctionCall(token, data.standards.c) and (token.astOperand1.str in ( 'feclearexcept', 'fegetexceptflag', 'feraiseexcept', @@ -3841,7 +4007,7 @@ def misra_21_14(self, data): # buffers used in strcpy/strlen/etc function calls string_buffers = [] for token in data.tokenlist: - if token.str[0] == 's' and isFunctionCall(token.next): + if token.str[0] == 's' and isFunctionCall(token.next, data.standards.c): name, args = cppcheckdata.get_function_call_name_args(token) if name is None: continue @@ -4079,8 +4245,7 @@ def get_violations(self, violation_type=None): """Return the list of violations for a normal checker run""" if violation_type is None: return self.violations.items() - else: - return self.violations[violation_type] + return self.violations[violation_type] def get_violation_types(self): """Return the list of violations for a normal checker run""" @@ -4120,10 +4285,10 @@ def addSuppressedRule(self, ruleNum, # If the rule is not in the dict already then add it if ruleNum not in self.suppressedRules: - ruleItemList = list() + ruleItemList = [] ruleItemList.append(line_symbol) - fileDict = dict() + fileDict = {} fileDict[normalized_filename] = ruleItemList self.suppressedRules[ruleNum] = fileDict @@ -4139,7 +4304,7 @@ def addSuppressedRule(self, ruleNum, # If the filename is not in the dict already add it if normalized_filename not in fileDict: - ruleItemList = list() + ruleItemList = [] ruleItemList.append(line_symbol) fileDict[normalized_filename] = ruleItemList @@ -4243,7 +4408,7 @@ def showSuppressedRules(self): Print out rules in suppression list sorted by Rule Number """ print("Suppressed Rules List:") - outlist = list() + outlist = [] for ruleNum in self.suppressedRules: fileDict = self.suppressedRules[ruleNum] @@ -4350,9 +4515,8 @@ def loadRuleTexts(self, filename): num1 = 0 num2 = 0 appendixA = False - expect_more = False - Rule_pattern = re.compile(r'^Rule ([0-9]+).([0-9]+)') + Rule_pattern = re.compile(r'^Rule ([0-9]+)\.([0-9]+)') severity_pattern = re.compile(r'.*[ ]*(Advisory|Required|Mandatory)$') xA_Z_pattern = re.compile(r'^[#A-Z].*') a_z_pattern = re.compile(r'^[a-z].*') @@ -4380,12 +4544,13 @@ def loadRuleTexts(self, filename): file_stream = open(filename, 'rt') rule = None - have_severity = False - severity_loc = 0 + rule_line_number = 0 for line in file_stream: - line = line.replace('\r', '').replace('\n', '') + line = line.strip() + if len(line) == 0: + continue if not appendixA: if line.find('Appendix A') >= 0 and line.find('Summary of guidelines') >= 10: @@ -4393,57 +4558,48 @@ def loadRuleTexts(self, filename): continue if line.find('Appendix B') >= 0: break - if len(line) == 0: - continue # Parse rule declaration. res = Rule_pattern.match(line) if res: - have_severity = False - expect_more = False - severity_loc = 0 + rule_line_number = 0 num1 = int(res.group(1)) num2 = int(res.group(2)) rule = Rule(num1, num2) - if not have_severity and rule is not None: res = severity_pattern.match(line) - if res: rule.misra_severity = res.group(1) - have_severity = True - else: - severity_loc += 1 - - # Only look for severity on the Rule line - # or the next non-blank line after - # If it's not in either of those locations then - # assume a severity was not provided. - - if severity_loc < 2: - continue - else: - rule.misra_severity = '' - have_severity = True + rule_line_number = 1 + continue if rule is None: continue - # Parse continuing of rule text. - if expect_more: - if a_z_pattern.match(line): - self.ruleTexts[rule.num].text += ' ' + line + rule_line_number += 1 + + if rule_line_number == 1: + res = severity_pattern.match(line) + + if res: + rule.misra_severity = res.group(1) continue - expect_more = False - continue + rule_line_number = 2 # Parse beginning of rule text. - if xA_Z_pattern.match(line): - rule.text = line + if not rule.text and xA_Z_pattern.match(line): + rule.text = line.strip() self.ruleTexts[rule.num] = rule - expect_more = True + continue + + # Parse continuing of rule text. + if a_z_pattern.match(line): + self.ruleTexts[rule.num].text += ' ' + line.strip() + continue + + rule = None file_stream.close() @@ -4531,7 +4687,7 @@ def fillVerifyExpected(verify_expected, tok): else: self.printStatus('Checking ' + dumpfile + '...') - self.is_cpp = data.files and data.files[0].endswith('.cpp') + self.is_cpp = data.language == 'cpp' for cfgNumber, cfg in enumerate(data.iterconfigurations()): if not self.settings.quiet: @@ -4548,7 +4704,7 @@ def fillVerifyExpected(verify_expected, tok): # data.rawTokens is same for all configurations if cfgNumber == 0: self.executeCheck(301, self.misra_3_1, data.rawTokens) - self.executeCheck(302, self.misra_3_2, data.rawTokens) + #self.executeCheck(302, self.misra_3_2, data.rawTokens) self.executeCheck(401, self.misra_4_1, data.rawTokens) self.executeCheck(402, self.misra_4_2, data.rawTokens) self.executeCheck(501, self.misra_5_1, cfg) diff --git a/addons/misra_9.py b/addons/misra_9.py index 7f8e33ac245..1ca1b7ce3e0 100644 --- a/addons/misra_9.py +++ b/addons/misra_9.py @@ -138,8 +138,7 @@ def getChildByValueElement(self, ed): def getEffectiveLevel(self): if self.parent and self.parent.elementType == "array": return self.parent.getEffectiveLevel() + 1 - else: - return 0 + return 0 def setInitialized(self, designated=False, positional=False): if designated: @@ -201,11 +200,10 @@ def isMisra93Compliant(self): self.isOnlyDesignated()) and all([not (child.isDesignated or child.isPositional) or child.isMisra93Compliant() for child in self.children])) return result - elif self.elementType == 'record': + if self.elementType == 'record': result = all([child.isMisra93Compliant() for child in self.children]) return result - else: - return True + return True def isMisra94Compliant(self): return self.numInits <= 1 and all([child.isMisra94Compliant() for child in self.children]) @@ -378,22 +376,22 @@ def unwindAndContinue(self): self.token = self.token.astParent.astOperand2 break - else: - self.token = self.token.astParent - if self.token.str == '{': - if self.root: - self.ed = self.root.getLastValueElement() - self.ed.markAsCurrent() - # Cleanup if root is dummy node representing excess levels in initializer - if self.root.name == '<-': - self.root.children[0].parent = self.root.parent + self.token = self.token.astParent + if self.token.str == '{': + if self.root: + self.ed = self.root.getLastValueElement() + self.ed.markAsCurrent() - self.root = self.root.parent + # Cleanup if root is dummy node representing excess levels in initializer + if self.root.name == '<-': + self.root.children[0].parent = self.root.parent - if self.token.astParent is None: - self.token = None - break + self.root = self.root.parent + + if self.token.astParent is None: + self.token = None + break def misra_9_x(self, data, rule, rawTokens = None): @@ -519,7 +517,7 @@ def createRecordChildrenDefs(ed, var): child = getElementDef(variable.nameToken) ed1.addChild(child) child_dict[scopes.bodyStart] = ed1 - sorted_keys = sorted(list(child_dict.keys()), key=lambda k: "%s %s %s" % (k.file, k.linenr, k.column)) + sorted_keys = sorted(list(child_dict.keys()), key=lambda k: (k.file, k.linenr, k.column)) for _key in sorted_keys: ed.addChild(child_dict[_key]) diff --git a/addons/naming.py b/addons/naming.py index 948f158b6f4..2893779f2e0 100755 --- a/addons/naming.py +++ b/addons/naming.py @@ -17,7 +17,7 @@ def validate_regex(expr): re.compile(expr) except re.error: print('Error: "{}" is not a valid regular expression.'.format(expr)) - exit(1) + sys.exit(1) RE_VARNAME = None @@ -37,6 +37,7 @@ def validate_regex(expr): elif arg[:11] == '--function=': RE_FUNCTIONNAME = arg[11:] validate_regex(RE_FUNCTIONNAME) + # TODO: bail out on unknown parameter def reportError(token, severity, msg, errorId): diff --git a/addons/runaddon.py b/addons/runaddon.py index 536abe864f7..26ad7e9fa73 100644 --- a/addons/runaddon.py +++ b/addons/runaddon.py @@ -1,4 +1,8 @@ -import cppcheckdata, cppcheck, runpy, sys, os +import cppcheckdata +import cppcheck +import runpy +import sys +import os if __name__ == '__main__': addon = sys.argv[1] diff --git a/addons/test/misra/crash12.c b/addons/test/misra/crash12.c new file mode 100644 index 00000000000..b16198ea2e7 --- /dev/null +++ b/addons/test/misra/crash12.c @@ -0,0 +1,33 @@ +// 13140 +#line 78 "tmp.h" +typedef struct +{ +int vara [30] ; +int varb [5] ; +} S0 ; + + + +typedef struct +{ +bool var1 ; +S2 var2 ; +S2 var3 ; +S2 var4 ; +short var5 ; +short var6 ; +S1 var7 ; +S1 var8 ; +S1 var9 ; +S1 var10 ; +S1 var11 ; +float var12 ; +short var13 [ 3 ] ; +} S3 ; + +#line 33 "tmp.c" +static const S3 s3 = +{ +0 , +{ 0, 0 } , +} ; \ No newline at end of file diff --git a/addons/test/misra/misra-ctu-1-test.c b/addons/test/misra/misra-ctu-1-test.c index 45c963de925..a003e66ae01 100644 --- a/addons/test/misra/misra-ctu-1-test.c +++ b/addons/test/misra/misra-ctu-1-test.c @@ -7,6 +7,9 @@ extern MISRA_2_3_A misra_2_3_a; x = MISRA_2_5_OK_1; +// cppcheck-suppress misra-c2012-20.5 +#undef MISRA_2_5_OK_3 + // cppcheck-suppress misra-c2012-2.3 // cppcheck-suppress misra-c2012-5.6 typedef int MISRA_5_6_VIOLATION; diff --git a/addons/test/misra/misra-ctu-test.h b/addons/test/misra/misra-ctu-test.h index f9a3f680945..803e850b1f2 100644 --- a/addons/test/misra/misra-ctu-test.h +++ b/addons/test/misra/misra-ctu-test.h @@ -21,3 +21,4 @@ void misra_8_7_external(void); // #12362 extern void misra_8_7_compliant( void ); +#define MISRA_2_5_OK_3 This \ No newline at end of file diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index 67ffc8e5e30..2435dcf253a 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -2,6 +2,8 @@ // ~/cppcheck/cppcheck --dump misra/misra-test.h --std=c89 // ~/cppcheck/cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64 && python3 ../misra.py -verify misra/misra-test.c.dump +#pragma ghs section rodata=default // no warning + #include "path\file.h" // 20.2 #include "file//.h" // 20.2 #include "file/*.h" // 20.2 @@ -35,8 +37,8 @@ #include // 21.4 #include // 21.5 -#include //21.6 -#include //21.6 +#include +#include #include // 21.10 #include // 21.11 #include @@ -68,7 +70,7 @@ static _Atomic int misra_1_4_var; // 1.4 static _Noreturn void misra_1_4_func(void) // 1.4 { if (0 != _Generic(misra_1_4_var)) {} // 1.4 17.3 - printf_s("hello"); // 1.4 + printf_s("hello"); // 1.4 17.3 } #define MISRA_2_2 (1*60) @@ -119,22 +121,6 @@ static void misra_2_7_b(int a, int b, int c, // 2.7 static void misra_2_7_c(int a, ...) { (void)a; } static void misra_2_7_d(int) { } // 2.7 8.2 -static void misra_3_2(int enable) -{ - // This won't generate a violation because of subsequent blank line \ - - int y = 0; - int x = 0; // 3.2 non-compliant comment ends with backslash \ - if (enable != 0) - { - ++x; // This is always executed - // 3.2 potentially non-compliant comment ends with trigraph resolved to backslash ??/ - ++y; // This is hidden if trigraph replacement is active - } - - (void)printf("x=%i, y=%i\n", x, y); -} - extern int misra_5_1_extern_var_hides_var_x; extern int misra_5_1_extern_var_hides_var_y; //5.1 int misra_5_1_var_hides_var________a; // 8.4 @@ -152,7 +138,7 @@ static void misra_5_2_function_hides_var_31y(void) {}//5.2 static void foo(void) { int i; - switch(misra_5_2_func1()) //16.4 16.6 + switch(misra_5_2_func1()) //16.4 16.6 17.3 { case 1: { @@ -207,9 +193,9 @@ int c41_15 = 'a'; // 10.3 8.4 static void misra_4_1(void) { - (void)printf("\x41g"); // 4.1 - (void)printf("\x41\x42"); - (void)printf("\x41" "g"); + (void)printf("\x41g"); // 4.1 21.6 + (void)printf("\x41\x42"); //21.6 + (void)printf("\x41" "g"); //21.6 } const char *s42_1 = "String containing trigraphs ??-??-??"; // 4.2 8.4 @@ -218,8 +204,8 @@ const char *s42_3 = "No trigraph?(?'?)"; // 8.4 static void misra_4_2(void) { - (void)printf("??=Trigraph\n"); // 4.2 - (void)printf("No?/Trigraph\n"); + (void)printf("??=Trigraph\n"); // 4.2 21.6 + (void)printf("No?/Trigraph\n"); //21.6 } #define misra_5_4_macro_hides_macro__31x 1 @@ -246,7 +232,7 @@ int x; }; static void misra_5_5_func1(void) { - switch(misra_5_5_func2()) //16.4 16.6 + switch(misra_5_5_func2()) //16.4 16.6 17.3 { case 1: { @@ -300,6 +286,20 @@ struct misra_7_3_s { uint32_t ul_clka; uint32_t test123l; + float t = 6.02E23l; // 7.3 + float t1 = 6.02E23L; + float u = 0xa1B2.p12l; // 7.3 + float u1 = 0xa1B2.p12L; + float v = 0xa1B2.P12l; // 7.3 + float v1 = 0xa1B2.P12L; + float w = 6.02e23l; // 7.3 + float w1 = 6.02e23L; + unsigned long x = 0xabcul; // 7.3 + unsigned long x1 = 0xabcuL; + unsigned long y = 0xABCUl; // 7.3 + unsigned long y1 = 0xABCUL; + unsigned long z = 0XdeadBeEfUl; // 7.3 + unsigned long z1 = 0XdeadBeEfUL; }; static void misra_7_3(void) { @@ -678,21 +678,21 @@ static void misra_10_1_ternary(void) int16_t i16; a = ui16 << ui16; // 10.6 - a = ui16 << (get_bool(42) ? ui16 : ui16); - a = ui16 << (get_bool(42) ? ui16 : (get_bool(34) ? ui16 : ui16)); - a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : ui16) : ui16); - a = ui16 << (get_bool(42) ? i16 : (get_bool(34) ? ui16 : ui16)); // 10.1 10.4 - a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : i16) : ui16); // 10.1 10.4 - a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : ui16) : i16); // 10.1 10.4 - a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8); // 10.4 - a = ui16 << (get_bool(42) ? (get_bool(34) ? i16 : ui8) : ui8); // 10.1 10.4 - a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8) << ui16; // 10.4 - a = (get_bool(42) ? (get_bool(34) ? i16 : ui8) : ui8) << ui16; // 10.1 10.4 - a = (get_bool(42) ? (get_bool(34) ? ui16 : i8) : ui8) << ui16; // 10.1 10.4 - a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : i8) << ui16; // 10.1 - a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8) << (get_bool(19) ? ui16 : ui8); // 10.4 - a = (get_bool(42) ? (get_bool(34) ? i16 : ui8) : ui8) << (get_bool(19) ? ui16 : ui8); // 10.1 10.4 - a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8) << (get_bool(19) ? i16 : ui8); // 10.1 10.4 + a = ui16 << (get_bool(42) ? ui16 : ui16); // 17.3 + a = ui16 << (get_bool(42) ? ui16 : (get_bool(34) ? ui16 : ui16)); // 17.3 + a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : ui16) : ui16); // 17.3 + a = ui16 << (get_bool(42) ? i16 : (get_bool(34) ? ui16 : ui16)); // 10.1 10.4 17.3 + a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : i16) : ui16); // 10.1 10.4 17.3 + a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : ui16) : i16); // 10.1 10.4 17.3 + a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8); // 10.4 17.3 + a = ui16 << (get_bool(42) ? (get_bool(34) ? i16 : ui8) : ui8); // 10.1 10.4 17.3 + a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8) << ui16; // 10.4 17.3 + a = (get_bool(42) ? (get_bool(34) ? i16 : ui8) : ui8) << ui16; // 10.1 10.4 17.3 + a = (get_bool(42) ? (get_bool(34) ? ui16 : i8) : ui8) << ui16; // 10.1 10.4 17.3 + a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : i8) << ui16; // 10.1 17.3 + a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8) << (get_bool(19) ? ui16 : ui8); // 10.4 17.3 + a = (get_bool(42) ? (get_bool(34) ? i16 : ui8) : ui8) << (get_bool(19) ? ui16 : ui8); // 10.1 10.4 17.3 + a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8) << (get_bool(19) ? i16 : ui8); // 10.1 10.4 17.3 } static void misra_10_2(void) { @@ -725,7 +725,7 @@ static void misra_10_3(uint32_t u32a, uint32_t u32b) { res = 0.1f; // 10.3 const char c = '0'; // no-warning bool b = true; // no-warning - uint32_t u = UINT32_C(10); // no-warning + uint32_t u = UINT32_C(10); // 17.3 no-warning } static void misra_10_4(u32 x, s32 y) { @@ -797,7 +797,7 @@ static void misra_10_7(uint16_t u16a, uint16_t u16b) { res = u32a * (u16a + u16b); // 10.7 u32a *= u16a + u16b; // 10.7 u32a = ((uint32_t)4 * (uint32_t)2 * (uint32_t)4 ); // no-warning (#10488) - dostuff(&t, (2*60*1000)); // no-warning + dostuff(&t, (2*60*1000)); // 17.3 no-warning } static void misra_10_8(u8 x, s32 a, s32 b) { @@ -963,9 +963,9 @@ void misra_12_3(int a, int b, int c) { int a41 = MISRA_12_3_FN3_2(a34, a35), a42; // 12.3 int a43, a44 = MISRA_12_3_FN3_2(a34, a35); // 12.3 - MISRA_12_3_FN3_2_MSG(fprintf(stderr, "test\n")); // 12.3 - - f((1,2),3); // TODO + MISRA_12_3_FN3_2_MSG(fprintf(stderr, "test\n")); // 12.3 21.6 + // TODO + f((1,2),3); // 17.3 // third clause: 2 persistent side effects instead of 1 (14.2) for (i=0; i<10; i++, j++){} // 12.3 14.2 @@ -979,8 +979,8 @@ void misra_12_3(int a, int b, int c) { misra_12_3_fn4(misra_12_3_fn7(&a1, 32), &a1); misra_12_3_fn6(misra_12_3_fn5(&a1, 32), &a1); misra_12_3_fn6(misra_12_3_fn7(&a1, 32), &a1); - misra_12_3_fn7(maxlen, fn(va, unsigned long), false); - misra_12_3_fn8(maxlen, (unsigned long)((uintptr_t)fn(va, void*)), false); + misra_12_3_fn7(maxlen, fn(va, unsigned long), false); // 17.3 + misra_12_3_fn8(maxlen, (unsigned long)((uintptr_t)fn(va, void*)), false); // 17.3 const struct fun_t { @@ -1231,7 +1231,34 @@ static void misra_14_1(void) { } while ( a < 10.0f ); // no-warning } +//13143 +static bool misra_14_1_is_increasing (const double* const x, const size_t n) +{ + double last = -INFINITY; + size_t i = ((size_t) 0); + while ((i < n) && isfinite(x[i]) && (x[i] > last)) { //no-warning for 14_1 + last = x[i]; + i++; + } + return i == n; +} + +static void misra_14_1_compliant1_foo(float x){ + int i = 0; + while(i < x){ // 10.4 + i += x + x; // 10.3 10.4 no-warning for 14_1 + } +} +static void misra_14_1_compliant2_foo(void){ + int i = 0; + float f = 0f; + while (f < 10 && i < 10) { //10.4 12.1 + float f = 0f; + f = f + i; // 10.3 10.4 no warning for 14_1 + i++; + } +} static void misra_14_2_init_value(int32_t *var) { *var = 0; } @@ -1239,7 +1266,7 @@ static void misra_14_2_init_value_1(int32_t *var); static void misra_14_2_fn1(bool b) { for (;i++<10;) {} // 14.2 - for (;i<10;dostuff()) {} // 14.2 + for (;i<10;dostuff()) {} // 14.2 17.3 int32_t g = 0; int g_arr[42]; g += 2; // no-warning @@ -1257,7 +1284,7 @@ static void misra_14_2_fn1(bool b) { int i2; for (misra_14_2_init_value(&i1); i1 < 10; ++i1) {} // no-warning for (misra_14_2_init_value_1(&i2); i2 < 10; ++i2) {} // no-warning - for (misra_14_2_init_value_2(&i2); i2 < 10; ++i2) {} // no-warning + for (misra_14_2_init_value_2(&i2); i2 < 10; ++i2) {} // 17.3 no-warning bool abort = false; for (i = 0; (i < 10) && !abort; ++i) { // 14.2 as 'i' is not a variable @@ -1747,7 +1774,7 @@ static void misra_17_1(void) { va_arg(); // 17.1 va_start(); // 17.1 va_end(); // 17.1 - va_copy(); // 17.1 + va_copy(); // 17.1 17.3 } static void misra_17_2_ok_1(void) { ; } @@ -1778,8 +1805,15 @@ static void misra_17_2_5(void) { } bool (*dostuff)(); //8.2 8.4 +struct s173{ + int a; + int b; +} static void misra_17_3(void) { - if (dostuff()) {} + if (dostuff()) {} // no-warning + bool a = dostuff(); // no-warning + dostuff2(); // 17.3 + s173 ( *misra_8_2_p_a ) (void); // no-warning } static void misra_config(const char* str) { @@ -1925,7 +1959,7 @@ static int misra_21_1(void) { int _a = 42; // no warning: only directives affected errno = EINVAL; // no warning _a ++; // no warning - _exit(1); // no warning + _exit(1); // 17.3 no warning return _a; // no warning } static int _misra_21_1_2(void); // no warning diff --git a/addons/test/misra/misra_rules_structure.txt b/addons/test/misra/misra_rules_structure.txt index 41d2d456f85..a8223fde948 100644 --- a/addons/test/misra/misra_rules_structure.txt +++ b/addons/test/misra/misra_rules_structure.txt @@ -11,7 +11,10 @@ Here we go: Appendix A Summary of guidelines Rule 1.2 -Rule text. + Rule text. + +Rule 2.1 +Rule text for 2.1. Stop parsing after this line: Appendix B diff --git a/addons/test/misra_test.py b/addons/test/misra_test.py index 9285087993e..55a24cb4b27 100644 --- a/addons/test/misra_test.py +++ b/addons/test/misra_test.py @@ -1,20 +1,16 @@ -# Running the test with Python 2: -# Be sure to install pytest version 4.6.4 (newer should also work) -# Command in cppcheck directory: -# python -m pytest addons/test/test-misra.py -# # Running the test with Python 3: # Command in cppcheck directory: -# PYTHONPATH=./addons python3 -m pytest addons/test/test-misra.py +# PYTHONPATH=./addons python3 -m pytest addons/test/misra_test.py import pytest import re import sys +import os from .util import dump_create, dump_remove, convert_json_output +from addons.misra import C11_STDLIB_IDENTIFIERS, C99_STDLIB_IDENTIFIERS,C90_STDLIB_IDENTIFIERS, isStdLibId, isKeyword - -TEST_SOURCE_FILES = ['./addons/test/misra/misra-test.c'] +TEST_SOURCE_FILES = [os.path.join('addons','test','misra','misra-test.c')] def remove_misra_config(s:str): @@ -34,6 +30,7 @@ def checker(): return MisraChecker(settings) +# FIXME: files are generates in the source tree so it will cause issues if tests are run with xdist. @pytest.fixture def test_files(): for f in TEST_SOURCE_FILES: @@ -48,6 +45,8 @@ def test_loadRuleTexts_structure(checker): assert(checker.ruleTexts.get(101, None) is None) assert(checker.ruleTexts[102].text == "Rule text.") assert(checker.ruleTexts.get(103, None) is None) + assert(checker.ruleTexts[201].text == "Rule text for 2.1.") + assert(checker.ruleTexts.get(202, None) is None) def test_loadRuleTexts_empty_lines(checker): @@ -62,7 +61,7 @@ def test_loadRuleTexts_mutiple_lines(checker): assert(checker.ruleTexts[102].text == "Multiple lines text.") assert(checker.ruleTexts[103].text == "Multiple lines text.") assert(checker.ruleTexts[104].text == "Should") - assert(checker.ruleTexts[105].text == "Should") + assert(checker.ruleTexts[105].text == "Should starts from lowercase letter.") assert(checker.ruleTexts[106].text == "Can contain empty lines.") @@ -119,7 +118,6 @@ def test_rules_suppression(checker, capsys): for src in test_sources: re_suppressed= r"\[%s\:[0-9]+\]" % src - dump_remove(src) dump_create(src, "--suppressions-list=addons/test/misra/suppressions.txt","--inline-suppr") checker.parseDump(src + ".dump") captured = capsys.readouterr().err @@ -173,3 +171,74 @@ def test_read_ctu_info_line(checker): assert checker.read_ctu_info_line('{"summary":"123"}') is None assert checker.read_ctu_info_line('{"data":123}') is None assert checker.read_ctu_info_line('{"summary":"123","data":123}') is not None + +def test_platform(checker): + test_file = os.path.join('addons','test','misra','misra-test.c') + dump_create(test_file, "--language=c++") + checker.parseDump(test_file + ".dump") + assert checker.is_cpp is True + + dump_create(test_file, "--language=c") + checker.parseDump(test_file + ".dump") + assert checker.is_cpp is False + +def test_std99_identifiers(): + for headerfile in C90_STDLIB_IDENTIFIERS: + for identifier in C90_STDLIB_IDENTIFIERS[headerfile]: + assert identifier in C99_STDLIB_IDENTIFIERS[headerfile], f"{identifier} of C90 not found in C99_STDLIB_IDENTIFIERS" + +def test_stdC11_identifiers(): + for headerfile in C90_STDLIB_IDENTIFIERS: + for identifier in C90_STDLIB_IDENTIFIERS[headerfile]: + assert identifier in C99_STDLIB_IDENTIFIERS[headerfile], f"{identifier} of C90 not found in C11_STDLIB_IDENTIFIERS" + for headerfile in C99_STDLIB_IDENTIFIERS: + for identifier in C99_STDLIB_IDENTIFIERS[headerfile]: + assert identifier in C11_STDLIB_IDENTIFIERS[headerfile], f"{identifier} of C99 not found in C11_STDLIB_IDENTIFIERS" + +def test_isStdLibId(): + # Check that Identifiers from C90 are correctly classified + assert isStdLibId("assert", 'c89') is True + assert isStdLibId("assert", 'c99') is True + assert isStdLibId("assert", 'c11') is True + assert isStdLibId("assert", 'c23') is True + + # Check that Identifiers from C99 are correctly classified + assert isStdLibId("UINT32_C", 'c89') is False + assert isStdLibId("UINT32_C", 'c99') is True + assert isStdLibId("UINT32_C", 'c11') is True + assert isStdLibId("UINT32_C", 'c23') is True + + # Check that Identifiers from C11 are correctly classified + assert isStdLibId("sprintf_s", 'c89') is False + assert isStdLibId("sprintf_s", 'c99') is False + assert isStdLibId("sprintf_s", 'c11') is True + assert isStdLibId("sprintf_s", 'c23') is True + + # Function Defaulting to C99 + assert isStdLibId("assert") is True + assert isStdLibId("UINT32_C") is True + assert isStdLibId("sprintf_s") is False + +def test_isKeyword(): + # Check that Keywords from C90 are correctly classified + assert isKeyword("if", 'c89') is True + assert isKeyword("if", 'c99') is True + assert isKeyword("if", 'c11') is True + assert isKeyword("if", 'c23') is True + + # Check that Keywords from C99 are correctly classified + assert isKeyword("inline", 'c89') is False + assert isKeyword("inline", 'c99') is True + assert isKeyword("inline", 'c11') is True + assert isKeyword("inline", 'c23') is True + + # Check that Keywords from C11 are correctly classified + assert isKeyword("static_assert", 'c89') is False + assert isKeyword("static_assert", 'c99') is False + assert isKeyword("static_assert", 'c11') is True + assert isKeyword("static_assert", 'c23') is True + + # Function Defaulting to C99 + assert isKeyword("if") is True + assert isKeyword("inline") is True + assert isKeyword("static_assert") is False diff --git a/addons/test/util.py b/addons/test/util.py index dda3655dbd1..0f99534edc6 100644 --- a/addons/test/util.py +++ b/addons/test/util.py @@ -21,23 +21,22 @@ def find_cppcheck_binary(): def dump_create(fpath, *argv): cppcheck_binary = find_cppcheck_binary() cmd = [cppcheck_binary, "--dump", "-DDUMMY", "--quiet", fpath] + list(argv) - p = subprocess.Popen(cmd) - p.communicate() - if p.returncode != 0: - raise OSError("cppcheck returns error code: %d" % p.returncode) - p = subprocess.Popen(["sync"]) - p.communicate() + with subprocess.Popen(cmd) as p: + p.communicate() + if p.returncode != 0: + raise OSError("cppcheck returns error code: %d" % p.returncode) def dump_remove(fpath): - p = subprocess.Popen(["rm", "-f", fpath + ".dump"]) - p.communicate() + os.remove(fpath + ".dump") def convert_json_output(raw_json_strings): """Convert raw stdout/stderr cppcheck JSON output to python dict.""" json_output = {} for line in raw_json_strings: + if line.startswith('{"summary":'): + continue try: json_line = json.loads(line) # json_output[json_line['errorId']] = json_line diff --git a/build-pcre.txt b/build-pcre.txt index 3dad4274c92..9f4e8e06e29 100644 --- a/build-pcre.txt +++ b/build-pcre.txt @@ -2,19 +2,6 @@ PCRE is a library that is used by the optional "rules" feature for the command line version of cppcheck. It is readily available on Linux and Mac OS X, but must be obtained separately for Windows. -If you're using qmake to generate makefiles, the following behavior applies: - -- If you're not on Windows, it assumes by default that you have PCRE and want - to enable rules support. You can disable rules support (removing the PCRE - dependency) by passing HAVE_RULES=no to qmake. - -- If you are on Windows, but have PCRE available, you can enable rules support - by passing HAVE_RULES=yes to qmake. - - - Note: This includes using build.bat since it calls qmake - to use PCRE and - build.bat, you need to run set HAVE_RULES=yes before each run of build.bat - - Build instructions ------------------ diff --git a/cfg/boost.cfg b/cfg/boost.cfg index 3a09f2a778d..d181860f0bc 100644 --- a/cfg/boost.cfg +++ b/cfg/boost.cfg @@ -33,7 +33,7 @@ - + @@ -50,8 +50,8 @@ - - + + diff --git a/cfg/cppcheck-cfg.rng b/cfg/cppcheck-cfg.rng index 36df004cb2f..a54c967aaac 100644 --- a/cfg/cppcheck-cfg.rng +++ b/cfg/cppcheck-cfg.rng @@ -26,6 +26,9 @@ + + + @@ -38,6 +41,9 @@ + + + @@ -69,6 +75,9 @@ + + + @@ -78,6 +87,9 @@ + + + diff --git a/cfg/gnu.cfg b/cfg/gnu.cfg index ed9b886a539..1c8d1597a7f 100644 --- a/cfg/gnu.cfg +++ b/cfg/gnu.cfg @@ -64,6 +64,7 @@ + @@ -181,6 +182,25 @@ + + + + false + + + + + + + + + + + + + + + @@ -709,6 +729,7 @@ false + @@ -1648,6 +1669,25 @@ + + + + false + + + + + + + + + + + + + + + diff --git a/cfg/googletest.cfg b/cfg/googletest.cfg index c93862d64f6..36dd8a40669 100644 --- a/cfg/googletest.cfg +++ b/cfg/googletest.cfg @@ -32,6 +32,8 @@ + + diff --git a/cfg/gtk.cfg b/cfg/gtk.cfg index 492cf592988..722efb6b76b 100644 --- a/cfg/gtk.cfg +++ b/cfg/gtk.cfg @@ -205,690 +205,724 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - g_thread_new - g_thread_try_new + g_thread_new + g_thread_try_new g_thread_ref g_thread_unref g_thread_join - g_variant_iter_copy - g_variant_iter_new + g_variant_iter_copy + g_variant_iter_new g_variant_iter_free - g_source_new - g_idle_source_new - g_timeout_source_new - g_timeout_source_new_seconds - g_child_watch_source_new - g_cancellable_source_new - g_io_create_watch + g_source_new + g_idle_source_new + g_timeout_source_new + g_timeout_source_new_seconds + g_child_watch_source_new + g_cancellable_source_new + g_io_create_watch g_source_ref g_source_unref - g_date_time_new - g_date_time_new_now - g_date_time_new_now_local - g_date_time_new_now_utc - g_date_time_new_from_unix_local - g_date_time_new_from_unix_utc - g_date_time_new_from_timeval_local - g_date_time_new_from_timeval_utc - g_date_time_new_local - g_date_time_new_utc - g_date_time_add - g_date_time_add_years - g_date_time_add_months - g_date_time_add_weeks - g_date_time_add_days - g_date_time_add_hours - g_date_time_add_minutes - g_date_time_add_seconds - g_date_time_add_full - g_date_time_to_timezone - g_date_time_to_local - g_date_time_to_utc + g_date_time_new + g_date_time_new_now + g_date_time_new_now_local + g_date_time_new_now_utc + g_date_time_new_from_unix_local + g_date_time_new_from_unix_utc + g_date_time_new_from_timeval_local + g_date_time_new_from_timeval_utc + g_date_time_new_local + g_date_time_new_utc + g_date_time_add + g_date_time_add_years + g_date_time_add_months + g_date_time_add_weeks + g_date_time_add_days + g_date_time_add_hours + g_date_time_add_minutes + g_date_time_add_seconds + g_date_time_add_full + g_date_time_to_timezone + g_date_time_to_local + g_date_time_to_utc g_date_time_ref g_date_time_unref - g_dir_open + g_dir_open g_dir_rewind g_dir_close - g_timer_new + g_timer_new g_timer_destroy - g_file_attribute_info_list_new - g_file_attribute_info_list_dup + g_file_attribute_info_list_new + g_file_attribute_info_list_dup g_file_attribute_info_list_ref g_file_attribute_info_list_unref - g_slist_alloc - g_slist_copy - g_slist_copy_deep + g_slist_alloc + g_slist_copy + g_slist_copy_deep g_slist_free g_slist_free_1 g_slist_free_full - g_variant_new - g_variant_new_va - g_variant_new_boolean - g_variant_new_byte - g_variant_new_int16 - g_variant_new_uint16 - g_variant_new_int32 - g_variant_new_uint32 - g_variant_new_int64 - g_variant_new_uint64 - g_variant_new_handle - g_variant_new_double - g_variant_new_string - g_variant_new_take_string - g_variant_new_printf - g_variant_new_signature - g_variant_new_object_path - g_variant_new_variant - g_variant_new_objv - g_variant_new_strv - g_variant_new_bytestring - g_variant_new_bytestring_array - g_variant_new_maybe - g_variant_new_array - g_variant_new_tuple - g_variant_new_dict_entry - g_variant_new_fixed_array - g_variant_new_from_data - g_variant_new_from_bytes - g_variant_builder_end - g_variant_new_parsed_va - g_variant_new_parsed - g_variant_byteswap - g_variant_get_child_value - g_variant_get_normal_form - g_variant_parse + g_variant_new + g_variant_new_va + g_variant_new_boolean + g_variant_new_byte + g_variant_new_int16 + g_variant_new_uint16 + g_variant_new_int32 + g_variant_new_uint32 + g_variant_new_int64 + g_variant_new_uint64 + g_variant_new_handle + g_variant_new_double + g_variant_new_string + g_variant_new_take_string + g_variant_new_printf + g_variant_new_signature + g_variant_new_object_path + g_variant_new_variant + g_variant_new_objv + g_variant_new_strv + g_variant_new_bytestring + g_variant_new_bytestring_array + g_variant_new_maybe + g_variant_new_array + g_variant_new_tuple + g_variant_new_dict_entry + g_variant_new_fixed_array + g_variant_new_from_data + g_variant_new_from_bytes + g_variant_builder_end + g_variant_new_parsed_va + g_variant_new_parsed + g_variant_byteswap + g_variant_get_child_value + g_variant_get_normal_form + g_variant_parse g_variant_ref g_variant_take_ref + g_variant_builder_add + g_variant_builder_add_value + g_variant_builder_add_parsed g_variant_ref_sink g_variant_unref - g_variant_iter_new + g_variant_iter_new g_variant_iter_free - g_variant_type_new - g_variant_type_copy - g_variant_type_new_array - g_variant_type_new_dict_entry - g_variant_type_new_maybe - g_variant_type_new_tuple + g_variant_type_new + g_variant_type_copy + g_variant_type_new_array + g_variant_type_new_dict_entry + g_variant_type_new_maybe + g_variant_type_new_tuple g_variant_type_free - g_allocator_new + g_allocator_new g_allocator_free - g_bookmark_file_new + g_bookmark_file_new g_bookmark_file_free - g_srv_target_new + g_srv_target_new g_srv_target_free - g_string_chunk_new + g_string_chunk_new g_string_chunk_free - g_test_log_buffer_new + g_test_log_buffer_new g_test_log_buffer_free - g_value_array_new + g_value_array_new g_value_array_free - g_cache_new + g_cache_new g_cache_destroy - g_cclosure_new - g_cclosure_new_swap - g_cclosure_new_object - g_cclosure_new_object_swap - g_closure_new_object - g_closure_new_simple + g_cclosure_new + g_cclosure_new_swap + g_cclosure_new_object + g_cclosure_new_object_swap + g_closure_new_object + g_closure_new_simple g_closure_ref g_closure_unref - g_array_new - g_array_sized_new + g_array_new + g_array_sized_new g_array_ref g_array_free g_array_unref - g_async_queue_new - g_async_queue_new_full + g_async_queue_new + g_async_queue_new_full g_async_queue_ref g_async_queue_unref - g_byte_array_new - g_byte_array_sized_new - g_byte_array_new_take - g_byte_array_sized_new - g_bytes_unref_to_array + g_byte_array_new + g_byte_array_sized_new + g_byte_array_new_take + g_byte_array_sized_new + g_bytes_unref_to_array g_byte_array_ref g_byte_array_free g_byte_array_unref - g_checksum_new - g_checksum_copy + g_checksum_new + g_checksum_copy g_checksum_free - g_main_loop_new - g_main_new + g_main_loop_new + g_main_new g_main_loop_ref g_main_loop_unref g_main_destroy - g_main_context_new + g_main_context_new g_main_context_ref g_main_context_unref g_main_destroy - g_thread_pool_new + g_thread_pool_new g_thread_pool_free - g_error_copy - g_error_new_valist - g_error_new_literal - g_error_new + g_error_copy + g_error_new_valist + g_error_new_literal + g_error_new g_error_free - g_string_new - g_string_new_len - g_string_sized_new - g_variant_print_string + g_string_new + g_string_new_len + g_string_sized_new + g_variant_print_string g_string_free - g_ptr_array_new - g_ptr_array_new_full - g_ptr_array_new_with_free_func + g_ptr_array_new + g_ptr_array_new_full + g_ptr_array_new_with_free_func g_ptr_array_ref g_ptr_array_free g_ptr_array_unref - g_pattern_spec_new + g_pattern_spec_new g_pattern_spec_free - g_key_file_new + g_key_file_new g_key_file_ref g_key_file_free g_key_file_unref - g_io_module_scope_new + g_io_module_scope_new g_io_module_scope_free - g_ascii_strdown - g_ascii_strup - g_base64_decode - g_base64_encode - g_bookmark_file_get_description - g_bookmark_file_get_mime_type - g_bookmark_file_get_title - g_bookmark_file_to_data - g_build_filename - g_build_filenamev - g_build_path - g_build_pathv - g_bytes_unref_to_data - g_compute_checksum_for_bytes - g_compute_checksum_for_data - g_compute_checksum_for_string - g_compute_hmac_for_data - g_compute_hmac_for_string - g_convert - g_convert_with_fallback - g_convert_with_iconv - g_credentials_to_string - g_date_time_format - g_filename_display_basename - g_filename_display_name - g_filename_from_uri - g_filename_to_uri - g_get_codeset - g_get_current_dir - g_get_locale_variants - g_key_file_get_start_group - g_key_file_to_data - g_malloc - g_realloc - g_malloc0 - g_malloc0_n - g_malloc_n - g_realloc_n - g_memdup - g_path_get_basename - g_path_get_dirname - g_slice_alloc - g_slice_alloc0 - g_slice_copy - g_strcompress - g_strconcat - g_strdup - g_strdup_printf - g_strdup_vprintf - g_strescape - g_strjoin - g_strjoinv - g_strndup - g_strnfill - g_time_val_to_iso8601 - g_try_malloc - g_try_realloc - g_try_malloc0 - g_try_malloc0_n - g_try_malloc_n - g_try_realloc_n - g_ucs4_to_utf16 - g_ucs4_to_utf8 - g_unicode_canonical_decomposition - g_utf16_to_ucs4 - g_utf16_to_utf8 - g_utf8_casefold - g_utf8_collate_key - g_utf8_collate_key_for_filename - g_utf8_normalize - g_utf8_strdown - g_utf8_strreverse - g_utf8_strup - g_utf8_substring - g_utf8_to_ucs4 - g_utf8_to_ucs4_fast - g_utf8_to_ucs4_fast - g_utf8_to_utf16 - g_key_file_get_locale_string - g_key_file_get_value - g_key_file_get_string - g_key_file_get_boolean_list - g_key_file_get_integer_list - g_key_file_get_double_list - g_key_file_get_comment - g_dbus_proxy_get_name_owner - g_file_info_get_attribute_as_string - g_file_attribute_matcher_to_string - g_app_launch_context_get_environment - g_app_launch_context_get_startup_notify_id - g_filename_completer_get_completion_suffix - g_inet_address_mask_to_string - g_variant_dup_string - g_variant_dup_bytestring - g_variant_get_objv - g_variant_get_strv - g_variant_print - g_datalist_id_dup_data - g_dir_make_tmp - g_filename_from_utf8 - g_filename_to_utf8 - g_file_read_link - g_find_program_in_path - g_format_size - g_format_size_for_display - g_format_size_full - g_hostname_to_ascii - g_hostname_to_unicode - g_locale_from_utf8 - g_locale_to_utf8 - g_markup_escape_text - g_markup_printf_escaped - g_markup_vprintf_escaped - g_match_info_expand_references - g_match_info_fetch - g_match_info_fetch_named - g_option_context_get_help - g_regex_escape_nul - g_regex_escape_string - g_regex_replace - g_regex_replace_eval - g_regex_replace_literal - g_shell_quote - g_shell_unquote - g_uri_escape_string - g_uri_parse_scheme - g_uri_unescape_segment - g_uri_unescape_string - g_variant_type_dup_string - g_value_dup_string + g_ascii_strdown + g_ascii_strup + g_base64_decode + g_base64_encode + g_bookmark_file_get_description + g_bookmark_file_get_mime_type + g_bookmark_file_get_title + g_bookmark_file_to_data + g_build_filename + g_build_filenamev + g_build_path + g_build_pathv + g_bytes_unref_to_data + g_compute_checksum_for_bytes + g_compute_checksum_for_data + g_compute_checksum_for_string + g_compute_hmac_for_data + g_compute_hmac_for_string + g_convert + g_convert_with_fallback + g_convert_with_iconv + g_credentials_to_string + g_date_time_format + g_filename_display_basename + g_filename_display_name + g_filename_from_uri + g_filename_to_uri + g_get_codeset + g_get_current_dir + g_get_locale_variants + g_key_file_get_start_group + g_key_file_to_data + g_malloc + g_realloc + g_malloc0 + g_malloc0_n + g_malloc_n + g_realloc_n + g_memdup + g_path_get_basename + g_path_get_dirname + g_slice_alloc + g_slice_alloc0 + g_slice_copy + g_strcompress + g_strconcat + g_strdup + g_strdup_printf + g_strdup_vprintf + g_strescape + g_strjoin + g_strjoinv + g_strndup + g_strnfill + g_time_val_to_iso8601 + g_try_malloc + g_try_realloc + g_try_malloc0 + g_try_malloc0_n + g_try_malloc_n + g_try_realloc_n + g_ucs4_to_utf16 + g_ucs4_to_utf8 + g_unicode_canonical_decomposition + g_utf16_to_ucs4 + g_utf16_to_utf8 + g_utf8_casefold + g_utf8_collate_key + g_utf8_collate_key_for_filename + g_utf8_normalize + g_utf8_strdown + g_utf8_strreverse + g_utf8_strup + g_utf8_substring + g_utf8_to_ucs4 + g_utf8_to_ucs4_fast + g_utf8_to_ucs4_fast + g_utf8_to_utf16 + g_key_file_get_locale_string + g_key_file_get_value + g_key_file_get_string + g_key_file_get_boolean_list + g_key_file_get_integer_list + g_key_file_get_double_list + g_key_file_get_comment + g_dbus_proxy_get_name_owner + g_file_info_get_attribute_as_string + g_file_attribute_matcher_to_string + g_app_launch_context_get_environment + g_app_launch_context_get_startup_notify_id + g_filename_completer_get_completion_suffix + g_inet_address_mask_to_string + g_variant_dup_string + g_variant_dup_bytestring + g_variant_get_objv + g_variant_get_strv + g_variant_print + g_datalist_id_dup_data + g_dir_make_tmp + g_filename_from_utf8 + g_filename_to_utf8 + g_file_read_link + g_find_program_in_path + g_format_size + g_format_size_for_display + g_format_size_full + g_hostname_to_ascii + g_hostname_to_unicode + g_locale_from_utf8 + g_locale_to_utf8 + g_markup_escape_text + g_markup_printf_escaped + g_markup_vprintf_escaped + g_match_info_expand_references + g_match_info_fetch + g_match_info_fetch_named + g_option_context_get_help + g_regex_escape_nul + g_regex_escape_string + g_regex_replace + g_regex_replace_eval + g_regex_replace_literal + g_shell_quote + g_shell_unquote + g_uri_escape_string + g_uri_parse_scheme + g_uri_unescape_segment + g_uri_unescape_string + g_variant_type_dup_string + g_value_dup_string g_register_data g_free - g_hash_table_new_full - g_hash_table_new + g_hash_table_new_full + g_hash_table_new g_hash_table_ref g_hash_table_destroy g_hash_table_unref - g_io_channel_unix_new - g_io_channel_win32_new_fd - g_io_channel_win32_new_socket - g_io_channel_win32_new_messages - g_io_channel_new_file + g_io_channel_unix_new + g_io_channel_win32_new_fd + g_io_channel_win32_new_socket + g_io_channel_win32_new_messages + g_io_channel_new_file g_io_channel_ref g_io_channel_close g_io_channel_shutdown g_io_channel_unref - g_emblemed_icon_get_emblems - g_list_alloc - g_list_copy - g_list_copy_deep - g_app_info_get_all - g_app_info_get_all_for_type - g_app_info_get_fallback_for_type - g_app_info_get_recommended_for_type - g_io_modules_load_all_in_directory - g_io_modules_load_all_in_directory_with_scope - g_hash_table_get_keys - g_hash_table_get_values + g_emblemed_icon_get_emblems + g_list_alloc + g_list_copy + g_list_copy_deep + g_app_info_get_all + g_app_info_get_all_for_type + g_app_info_get_fallback_for_type + g_app_info_get_recommended_for_type + g_io_modules_load_all_in_directory + g_io_modules_load_all_in_directory_with_scope + g_hash_table_get_keys + g_hash_table_get_values g_list_free g_list_free_1 g_list_free_full - g_regex_new + g_regex_new g_regex_ref g_regex_unref - g_node_new - g_node_copy - g_node_copy_deep + g_node_new + g_node_copy + g_node_copy_deep g_node_destroy - g_time_zone_new - g_time_zone_new_local - g_time_zone_new_utc + g_time_zone_new + g_time_zone_new_local + g_time_zone_new_utc g_time_zone_ref g_time_zone_unref - g_markup_parse_context_new + g_markup_parse_context_new g_markup_parse_context_free - g_mapped_file_new - g_mapped_file_new_from_fd + g_mapped_file_new + g_mapped_file_new_from_fd g_mapped_file_ref g_mapped_file_free g_mapped_file_unref - g_mutex_new + g_mutex_new g_mutex_free - g_mem_chunk_new + g_mem_chunk_new g_mem_chunk_free - g_option_group_new + g_option_group_new g_option_group_free - g_option_context_new + g_option_context_new g_option_context_free - g_rand_new - g_rand_copy - g_rand_new_with_seed - g_rand_new_with_seed_array + g_rand_new + g_rand_copy + g_rand_new_with_seed + g_rand_new_with_seed_array g_rand_free - g_queue_new - g_queue_copy + g_queue_new + g_queue_copy g_queue_free + g_queue_free_full - g_slice_new + g_slice_new g_slice_free g_slice_free1 - g_sequence_new + g_sequence_new g_sequence_free - g_completion_new + g_completion_new g_completion_free - g_chunk_new + g_chunk_new g_chunk_free - g_bytes_new - g_bytes_new_take - g_bytes_new_static - g_bytes_new_with_free_func - g_bytes_new_from_bytes - g_byte_array_free_to_bytes - g_memory_output_stream_steal_as_bytes - g_variant_get_data_as_bytes - g_mapped_file_get_bytes + g_bytes_new + g_bytes_new_take + g_bytes_new_static + g_bytes_new_with_free_func + g_bytes_new_from_bytes + g_byte_array_free_to_bytes + g_memory_output_stream_steal_as_bytes + g_variant_get_data_as_bytes + g_mapped_file_get_bytes g_bytes_ref g_bytes_unref - g_bookmark_file_get_uris - g_bookmark_file_get_groups - g_bookmark_file_get_applications - g_key_file_get_groups - g_key_file_get_keys - g_strdupv - g_strsplit - g_strsplit_set - g_uri_list_extract_uris - g_key_file_get_string_list - g_key_file_get_locale_string_list - g_file_info_list_attributes - g_file_info_get_attribute_stringv - g_app_launch_context_get_environment - g_filename_completer_get_completions - g_io_module_query - g_variant_dup_objv - g_variant_dup_bytestring_array - g_environ_setenv - g_environ_unsetenv - g_get_environ - g_listenv - g_match_info_fetch_all - g_regex_split - g_regex_split_full - g_regex_split_simple - g_regex_split_simple - g_variant_dup_strv + g_bookmark_file_get_uris + g_bookmark_file_get_groups + g_bookmark_file_get_applications + g_key_file_get_groups + g_key_file_get_keys + g_strdupv + g_strsplit + g_strsplit_set + g_uri_list_extract_uris + g_key_file_get_string_list + g_key_file_get_locale_string_list + g_file_info_list_attributes + g_file_info_get_attribute_stringv + g_app_launch_context_get_environment + g_filename_completer_get_completions + g_io_module_query + g_variant_dup_objv + g_variant_dup_bytestring_array + g_environ_setenv + g_environ_unsetenv + g_get_environ + g_listenv + g_match_info_fetch_all + g_regex_split + g_regex_split_full + g_regex_split_simple + g_regex_split_simple + g_variant_dup_strv g_strfreev - g_hmac_new - g_hmac_copy + g_hmac_new + g_hmac_copy g_hmac_ref g_hmac_unref - g_hook_alloc + g_hook_alloc g_hook_ref g_hook_unref g_hook_destroy g_hook_free - g_date_new - g_date_new_dmy - g_date_new_julian + g_date_new + g_date_new_dmy + g_date_new_julian g_date_free - g_variant_builder_new + g_variant_builder_new g_variant_builder_ref g_variant_builder_unref - g_cond_new + g_cond_new g_cond_free - g_app_launch_context_new - g_app_info_create_from_commandline - g_app_info_dup - g_app_info_get_default_for_type - g_app_info_get_default_for_uri_scheme - g_application_new - g_application_get_dbus_connection - g_application_get_default - g_buffered_input_stream_new - g_buffered_output_stream_new - g_cancellable_new - g_charset_converter_new - g_converter_input_stream_new - g_converter_output_stream_new - g_credentials_new - g_data_input_stream_new - g_data_output_stream_new - g_dbus_auth_observer_new - g_dbus_connection_new_finish - g_dbus_connection_new_sync - g_dbus_connection_new_for_address_finish - g_dbus_connection_new_for_address_sync - g_dbus_message_new - g_dbus_message_new_signal - g_dbus_message_new_method_call - g_dbus_message_new_method_reply - g_dbus_message_new_method_error - g_dbus_message_new_method_error_valist - g_dbus_message_new_method_error_literal - g_dbus_object_manager_client_new_finish - g_dbus_object_manager_client_new_sync - g_dbus_object_manager_client_new_for_bus_finish - g_dbus_object_manager_client_new_for_bus_sync - g_dbus_object_manager_server_new - g_dbus_object_manager_server_get_connection - g_dbus_object_proxy_new - g_dbus_object_skeleton_new - g_dbus_proxy_new_finish - g_dbus_proxy_new_sync - g_dbus_proxy_new_for_bus_finish - g_dbus_proxy_new_for_bus_sync - g_emblemed_icon_new - g_emblem_new - g_emblem_new_with_origin - g_file_icon_new - g_file_icon_get_file - g_file_info_new - g_file_info_dup - g_file_info_get_icon - g_file_info_get_symbolic_icon - g_file_info_get_attribute_object - g_file_info_get_deletion_date - g_filename_completer_new - g_inet_address_mask_new - g_inet_address_mask_new_from_string - g_inet_address_mask_get_address - g_inet_socket_address_new - g_inet_socket_address_get_address - g_initable_new - g_initable_new_valist - g_initable_newv - g_io_module_new - g_io_module_scope_new - g_keyfile_settings_backend_new - g_memory_input_stream_new - g_memory_input_stream_new_from_data - g_memory_input_stream_new_from_bytes - g_memory_output_stream_new - g_memory_output_stream_new_resizable - g_memory_settings_backend_new - g_null_settings_backend_new - g_menu_item_new - g_menu_item_new_section - g_menu_item_new_submenu - g_menu_item_new_from_model - g_menu_new - g_mount_operation_new - g_network_address_new - g_network_service_new - g_object_new - g_param_spec_pool_new - g_pollable_source_new - g_private_new - g_proxy_address_new - g_ptr_array_sized_new - g_relation_new - g_scanner_new - g_settings_new - g_signal_type_cclosure_new - g_simple_action_group_new - g_simple_action_new - g_simple_async_result_new - g_simple_permission_new - g_socket_client_new - g_socket_listener_new - g_socket_new - g_socket_service_new - g_tcp_wrapper_connection_new - g_test_dbus_new - g_themed_icon_new - g_threaded_socket_service_new - g_tls_client_connection_new - g_tls_file_database_new - g_tls_password_new - g_tls_server_connection_new - g_unix_signal_source_new - g_zlib_compressor_new - g_zlib_decompressor_new + g_app_launch_context_new + g_app_info_create_from_commandline + g_app_info_dup + g_app_info_get_default_for_type + g_app_info_get_default_for_uri_scheme + g_application_new + g_application_get_dbus_connection + g_application_get_default + g_buffered_input_stream_new + g_buffered_output_stream_new + g_cancellable_new + g_charset_converter_new + g_converter_input_stream_new + g_converter_output_stream_new + g_credentials_new + g_data_input_stream_new + g_data_output_stream_new + g_dbus_auth_observer_new + g_dbus_connection_new_finish + g_dbus_connection_new_sync + g_dbus_connection_new_for_address_finish + g_dbus_connection_new_for_address_sync + g_dbus_message_new + g_dbus_message_new_signal + g_dbus_message_new_method_call + g_dbus_message_new_method_reply + g_dbus_message_new_method_error + g_dbus_message_new_method_error_valist + g_dbus_message_new_method_error_literal + g_dbus_object_manager_client_new_finish + g_dbus_object_manager_client_new_sync + g_dbus_object_manager_client_new_for_bus_finish + g_dbus_object_manager_client_new_for_bus_sync + g_dbus_object_manager_server_new + g_dbus_object_manager_server_get_connection + g_dbus_object_proxy_new + g_dbus_object_skeleton_new + g_dbus_proxy_new_finish + g_dbus_proxy_new_sync + g_dbus_proxy_new_for_bus_finish + g_dbus_proxy_new_for_bus_sync + g_emblemed_icon_new + g_emblem_new + g_emblem_new_with_origin + g_file_icon_new + g_file_icon_get_file + g_file_info_new + g_file_info_dup + g_file_info_get_icon + g_file_info_get_symbolic_icon + g_file_info_get_attribute_object + g_file_info_get_deletion_date + g_filename_completer_new + g_inet_address_mask_new + g_inet_address_mask_new_from_string + g_inet_address_mask_get_address + g_inet_socket_address_new + g_inet_socket_address_get_address + g_initable_new + g_initable_new_valist + g_initable_newv + g_io_module_new + g_io_module_scope_new + g_keyfile_settings_backend_new + g_memory_input_stream_new + g_memory_input_stream_new_from_data + g_memory_input_stream_new_from_bytes + g_memory_output_stream_new + g_memory_output_stream_new_resizable + g_memory_settings_backend_new + g_null_settings_backend_new + g_menu_item_new + g_menu_item_new_section + g_menu_item_new_submenu + g_menu_item_new_from_model + g_menu_new + g_mount_operation_new + g_network_address_new + g_network_service_new + g_object_new + g_param_spec_pool_new + g_pollable_source_new + g_private_new + g_proxy_address_new + g_ptr_array_sized_new + g_relation_new + g_scanner_new + g_settings_new + g_signal_type_cclosure_new + g_simple_action_group_new + g_simple_action_new + g_simple_async_result_new + g_simple_permission_new + g_socket_client_new + g_socket_listener_new + g_socket_new + g_socket_service_new + g_tcp_wrapper_connection_new + g_test_dbus_new + g_themed_icon_new + g_threaded_socket_service_new + g_tls_client_connection_new + g_tls_file_database_new + g_tls_password_new + g_tls_server_connection_new + g_unix_signal_source_new + g_zlib_compressor_new + g_zlib_decompressor_new g_object_ref g_object_unref gtk_widget_destroy - g_tree_new - g_tree_new_full - g_tree_new_with_data + g_tree_new + g_tree_new_full + g_tree_new_with_data g_tree_ref g_tree_unref + g_tree_destroy - g_file_attribute_matcher_new - g_file_attribute_matcher_subtract + g_file_attribute_matcher_new + g_file_attribute_matcher_subtract g_file_attribute_matcher_ref g_file_attribute_matcher_unref @@ -902,31 +936,39 @@ false + + - false + + - + + + false + + + false @@ -936,18 +978,17 @@ - + - + false - @@ -956,7 +997,6 @@ - @@ -965,7 +1005,6 @@ - @@ -976,23 +1015,80 @@ - + + false + + + + + + + + + + + false + + + + + + + + + + + + false + + + + + + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + false @@ -1006,26 +1102,77 @@ false + false + + + + + + + + - + + + false + + + + + + + + + - + + + false + + + + + + + + + false + + + + + + + + + + + + + + false - - - false - - - false + + + + + + + + + + + + false @@ -1042,20 +1189,31 @@ false + false + + + false + + + + + + + false + - @@ -1063,35 +1221,87 @@ false - + false - - + + + + + + false - + + false + + + + + + + + + + + false + + + + + + + + + + + + false + + + + + + + + + + + false + + + + + + + + + + + + + @@ -1101,7 +1311,9 @@ - + + + false + + + + false - + @@ -1210,197 +1424,623 @@ + false + + + + + + + + + + + + 0: + + false + + + + + + + false + + + + + + + + + 0: + + + + + + + + 0: + + false + + + + + + + + + + + + 0: + - - - false - - - - false - - + + + false + + + + + + + + + 0: + + + + + + false + + + + + + + + + 0: + + + + + 0: + + false + + + + + + + + + false + + + + + + + + 0: + + false + + + + + + + + + false + + + + + + + + + + - - - false - + false + + + + + + + + + + + + + 0: + + false + + + + + + + + + + + + + 0: + - - - false - - + + + false + + + + + + + + + 0: + + false + + + + + + + + + 0: + + + + + 0: + + false + + + + + + + + 0: + + false + + + + + + + + + false + + + + + + + + + + + false + + + + + + + false + + + + + + + + + + + false + + + + + + + false + + + + + + + false + + + + + + + false + + + + + + + + + 0: + + + + + + + + + + + + false + + + + + + + false + + + + + + + + + + + + + + + false + + + + + + 0: + + false + + + + + + + false + + + + + + + false + + + + + + + false + + + + + + + + + + + false + + + + + + + + + false + + + + + + - false + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + + + + false + + + + + + + + + + + + - - - false - - + + + false + + + + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + + - + + + false + + + + + + + + - + + + false + + + + + + false - - - - false - - - - false + + + + + + @@ -1450,21 +2090,40 @@ false + false + + + + + + - - - false - - + + + + + + + false + + false + + + + + + + + @@ -1473,36 +2132,76 @@ - + false + + + + + + + + false + + + + + + + + + false + + + + + + + + + + + - - - false - + false + + + + + + + + + + + false - - - - false + + + + + + + + @@ -1513,60 +2212,122 @@ - - + + + false + + + + + + + + + 0: + + false + + + + + + + + + 0: + - - - false - + false + + + + + + + + - - - false - - + + + false + + + + + + + + + false + + + + + + + + false + + + + + false + + + + + + + + false + + + + + + + + + + - - - false - - - - false - - + + + + false + + @@ -1576,73 +2337,215 @@ false + false + + + + + + + + + + + - - - false - - - - false - - + + + false + + + + + + + + - + + + false + + + + + + + + + 0: + + false + + + + + + + + + 0: + + + + + 0: + + false + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + false + + + + + + + + + + + false + + + + + + + + - - - false - + false + + + + + + + + + + + + + + + + + + false + + + + + + + + + false + + + + + + + + false + + + + + + + + + false + + + + + + + + + + + @@ -1652,8 +2555,12 @@ - - + + + + + + @@ -1689,41 +2596,110 @@ + false + + + + + + + + + 0: + + false + + + + + + + + + 0: + + false + + + + + + + + - - - false - - + + + false + + + + + + + + + false + + + + + + + + false + + + + + false + + + + + + + + false + + + + + + + + + + @@ -1769,33 +2745,20 @@ false - - - false - - - - false - - - - false - - - - false - - - - false - + false + + + + + false + @@ -2134,31 +3097,52 @@ - - - false - - - - false - - + + + + false + + + + + + + + false + + + + + + + - - - false - + false + + + + + + + + + + + + + + - + false @@ -2171,14 +3155,6 @@ false - - - false - - - - false - false @@ -2196,9 +3172,31 @@ false + false + + + + + + + + + + + + + + + + + + + + + @@ -2353,11 +3351,13 @@ + + @@ -2367,6 +3367,7 @@ + @@ -2382,9 +3383,11 @@ + + @@ -2515,21 +3518,47 @@ false + false + + + + + + + + + + false + + + + + + + + + false + false + + + + + @@ -2538,10 +3567,21 @@ false + + + + + + false + + + + + @@ -2636,10 +3676,6 @@ false - - - false - false @@ -2648,17 +3684,42 @@ false - - - false - + false + + + + + + + + + + + + false + + + + + + + + + + + + + + + + @@ -2668,10 +3729,20 @@ - - - false - + + + + false + + + + + + + + + + false @@ -2740,62 +3811,6 @@ false - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - false @@ -2814,13 +3829,28 @@ + false + + + + + + + + + false + + + + + @@ -2880,21 +3910,73 @@ false + false + + + + + + + + + + + false + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + false + + + + + + + + + + @@ -2949,29 +4031,29 @@ false - - - false - false - - - false - - + + + false + + false - + + + false + + @@ -3030,50 +4112,6 @@ - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - false @@ -3086,17 +4124,45 @@ false + false + + + + + + + + false + + + + + + + + + + + + + + + false + + + + @@ -3122,13 +4188,54 @@ false + false + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + @@ -3138,10 +4245,6 @@ false - - - false - false @@ -3695,31 +4798,11 @@ - - - - - - - - - false - - - - false - - - - false - - - - false - - - - false + + + + + @@ -3753,9 +4836,19 @@ false + false + + + + + + + + + @@ -3787,18 +4880,6 @@ 0: - - - false - - - - false - - - - false - false @@ -3811,30 +4892,6 @@ false - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - false @@ -3939,7 +4996,7 @@ false - + false @@ -4055,13 +5112,23 @@ - - - false - - + + + false + + + + + + + + + + + + @@ -4239,17 +5306,53 @@ 0: + false + + + + + + + false + + + + + + + + + + + - + + + false + + + + + + + + + + + + + + + @@ -4273,10 +5376,6 @@ - - - false - false @@ -4289,9 +5388,17 @@ false + false + + + + + + + @@ -4429,65 +5536,47 @@ false - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - + + + false + + + + + + + + + + + + - + + false + + + + + + + + + + + + + + + + + + + @@ -4689,224 +5778,243 @@ false - - - false - - - - false - - - - false - - - - false - - - - false - - - - - false - - - - - - - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - + false - + false - + false - + false - + false - + + false + + + + + + - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + false - + + + false + + + + + + - + + + false + + + + + - + + + + + false + + + + + + - - + + + false + + + + + + + + + - - + + + false + + + + + + + + + + + + + + + - - + + + false + + + + + - + + + false + + + + + + + + + + + - + false + g_async_queue_timed_pop_unlocked is deprecated and should not be used in newly-written code.use g_async_queue_timeout_pop_unlocked(). - + + + false + + + + + + + + 0: + false + g_async_queue_unref_and_unlock has been deprecated since version 2.8 and should not be used in newly-written code. Reference counting is done atomically. so g_async_queue_unref() can be used regardless of the queues lock. @@ -5040,25 +6148,70 @@ + false + + + + + + + + + + + false + + + + + + + + + + + false + + + + + + + + + false + + + + + + + false + + + + + + @@ -5232,65 +6385,57 @@ false + false + + + + + + + + + + - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - + + + + + + + + + + + + + false + + + + + + false + false - - - - false - - - - false - - - - false + + + + + + @@ -5304,9 +6449,16 @@ false + false + + + + + + @@ -6120,129 +7272,344 @@ false - + + + + false + + + + + + + + + + false + + + + + + + + + + + false + + + + + + + + + + + + + false + + + + + + + + + + + + false + + + + + + + + + + + + - + + false + + + + + + + + + + + - - + + false + + - - + + false + + + + + + - - + + false + + + + + + - false + + + + + + + + + false + + + + + + + false + + + + + + + + + + false + + + + + - - - false - - + + + false + + + + + + + + + + + + false + + + + + + + + + + + + + + + false + + + + + + + false + + + + + + - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - + + + + + false + + + + + + - + + + + + false + + + + + - + + + false + + + + + + + + + + 0: + - + + + false + + + + + + + + + 0: + + false + + + + + + + + + + false + + + + + + + + + + false + + + + + + false + + + + + + + + + + + + false + + + + + + + + + @@ -6976,53 +8343,158 @@ false + + + false + + + + + + + + - false + + + + + false + + + + + + + + + + + - + + + + + false + + + - + + + + + + false + + + + + + + + false + + + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + + - - - false - - - - false - - + + + false + + + + + + + + + false + + + + + + + + + + + - + + + false + + + + + + + + + false + g_tree_traverse has been deprecated since version 2.2 and should not be used in newly-written code. The order of a balanced tree is somewhat arbitrary. If you just want to visit all nodes in sorted order, use g_tree_foreach() instead. If you really need to visit nodes in a different order, consider using an n-ary tree. @@ -7232,29 +8704,91 @@ false + - false + + + + + + + + + + + + - - + + false + + + + + + + + - - + + false + + + + + + + + + + + + - - + + + false + + + + + - false + + + + + + + + + - false + + + + + + + + + + + + false + + + + + @@ -7352,6 +8886,174 @@ false + + + false + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + + + + + + + + + false + + + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + false + + + + + + + + + + + + @@ -20464,7 +22166,7 @@ - + @@ -20476,6 +22178,17 @@ + + + + + + false + + + + + diff --git a/cfg/kde.cfg b/cfg/kde.cfg index 7d18998a29f..1131d5e0c50 100644 --- a/cfg/kde.cfg +++ b/cfg/kde.cfg @@ -20,6 +20,11 @@ + + + + + diff --git a/cfg/posix.cfg b/cfg/posix.cfg index a66e0210908..751142bacc1 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -511,6 +511,13 @@ + + + + false + + + @@ -1942,6 +1949,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + -20:19 @@ -4087,7 +4095,6 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s - Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. diff --git a/cfg/protobuf.cfg b/cfg/protobuf.cfg new file mode 100644 index 00000000000..8ff5570c952 --- /dev/null +++ b/cfg/protobuf.cfg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/cfg/qt.cfg b/cfg/qt.cfg index 9f6540a310c..00cb66c1909 100644 --- a/cfg/qt.cfg +++ b/cfg/qt.cfg @@ -59,8 +59,8 @@ invokeMethod - - + + @@ -2737,6 +2737,7 @@ + @@ -3293,7 +3294,7 @@ - + @@ -3304,7 +3305,7 @@ - + @@ -3320,7 +3321,7 @@ false - + @@ -3328,10 +3329,10 @@ false - + - + @@ -3368,10 +3369,10 @@ false - + - + @@ -3381,7 +3382,7 @@ false - + @@ -5259,7 +5260,7 @@ - + @@ -5326,6 +5327,8 @@ + + @@ -5335,13 +5338,18 @@ - + + + + + - + + @@ -5354,7 +5362,7 @@ - + @@ -5363,10 +5371,13 @@ + + + @@ -5375,7 +5386,10 @@ - + + + + @@ -5414,6 +5428,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cfg/sqlite3.cfg b/cfg/sqlite3.cfg index d5cd33fa0dd..6c5811f1f75 100644 --- a/cfg/sqlite3.cfg +++ b/cfg/sqlite3.cfg @@ -1065,7 +1065,6 @@ - diff --git a/cfg/std.cfg b/cfg/std.cfg index 5a8e75f895f..84cffb79828 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -69,7 +69,7 @@ true - + true @@ -4153,8 +4153,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun - - + false @@ -4821,6 +4820,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun + @@ -4956,8 +4956,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun - - + false @@ -5671,6 +5670,13 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun false + + + + + + false + @@ -6365,8 +6371,30 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun + + + + + + false + + + arg1<arg2?arg2:arg1>arg3?arg3:arg1 + + + + + + + + + + + + + - + false @@ -6380,7 +6408,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun - + false @@ -6523,20 +6551,6 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun - - - - - false - - - - - - - - - @@ -6608,6 +6622,22 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun + + + + + + + + + + + false + + + + + @@ -6623,7 +6653,6 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun - false @@ -7634,15 +7663,15 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init false - + - + - + @@ -7683,6 +7712,23 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init + + + + + false + + + + + + + + + + + + @@ -8649,7 +8695,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init - + @@ -8707,7 +8753,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init false - + @@ -8734,6 +8780,23 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init + + + + + false + + + + + + + + false + + + + malloc,std::malloc calloc,std::calloc @@ -8978,6 +9041,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init std::unique_lock std::shared_lock std::pair + std::complex std::exception std::logic_error std::domain_error @@ -8991,8 +9055,10 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init std::underflow_error std::regex_error std::system_error + std::format_error std::bad_typeid std::bad_cast + std::monostate std::bad_optional_access std::bad_expected_access std::bad_weak_ptr diff --git a/cfg/windows.cfg b/cfg/windows.cfg index aa464b6c40e..343e12b3906 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -2292,16 +2292,72 @@ - - - + + + false + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + false + It is recommend you use _stricmp instead. diff --git a/cfg/wxwidgets.cfg b/cfg/wxwidgets.cfg index ad20645b140..e09b19e15af 100644 --- a/cfg/wxwidgets.cfg +++ b/cfg/wxwidgets.cfg @@ -109,6 +109,8 @@ + + @@ -16998,8 +17000,22 @@ wxItemKind kind = wxITEM_NORMAL) --> + + - + + + + + + + + + + + + + false diff --git a/clang-tidy.md b/clang-tidy.md index 05b4225fc43..59d28dbaa3d 100644 --- a/clang-tidy.md +++ b/clang-tidy.md @@ -147,10 +147,6 @@ To be evaluated (need to enable explicitly). These apply to codebases which use later standards then C++11 (C++17 is used when building with Qt6) so we cannot simply apply them. -`modernize-use-auto`
- -This cannot be enabled as it might lead to changes in the constness of iterators - see https://github.com/llvm/llvm-project/issues/84324. - ### Disabled for performance reasons `portability-std-allocator-const`
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 3859d35a13c..8ea47196350 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -6,12 +6,13 @@ if (BUILD_CLI) list(REMOVE_ITEM srcs ${mainfile}) add_library(cli_objs OBJECT ${hdrs} ${srcs}) - target_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/lib/) + target_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/frontend/) if(USE_BUNDLED_TINYXML2) target_externals_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/tinyxml2/) else() target_include_directories(cli_objs SYSTEM PRIVATE ${tinyxml2_INCLUDE_DIRS}) endif() + target_externals_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/picojson/) target_externals_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/simplecpp/) if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS) target_precompile_headers(cli_objs PRIVATE precompiled.h) @@ -25,7 +26,7 @@ if (BUILD_CLI) set_source_files_properties(processexecutor.cpp PROPERTIES COMPILE_FLAGS -Wno-reserved-identifier) endif() - list(APPEND cppcheck_SOURCES ${hdrs} ${mainfile} $) + list(APPEND cppcheck_SOURCES ${hdrs} ${mainfile} $ $) if (NOT BUILD_CORE_DLL) list(APPEND cppcheck_SOURCES $) list(APPEND cppcheck_SOURCES $) @@ -74,16 +75,24 @@ if (BUILD_CLI) RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) - install(FILES ${addons} - DESTINATION ${FILESDIR}/addons + install(PROGRAMS ${CMAKE_SOURCE_DIR}/htmlreport/cppcheck-htmlreport + DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + COMPONENT applications) + + install(FILES ${addons_py} + DESTINATION ${FILESDIR_DEF}/addons + COMPONENT headers) + + install(FILES ${addons_json} + DESTINATION ${FILESDIR_DEF}/addons COMPONENT headers) install(FILES ${cfgs} - DESTINATION ${FILESDIR}/cfg + DESTINATION ${FILESDIR_DEF}/cfg COMPONENT headers) install(FILES ${platforms} - DESTINATION ${FILESDIR}/platforms + DESTINATION ${FILESDIR_DEF}/platforms COMPONENT headers) -endif() \ No newline at end of file +endif() diff --git a/cli/cli.vcxproj b/cli/cli.vcxproj index f532fa46e7d..5d4ee25b0e3 100644 --- a/cli/cli.vcxproj +++ b/cli/cli.vcxproj @@ -85,14 +85,14 @@ - ..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) + ..\lib;..\frontend;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) true ProgramDatabase Disabled CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level4 - 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4701;4706;4800;4805 true Use precompiled.h @@ -114,14 +114,14 @@ - ..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) + ..\lib;..\frontend;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) true ProgramDatabase Disabled CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level4 - 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4701;4706;4800;4805 true Use precompiled.h @@ -143,7 +143,7 @@ - ..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) + ..\lib;..\frontend;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) false MaxSpeed CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) @@ -155,7 +155,7 @@ true true true - 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4701;4706;4800;4805 ProgramDatabase true Use @@ -181,7 +181,7 @@ - ..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) + ..\lib;..\frontend;..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) false MaxSpeed CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) @@ -193,7 +193,7 @@ true true true - 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4701;4706;4800;4805 ProgramDatabase true Use @@ -223,14 +223,15 @@ - + + @@ -240,7 +241,6 @@ - Create Create @@ -250,10 +250,12 @@ + + diff --git a/cli/cli.vcxproj.filters b/cli/cli.vcxproj.filters index 2320255e6b5..5d3bd1c86cc 100644 --- a/cli/cli.vcxproj.filters +++ b/cli/cli.vcxproj.filters @@ -23,9 +23,6 @@ Header Files - - Header Files - Header Files @@ -44,6 +41,12 @@ Header Files + + Header Files + + + Header Files + @@ -55,9 +58,6 @@ Source Files - - Source Files - Source Files @@ -79,6 +79,12 @@ Source Files + + Source Files + + + Source Files + diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 51eded9cb71..608e1844716 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -1,6 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2024 Cppcheck team. + * Copyright (C) 2007-2025 Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,10 +20,10 @@ #include "addoninfo.h" #include "check.h" +#include "checkers.h" #include "color.h" #include "config.h" #include "cppcheck.h" -#include "cppcheckexecutor.h" #include "errorlogger.h" #include "errortypes.h" #include "filelister.h" @@ -39,10 +39,11 @@ #include "timer.h" #include "utils.h" +#include "frontend.h" + #include #include #include -#include #include #include // EXIT_FAILURE #include @@ -129,6 +130,12 @@ namespace { reportOut(msg.toXML()); } + void reportMetric(const std::string &metric) override + { + /* Not used here */ + (void) metric; + } + void reportProgress(const std::string & /*filename*/, const char /*stage*/[], const std::size_t /*value*/) override {} }; @@ -164,8 +171,8 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[]) // Check that all include paths exist { - for (std::list::iterator iter = mSettings.includePaths.begin(); - iter != mSettings.includePaths.end(); + for (auto iter = mSettings.includePaths.cbegin(); + iter != mSettings.includePaths.cend(); ) { const std::string path(Path::toNativeSeparators(*iter)); if (Path::isDirectory(path)) @@ -202,11 +209,13 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[]) std::list fileSettings; if (!mSettings.fileFilters.empty()) { // filter only for the selected filenames from all project files + PathMatch filtermatcher(mSettings.fileFilters, Path::getCurrentPath()); std::copy_if(fileSettingsRef.cbegin(), fileSettingsRef.cend(), std::back_inserter(fileSettings), [&](const FileSettings &fs) { - return matchglobs(mSettings.fileFilters, fs.filename()); + return filtermatcher.match(fs.filename()); }); if (fileSettings.empty()) { - mLogger.printError("could not find any files matching the filter."); + for (const std::string& f: mSettings.fileFilters) + mLogger.printError("could not find any files matching the filter:" + f); return false; } } @@ -216,6 +225,8 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[]) mFileSettings.clear(); + frontend::applyLang(fileSettings, mSettings, mEnforcedLang); + // sort the markup last std::copy_if(fileSettings.cbegin(), fileSettings.cend(), std::back_inserter(mFileSettings), [&](const FileSettings &fs) { return !mSettings.library.markupFile(fs.filename()) || !mSettings.library.processMarkupAfterCode(fs.filename()); @@ -233,18 +244,11 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[]) if (!pathnamesRef.empty()) { std::list filesResolved; - // TODO: this needs to be inlined into PathMatch as it depends on the underlying filesystem -#if defined(_WIN32) - // For Windows we want case-insensitive path matching - const bool caseSensitive = false; -#else - const bool caseSensitive = true; -#endif // Execute recursiveAddFiles() to each given file parameter // TODO: verbose log which files were ignored? - const PathMatch matcher(ignored, caseSensitive); + const PathMatch matcher(ignored, Path::getCurrentPath()); for (const std::string &pathname : pathnamesRef) { - const std::string err = FileLister::recursiveAddFiles(filesResolved, Path::toNativeSeparators(pathname), mSettings.library.markupExtensions(), matcher); + const std::string err = FileLister::recursiveAddFiles(filesResolved, Path::toNativeSeparators(pathname), mSettings.library.markupExtensions(), matcher, mSettings.debugignore); if (!err.empty()) { // TODO: bail out? mLogger.printMessage(err); @@ -274,11 +278,10 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[]) std::list files; if (!mSettings.fileFilters.empty()) { - std::copy_if(filesResolved.cbegin(), filesResolved.cend(), std::inserter(files, files.end()), [&](const FileWithDetails& entry) { - return matchglobs(mSettings.fileFilters, entry.path()); - }); + files = filterFiles(mSettings.fileFilters, filesResolved); if (files.empty()) { - mLogger.printError("could not find any files matching the filter."); + for (const std::string& f: mSettings.fileFilters) + mLogger.printError("could not find any files matching the filter:" + f); return false; } } @@ -286,6 +289,8 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[]) files = std::move(filesResolved); } + frontend::applyLang(files, mSettings, mEnforcedLang); + // sort the markup last std::copy_if(files.cbegin(), files.cend(), std::inserter(mFiles, mFiles.end()), [&](const FileWithDetails& entry) { return !mSettings.library.markupFile(entry.path()) || !mSettings.library.processMarkupAfterCode(entry.path()); @@ -310,6 +315,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a { mSettings.exename = Path::getCurrentExecutablePath(argv[0]); + bool xmlOptionProvided = false; + bool outputFormatOptionProvided = false; + // default to --check-level=normal from CLI for now mSettings.setCheckLevel(Settings::CheckLevel::normal); @@ -342,9 +350,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a return Result::Fail; { XMLErrorMessagesLogger xmlLogger; - std::cout << ErrorMessage::getXMLHeader(mSettings.cppcheckCfgProductName); + std::cout << ErrorMessage::getXMLHeader(mSettings.cppcheckCfgProductName, 2); CppCheck::getErrorMessages(xmlLogger); - std::cout << ErrorMessage::getXMLFooter() << std::endl; + std::cout << ErrorMessage::getXMLFooter(2) << std::endl; } return Result::Exit; } @@ -355,1058 +363,1181 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a return Result::Exit; } + if (std::strcmp(argv[i], "--filesdir") == 0) { +#ifdef FILESDIR + mLogger.printRaw(FILESDIR); // TODO: should not include newline +#endif + return Result::Exit; + } + if (std::strcmp(argv[i], "--version") == 0) { if (!loadCppcheckCfg()) return Result::Fail; const std::string version = getVersion(); - mLogger.printRaw(version); + mLogger.printRaw(version); // TODO: should not include newline return Result::Exit; } } bool def = false; bool maxconfigs = false; + bool debug = false; + ImportProject::Type projectType = ImportProject::Type::NONE; ImportProject project; + std::string vsConfig; + + std::string platform; + char defaultSign = '\0'; + + std::vector lookupPaths{argv[0]}; bool executorAuto = true; - int8_t logMissingInclude{0}; for (int i = 1; i < argc; i++) { - if (argv[i][0] == '-') { - // User define - if (std::strncmp(argv[i], "-D", 2) == 0) { - std::string define; - - // "-D define" - if (std::strcmp(argv[i], "-D") == 0) { - ++i; - if (i >= argc || argv[i][0] == '-') { - mLogger.printError("argument to '-D' is missing."); - return Result::Fail; - } + if (argv[i][0] != '-') { + mPathNames.emplace_back(Path::fromNativeSeparators(Path::removeQuotationMarks(argv[i]))); + } - define = argv[i]; - } - // "-Ddefine" - else { - define = 2 + argv[i]; + // User define + else if (std::strncmp(argv[i], "-D", 2) == 0) { + std::string define; + + // "-D define" + if (std::strcmp(argv[i], "-D") == 0) { + ++i; + if (i >= argc || argv[i][0] == '-') { + mLogger.printError("argument to '-D' is missing."); + return Result::Fail; } - // No "=", append a "=1" - if (define.find('=') == std::string::npos) - define += "=1"; + define = argv[i]; + } + // "-Ddefine" + else { + define = 2 + argv[i]; + } - if (!mSettings.userDefines.empty()) - mSettings.userDefines += ";"; - mSettings.userDefines += define; + // No "=", append a "=1" + if (define.find('=') == std::string::npos) + define += "=1"; - def = true; - } + if (!mSettings.userDefines.empty()) + mSettings.userDefines += ";"; + mSettings.userDefines += define; - // -E - else if (std::strcmp(argv[i], "-E") == 0) { - mSettings.preprocessOnly = true; - mSettings.quiet = true; - } + def = true; + } - // Include paths - else if (std::strncmp(argv[i], "-I", 2) == 0) { - std::string path; + // -E + else if (std::strcmp(argv[i], "-E") == 0) { + mSettings.preprocessOnly = true; + mSettings.quiet = true; + } - // "-I path/" - if (std::strcmp(argv[i], "-I") == 0) { - ++i; - if (i >= argc || argv[i][0] == '-') { - mLogger.printError("argument to '-I' is missing."); - return Result::Fail; - } - path = argv[i]; - } + // Include paths + else if (std::strncmp(argv[i], "-I", 2) == 0) { + std::string path; - // "-Ipath/" - else { - path = 2 + argv[i]; + // "-I path/" + if (std::strcmp(argv[i], "-I") == 0) { + ++i; + if (i >= argc || argv[i][0] == '-') { + mLogger.printError("argument to '-I' is missing."); + return Result::Fail; } - path = Path::removeQuotationMarks(std::move(path)); - path = Path::fromNativeSeparators(std::move(path)); - - // If path doesn't end with / or \, add it - if (!endsWith(path,'/')) - path += '/'; + path = argv[i]; + } - mSettings.includePaths.emplace_back(std::move(path)); + // "-Ipath/" + else { + path = 2 + argv[i]; } + path = Path::removeQuotationMarks(std::move(path)); + path = Path::fromNativeSeparators(std::move(path)); - // User undef - else if (std::strncmp(argv[i], "-U", 2) == 0) { - std::string undef; + // If path doesn't end with / or \, add it + if (!endsWith(path,'/')) + path += '/'; - // "-U undef" - if (std::strcmp(argv[i], "-U") == 0) { - ++i; - if (i >= argc || argv[i][0] == '-') { - mLogger.printError("argument to '-U' is missing."); - return Result::Fail; - } + mSettings.includePaths.emplace_back(std::move(path)); + } - undef = argv[i]; - } - // "-Uundef" - else { - undef = 2 + argv[i]; + // User undef + else if (std::strncmp(argv[i], "-U", 2) == 0) { + std::string undef; + + // "-U undef" + if (std::strcmp(argv[i], "-U") == 0) { + ++i; + if (i >= argc || argv[i][0] == '-') { + mLogger.printError("argument to '-U' is missing."); + return Result::Fail; } - mSettings.userUndefs.insert(std::move(undef)); + undef = argv[i]; + } + // "-Uundef" + else { + undef = 2 + argv[i]; } - else if (std::strncmp(argv[i], "--addon=", 8) == 0) - mSettings.addons.emplace(argv[i]+8); + mSettings.userUndefs.insert(std::move(undef)); + } - else if (std::strncmp(argv[i],"--addon-python=", 15) == 0) - mSettings.addonPython.assign(argv[i]+15); + else if (std::strncmp(argv[i], "--addon=", 8) == 0) + mSettings.addons.emplace(argv[i]+8); - // Check configuration - else if (std::strcmp(argv[i], "--check-config") == 0) - mSettings.checkConfiguration = true; + else if (std::strncmp(argv[i],"--addon-python=", 15) == 0) + mSettings.addonPython.assign(argv[i]+15); - // Check level - else if (std::strncmp(argv[i], "--check-level=", 14) == 0) { - Settings::CheckLevel level = Settings::CheckLevel::normal; - const std::string level_s(argv[i] + 14); - if (level_s == "normal") - level = Settings::CheckLevel::normal; - else if (level_s == "exhaustive") - level = Settings::CheckLevel::exhaustive; - else { - mLogger.printError("unknown '--check-level' value '" + level_s + "'."); - return Result::Fail; - } + else if (std::strcmp(argv[i],"--analyze-all-vs-configs") == 0) { + mSettings.analyzeAllVsConfigs = true; + mAnalyzeAllVsConfigsSetOnCmdLine = true; + } - mSettings.setCheckLevel(level); + // Check configuration + else if (std::strcmp(argv[i], "--check-config") == 0) + mSettings.checkConfiguration = true; + + else if (std::strcmp(argv[i], "--check-headers") == 0) + mSettings.checkHeaders = true; + + // Check level + else if (std::strncmp(argv[i], "--check-level=", 14) == 0) { + Settings::CheckLevel level = Settings::CheckLevel::normal; + const std::string level_s(argv[i] + 14); + if (level_s == "reduced") + level = Settings::CheckLevel::reduced; + else if (level_s == "normal") + level = Settings::CheckLevel::normal; + else if (level_s == "exhaustive") + level = Settings::CheckLevel::exhaustive; + else { + mLogger.printError("unknown '--check-level' value '" + level_s + "'."); + return Result::Fail; } - // Check library definitions - else if (std::strcmp(argv[i], "--check-library") == 0) { - mSettings.checkLibrary = true; - } + mSettings.setCheckLevel(level); + } - else if (std::strncmp(argv[i], "--check-version=", 16) == 0) { - if (!loadCppcheckCfg()) - return Result::Fail; - const std::string actualVersion = getVersion(); - const std::string wantedVersion = argv[i] + 16; - if (actualVersion != wantedVersion) { - mLogger.printError("--check-version check failed. Aborting."); - return Result::Fail; - } - } + // Check library definitions + else if (std::strcmp(argv[i], "--check-library") == 0) { + mSettings.checkLibrary = true; + } - else if (std::strncmp(argv[i], "--checkers-report=", 18) == 0) - mSettings.checkersReportFilename = argv[i] + 18; + else if (std::strcmp(argv[i], "--check-unused-templates") == 0) + mSettings.checkUnusedTemplates = true; - else if (std::strncmp(argv[i], "--checks-max-time=", 18) == 0) { - if (!parseNumberArg(argv[i], 18, mSettings.checksMaxTime, true)) - return Result::Fail; + else if (std::strncmp(argv[i], "--check-version=", 16) == 0) { + if (!loadCppcheckCfg()) + return Result::Fail; + const std::string actualVersion = getVersion(); + const std::string wantedVersion = argv[i] + 16; + if (actualVersion != wantedVersion) { + mLogger.printError("--check-version check failed. Aborting."); + return Result::Fail; } + } - else if (std::strcmp(argv[i], "--clang") == 0) { - mSettings.clang = true; - } + else if (std::strncmp(argv[i], "--checkers-report=", 18) == 0) + mSettings.checkersReportFilename = argv[i] + 18; - else if (std::strncmp(argv[i], "--clang=", 8) == 0) { - mSettings.clang = true; - mSettings.clangExecutable = argv[i] + 8; - } + else if (std::strncmp(argv[i], "--checks-max-time=", 18) == 0) { + if (!parseNumberArg(argv[i], 18, mSettings.checksMaxTime, true)) + return Result::Fail; + } - else if (std::strncmp(argv[i], "--config-exclude=",17) ==0) { - mSettings.configExcludePaths.insert(Path::fromNativeSeparators(argv[i] + 17)); - } + else if (std::strcmp(argv[i], "--clang") == 0) { + mSettings.clang = true; + } - else if (std::strncmp(argv[i], "--config-excludes-file=", 23) == 0) { - // open this file and read every input file (1 file name per line) - const std::string cfgExcludesFile(23 + argv[i]); - if (!addPathsToSet(cfgExcludesFile, mSettings.configExcludePaths)) { - mLogger.printError("unable to open config excludes file at '" + cfgExcludesFile + "'"); - return Result::Fail; - } - } + else if (std::strncmp(argv[i], "--clang=", 8) == 0) { + mSettings.clang = true; + mSettings.clangExecutable = argv[i] + 8; + } - else if (std::strncmp(argv[i], "--cppcheck-build-dir=", 21) == 0) { - mSettings.buildDir = Path::fromNativeSeparators(argv[i] + 21); - if (endsWith(mSettings.buildDir, '/')) - mSettings.buildDir.pop_back(); + else if (std::strcmp(argv[i], "--clang-tidy") == 0) { + mSettings.clangTidy = true; + } - if (!Path::isDirectory(mSettings.buildDir)) { - mLogger.printError("Directory '" + mSettings.buildDir + "' specified by --cppcheck-build-dir argument has to be existent."); - return Result::Fail; - } + else if (std::strncmp(argv[i], "--clang-tidy=", 13) == 0) { + mSettings.clangTidy = true; + mSettings.clangTidyExecutable = argv[i] + 13; + } + + else if (std::strncmp(argv[i], "--config-exclude=",17) ==0) { + mSettings.configExcludePaths.insert(Path::fromNativeSeparators(argv[i] + 17)); + } + + else if (std::strncmp(argv[i], "--config-excludes-file=", 23) == 0) { + // open this file and read every input file (1 file name per line) + const std::string cfgExcludesFile(23 + argv[i]); + if (!addPathsToSet(cfgExcludesFile, mSettings.configExcludePaths)) { + mLogger.printError("unable to open config excludes file at '" + cfgExcludesFile + "'"); + return Result::Fail; } + } - else if (std::strcmp(argv[i], "--cpp-header-probe") == 0) { - mSettings.cppHeaderProbe = true; + else if (std::strncmp(argv[i], "--cppcheck-build-dir=", 21) == 0) { + std::string path = Path::fromNativeSeparators(argv[i] + 21); + if (path.empty()) { + mLogger.printError("no path has been specified for --cppcheck-build-dir"); + return Result::Fail; } + if (endsWith(path, '/')) + path.pop_back(); + mSettings.buildDir = std::move(path); + } - // Show --debug output after the first simplifications - else if (std::strcmp(argv[i], "--debug") == 0 || - std::strcmp(argv[i], "--debug-normal") == 0) - mSettings.debugnormal = true; + else if (std::strcmp(argv[i], "--cpp-header-probe") == 0) { + mSettings.cppHeaderProbe = true; + } - // Show debug warnings for lookup for configuration files - else if (std::strcmp(argv[i], "--debug-lookup") == 0) - mSettings.debuglookup = true; + else if (std::strcmp(argv[i], "--debug-ast") == 0) + mSettings.debugast = true; - else if (std::strncmp(argv[i], "--debug-lookup=", 15) == 0) { - const std::string lookup = argv[i] + 15; - if (lookup == "all") - mSettings.debuglookup = true; - else if (lookup == "addon") - mSettings.debuglookupAddon = true; - else if (lookup == "config") - mSettings.debuglookupConfig = true; - else if (lookup == "library") - mSettings.debuglookupLibrary = true; - else if (lookup == "platform") - mSettings.debuglookupPlatform = true; - else - { - mLogger.printError("unknown lookup '" + lookup + "'"); - return Result::Fail; - } - } + // Show debug warnings for lookup for configuration files + else if (std::strcmp(argv[i], "--debug-clang-output") == 0) + mSettings.debugClangOutput = true; - // Flag used for various purposes during debugging - else if (std::strcmp(argv[i], "--debug-simplified") == 0) - mSettings.debugSimplified = true; + // Show debug messages for ignored files + else if (std::strcmp(argv[i], "--debug-ignore") == 0) + mSettings.debugignore = true; - // Show template information - else if (std::strcmp(argv[i], "--debug-template") == 0) - mSettings.debugtemplate = true; + // Show --debug output after the first simplifications + else if (std::strcmp(argv[i], "--debug") == 0 || + std::strcmp(argv[i], "--debug-normal") == 0) + debug = true; - // Show debug warnings - else if (std::strcmp(argv[i], "--debug-warnings") == 0) - mSettings.debugwarnings = true; + // Show debug warnings for lookup for configuration files + else if (std::strcmp(argv[i], "--debug-lookup") == 0) + mSettings.debuglookup = true; - else if (std::strncmp(argv[i], "--disable=", 10) == 0) { - const std::string errmsg = mSettings.removeEnabled(argv[i] + 10); - if (!errmsg.empty()) { - mLogger.printError(errmsg); - return Result::Fail; - } - if (std::string(argv[i] + 10).find("missingInclude") != std::string::npos) { - --logMissingInclude; - } + else if (std::strncmp(argv[i], "--debug-lookup=", 15) == 0) { + const std::string lookup = argv[i] + 15; + if (lookup == "all") + mSettings.debuglookup = true; + else if (lookup == "addon") + mSettings.debuglookupAddon = true; + else if (lookup == "config") + mSettings.debuglookupConfig = true; + else if (lookup == "library") + mSettings.debuglookupLibrary = true; + else if (lookup == "platform") + mSettings.debuglookupPlatform = true; + else + { + mLogger.printError("unknown lookup '" + lookup + "'"); + return Result::Fail; } + } - // dump cppcheck data - else if (std::strcmp(argv[i], "--dump") == 0) - mSettings.dump = true; + // Flag used for various purposes during debugging + else if (std::strcmp(argv[i], "--debug-simplified") == 0) + mSettings.debugSimplified = true; - else if (std::strncmp(argv[i], "--enable=", 9) == 0) { - const std::string enable_arg = argv[i] + 9; - const std::string errmsg = mSettings.addEnabled(enable_arg); - if (!errmsg.empty()) { - mLogger.printError(errmsg); - return Result::Fail; - } - // when "style" is enabled, also enable "warning", "performance" and "portability" - if (enable_arg.find("style") != std::string::npos) { - mSettings.addEnabled("warning"); - mSettings.addEnabled("performance"); - mSettings.addEnabled("portability"); - } - if (enable_arg.find("information") != std::string::npos && logMissingInclude == 0) { - ++logMissingInclude; - mSettings.addEnabled("missingInclude"); - } - if (enable_arg.find("missingInclude") != std::string::npos) { - --logMissingInclude; - } + else if (std::strcmp(argv[i], "--debug-symdb") == 0) + mSettings.debugsymdb = true; + + // Show template information + else if (std::strcmp(argv[i], "--debug-template") == 0) + mSettings.debugtemplate = true; + + else if (std::strcmp(argv[i], "--debug-valueflow") == 0) + mSettings.debugvalueflow = true; + + // Show debug warnings + else if (std::strcmp(argv[i], "--debug-warnings") == 0) + mSettings.debugwarnings = true; + + else if (std::strncmp(argv[i], "--disable=", 10) == 0) { + const std::string errmsg = mSettings.removeEnabled(argv[i] + 10); + if (!errmsg.empty()) { + mLogger.printError(errmsg); + return Result::Fail; } + } - // --error-exitcode=1 - else if (std::strncmp(argv[i], "--error-exitcode=", 17) == 0) { - if (!parseNumberArg(argv[i], 17, mSettings.exitCode)) - return Result::Fail; + // dump cppcheck data + else if (std::strcmp(argv[i], "--dump") == 0) + mSettings.dump = true; + + else if (std::strcmp(argv[i], "--emit-duplicates") == 0) + mSettings.emitDuplicates = true; + + else if (std::strncmp(argv[i], "--enable=", 9) == 0) { + const std::string enable_arg = argv[i] + 9; + const std::string errmsg = mSettings.addEnabled(enable_arg); + if (!errmsg.empty()) { + mLogger.printError(errmsg); + return Result::Fail; + } + // when "style" is enabled, also enable "warning", "performance" and "portability" + if (enable_arg.find("style") != std::string::npos) { + mSettings.addEnabled("warning"); + mSettings.addEnabled("performance"); + mSettings.addEnabled("portability"); } + } - // Exception handling inside cppcheck client - else if (std::strcmp(argv[i], "--exception-handling") == 0) { + // --error-exitcode=1 + else if (std::strncmp(argv[i], "--error-exitcode=", 17) == 0) { + if (!parseNumberArg(argv[i], 17, mSettings.exitCode)) + return Result::Fail; + } + + // Exception handling inside cppcheck client + else if (std::strcmp(argv[i], "--exception-handling") == 0) { #if defined(USE_WINDOWS_SEH) || defined(USE_UNIX_SIGNAL_HANDLING) - mSettings.exceptionHandling = true; + mSettings.exceptionHandling = true; #else - mLogger.printError("Option --exception-handling is not supported since Cppcheck has not been built with any exception handling enabled."); - return Result::Fail; + mLogger.printError("Option --exception-handling is not supported since Cppcheck has not been built with any exception handling enabled."); + return Result::Fail; #endif - } + } - // Exception handling inside cppcheck client - else if (std::strncmp(argv[i], "--exception-handling=", 21) == 0) { + // Exception handling inside cppcheck client + else if (std::strncmp(argv[i], "--exception-handling=", 21) == 0) { #if defined(USE_WINDOWS_SEH) || defined(USE_UNIX_SIGNAL_HANDLING) - const std::string exceptionOutfilename = argv[i] + 21; - if (exceptionOutfilename != "stderr" && exceptionOutfilename != "stdout") { - mLogger.printError("invalid '--exception-handling' argument"); - return Result::Fail; - } - mSettings.exceptionHandling = true; - CppCheckExecutor::setExceptionOutput((exceptionOutfilename == "stderr") ? stderr : stdout); -#else - mLogger.printError("Option --exception-handling is not supported since Cppcheck has not been built with any exception handling enabled."); + const std::string exceptionOutfilename = argv[i] + 21; + if (exceptionOutfilename != "stderr" && exceptionOutfilename != "stdout") { + mLogger.printError("invalid '--exception-handling' argument"); return Result::Fail; -#endif } + mSettings.exceptionHandling = true; + mSettings.exceptionOutput = (exceptionOutfilename == "stderr") ? stderr : stdout; +#else + mLogger.printError("Option --exception-handling is not supported since Cppcheck has not been built with any exception handling enabled."); + return Result::Fail; +#endif + } - else if (std::strncmp(argv[i], "--executor=", 11) == 0) { - const std::string type = 11 + argv[i]; - if (type == "auto") { - executorAuto = true; - mSettings.executor = Settings::defaultExecutor(); - } - else if (type == "thread") { + else if (std::strncmp(argv[i], "--executor=", 11) == 0) { + const std::string type = 11 + argv[i]; + if (type == "auto") { + executorAuto = true; + mSettings.executor = Settings::defaultExecutor(); + } + else if (type == "thread") { #if defined(HAS_THREADING_MODEL_THREAD) - executorAuto = false; - mSettings.executor = Settings::ExecutorType::Thread; + executorAuto = false; + mSettings.executor = Settings::ExecutorType::Thread; #else - mLogger.printError("executor type 'thread' cannot be used as Cppcheck has not been built with a respective threading model."); - return Result::Fail; + mLogger.printError("executor type 'thread' cannot be used as Cppcheck has not been built with a respective threading model."); + return Result::Fail; #endif - } - else if (type == "process") { + } + else if (type == "process") { #if defined(HAS_THREADING_MODEL_FORK) - executorAuto = false; - mSettings.executor = Settings::ExecutorType::Process; + executorAuto = false; + mSettings.executor = Settings::ExecutorType::Process; #else - mLogger.printError("executor type 'process' cannot be used as Cppcheck has not been built with a respective threading model."); - return Result::Fail; + mLogger.printError("executor type 'process' cannot be used as Cppcheck has not been built with a respective threading model."); + return Result::Fail; #endif - } - else { - mLogger.printError("unknown executor: '" + type + "'."); - return Result::Fail; - } } + else { + mLogger.printError("unknown executor: '" + type + "'."); + return Result::Fail; + } + } - // Filter errors - else if (std::strncmp(argv[i], "--exitcode-suppressions=", 24) == 0) { - // exitcode-suppressions=filename.txt - std::string filename = 24 + argv[i]; + // Filter errors + else if (std::strncmp(argv[i], "--exitcode-suppressions=", 24) == 0) { + // exitcode-suppressions=filename.txt + std::string filename = 24 + argv[i]; - std::ifstream f(filename); - if (!f.is_open()) { - mLogger.printError("couldn't open the file: \"" + filename + "\"."); - return Result::Fail; - } - const std::string errmsg(mSuppressions.nofail.parseFile(f)); - if (!errmsg.empty()) { - mLogger.printError(errmsg); - return Result::Fail; - } + std::ifstream f(filename); + if (!f.is_open()) { + mLogger.printError("couldn't open the file: \"" + filename + "\"."); + return Result::Fail; } - - // use a file filter - else if (std::strncmp(argv[i], "--file-filter=", 14) == 0) { - const char *filter = argv[i] + 14; - if (std::strcmp(filter, "-") == 0) { - if (!addFilesToList(filter, mSettings.fileFilters)) { - mLogger.printError("Failed: --file-filter=-"); - return Result::Fail; - } - } else { - mSettings.fileFilters.emplace_back(filter); - } + const std::string errmsg(mSuppressions.nofail.parseFile(f)); + if (!errmsg.empty()) { + mLogger.printError(errmsg); + return Result::Fail; } + } - // file list specified - else if (std::strncmp(argv[i], "--file-list=", 12) == 0) { - // open this file and read every input file (1 file name per line) - const std::string fileList = argv[i] + 12; - if (!addFilesToList(fileList, mPathNames)) { - mLogger.printError("couldn't open the file: \"" + fileList + "\"."); + // use a file filter + else if (std::strncmp(argv[i], "--file-filter=", 14) == 0) { + const char *filter = argv[i] + 14; + if (std::strcmp(filter, "-") == 0) { + if (!addFilesToList(filter, mSettings.fileFilters)) { + mLogger.printError("Failed: --file-filter=-"); return Result::Fail; } + } else { + mSettings.fileFilters.emplace_back(filter); } + } - // Force checking of files that have "too many" configurations - else if (std::strcmp(argv[i], "-f") == 0 || std::strcmp(argv[i], "--force") == 0) - mSettings.force = true; - - else if (std::strcmp(argv[i], "--fsigned-char") == 0) - mSettings.platform.defaultSign = 's'; - - else if (std::strcmp(argv[i], "--funsigned-char") == 0) - mSettings.platform.defaultSign = 'u'; + // file list specified + else if (std::strncmp(argv[i], "--file-list=", 12) == 0) { + // open this file and read every input file (1 file name per line) + const std::string fileList = argv[i] + 12; + if (!addFilesToList(fileList, mPathNames)) { + mLogger.printError("couldn't open the file: \"" + fileList + "\"."); + return Result::Fail; + } + } - // Ignored paths - else if (std::strncmp(argv[i], "-i", 2) == 0) { - std::string path; + // Force checking of files that have "too many" configurations + else if (std::strcmp(argv[i], "-f") == 0 || std::strcmp(argv[i], "--force") == 0) + mSettings.force = true; - // "-i path/" - if (std::strcmp(argv[i], "-i") == 0) { - ++i; - if (i >= argc || argv[i][0] == '-') { - mLogger.printError("argument to '-i' is missing."); - return Result::Fail; - } - path = argv[i]; - } + else if (std::strcmp(argv[i], "--fsigned-char") == 0) + defaultSign = 's'; - // "-ipath/" - else { - path = 2 + argv[i]; - } + else if (std::strcmp(argv[i], "--funsigned-char") == 0) + defaultSign = 'u'; - if (!path.empty()) { - path = Path::removeQuotationMarks(std::move(path)); - path = Path::fromNativeSeparators(std::move(path)); - path = Path::simplifyPath(std::move(path)); + // Ignored paths + else if (std::strncmp(argv[i], "-i", 2) == 0) { + std::string path; - // TODO: this only works when it exists - if (Path::isDirectory(path)) { - // If directory name doesn't end with / or \, add it - if (!endsWith(path, '/')) - path += '/'; - } - mIgnoredPaths.emplace_back(std::move(path)); + // "-i path/" + if (std::strcmp(argv[i], "-i") == 0) { + ++i; + if (i >= argc || argv[i][0] == '-') { + mLogger.printError("argument to '-i' is missing."); + return Result::Fail; } + path = argv[i]; } - else if (std::strncmp(argv[i], "--include=", 10) == 0) { - mSettings.userIncludes.emplace_back(Path::fromNativeSeparators(argv[i] + 10)); + // "-ipath/" + else { + path = 2 + argv[i]; } - else if (std::strncmp(argv[i], "--includes-file=", 16) == 0) { - // open this file and read every input file (1 file name per line) - const std::string includesFile(16 + argv[i]); - if (!addIncludePathsToList(includesFile, mSettings.includePaths)) { - mLogger.printError("unable to open includes file at '" + includesFile + "'"); - return Result::Fail; - } + if (!path.empty()) { + mIgnoredPaths.emplace_back(std::move(path)); } + } - // Inconclusive checking - else if (std::strcmp(argv[i], "--inconclusive") == 0) - mSettings.certainty.enable(Certainty::inconclusive); - - // Enables inline suppressions. - else if (std::strcmp(argv[i], "--inline-suppr") == 0) - mSettings.inlineSuppressions = true; + else if (std::strncmp(argv[i], "--include=", 10) == 0) { + mSettings.userIncludes.emplace_back(Path::fromNativeSeparators(argv[i] + 10)); + } - // Checking threads - else if (std::strncmp(argv[i], "-j", 2) == 0) { - std::string numberString; + else if (std::strncmp(argv[i], "--includes-file=", 16) == 0) { + // open this file and read every input file (1 file name per line) + const std::string includesFile(16 + argv[i]); + if (!addIncludePathsToList(includesFile, mSettings.includePaths)) { + mLogger.printError("unable to open includes file at '" + includesFile + "'"); + return Result::Fail; + } + } - // "-j 3" - if (std::strcmp(argv[i], "-j") == 0) { - ++i; - if (i >= argc || argv[i][0] == '-') { - mLogger.printError("argument to '-j' is missing."); - return Result::Fail; - } + // Inconclusive checking + else if (std::strcmp(argv[i], "--inconclusive") == 0) + mSettings.certainty.enable(Certainty::inconclusive); - numberString = argv[i]; - } + // Enables inline suppressions. + else if (std::strcmp(argv[i], "--inline-suppr") == 0) + mSettings.inlineSuppressions = true; - // "-j3" - else - numberString = argv[i]+2; + // Checking threads + else if (std::strncmp(argv[i], "-j", 2) == 0) { + std::string numberString; - unsigned int tmp; - std::string err; - if (!strToInt(numberString, tmp, &err)) { - mLogger.printError("argument to '-j' is not valid - " + err + "."); + // "-j 3" + if (std::strcmp(argv[i], "-j") == 0) { + ++i; + if (i >= argc || argv[i][0] == '-') { + mLogger.printError("argument to '-j' is missing."); return Result::Fail; } - if (tmp == 0) { - // TODO: implement get CPU logical core count and use that. - // Usually, -j 0 would mean "use all available cores," but - // if we get a 0, we just stall and don't do any work. - mLogger.printError("argument for '-j' must be greater than 0."); - return Result::Fail; - } - if (tmp > 1024) { - // Almost nobody has 1024 logical cores, but somebody out - // there does. - mLogger.printError("argument for '-j' is allowed to be 1024 at max."); - return Result::Fail; - } - mSettings.jobs = tmp; + + numberString = argv[i]; } - else if (std::strncmp(argv[i], "-l", 2) == 0) { -#ifdef HAS_THREADING_MODEL_FORK - std::string numberString; + // "-j3" + else + numberString = argv[i]+2; - // "-l 3" - if (std::strcmp(argv[i], "-l") == 0) { - ++i; - if (i >= argc || argv[i][0] == '-') { - mLogger.printError("argument to '-l' is missing."); - return Result::Fail; - } - - numberString = argv[i]; - } + unsigned int tmp; + std::string err; + if (!strToInt(numberString, tmp, &err)) { + mLogger.printError("argument to '-j' is not valid - " + err + "."); + return Result::Fail; + } + if (tmp == 0) { + // TODO: implement get CPU logical core count and use that. + // Usually, -j 0 would mean "use all available cores," but + // if we get a 0, we just stall and don't do any work. + mLogger.printError("argument for '-j' must be greater than 0."); + return Result::Fail; + } + if (tmp > 1024) { + // Almost nobody has 1024 logical cores, but somebody out + // there does. + mLogger.printError("argument for '-j' is allowed to be 1024 at max."); + return Result::Fail; + } + mSettings.jobs = tmp; + } - // "-l3" - else - numberString = argv[i]+2; + else if (std::strncmp(argv[i], "-l", 2) == 0) { +#ifdef HAS_THREADING_MODEL_FORK + std::string numberString; - int tmp; - std::string err; - if (!strToInt(numberString, tmp, &err)) { - mLogger.printError("argument to '-l' is not valid - " + err + "."); + // "-l 3" + if (std::strcmp(argv[i], "-l") == 0) { + ++i; + if (i >= argc || argv[i][0] == '-') { + mLogger.printError("argument to '-l' is missing."); return Result::Fail; } - mSettings.loadAverage = tmp; -#else - mLogger.printError("Option -l cannot be used as Cppcheck has not been built with fork threading model."); - return Result::Fail; -#endif + + numberString = argv[i]; } - // Enforce language (--language=, -x) - else if (std::strncmp(argv[i], "--language=", 11) == 0 || std::strcmp(argv[i], "-x") == 0) { - std::string str; - if (argv[i][2]) { - str = argv[i]+11; - } else { - i++; - if (i >= argc || argv[i][0] == '-') { - mLogger.printError("no language given to '-x' option."); - return Result::Fail; - } - str = argv[i]; - } + // "-l3" + else + numberString = argv[i]+2; + + int tmp; + std::string err; + if (!strToInt(numberString, tmp, &err)) { + mLogger.printError("argument to '-l' is not valid - " + err + "."); + return Result::Fail; + } + mSettings.loadAverage = tmp; +#else + mLogger.printError("Option -l cannot be used as Cppcheck has not been built with fork threading model."); + return Result::Fail; +#endif + } - if (str == "c") - mSettings.enforcedLang = Standards::Language::C; - else if (str == "c++") - mSettings.enforcedLang = Standards::Language::CPP; - else { - mLogger.printError("unknown language '" + str + "' enforced."); + // Enforce language (--language=, -x) + else if (std::strncmp(argv[i], "--language=", 11) == 0 || std::strcmp(argv[i], "-x") == 0) { + std::string str; + if (argv[i][2]) { + str = argv[i]+11; + } else { + i++; + if (i >= argc || argv[i][0] == '-') { + mLogger.printError("no language given to '-x' option."); return Result::Fail; } + str = argv[i]; } - // --library - else if (std::strncmp(argv[i], "--library=", 10) == 0) { - std::list libs = splitString(argv[i] + 10, ','); - for (auto& l : libs) { - if (l.empty()) { - mLogger.printError("empty library specified."); - return Result::Fail; - } - mSettings.libraries.emplace_back(std::move(l)); - } + if (str == "c") + mEnforcedLang = Standards::Language::C; + else if (str == "c++") + mEnforcedLang = Standards::Language::CPP; + else { + mLogger.printError("unknown language '" + str + "' enforced."); + return Result::Fail; } + } - // Set maximum number of #ifdef configurations to check - else if (std::strncmp(argv[i], "--max-configs=", 14) == 0) { - int tmp; - if (!parseNumberArg(argv[i], 14, tmp)) - return Result::Fail; - if (tmp < 1) { - mLogger.printError("argument to '--max-configs=' must be greater than 0."); + // --library + else if (std::strncmp(argv[i], "--library=", 10) == 0) { + std::vector libs = splitString(argv[i] + 10, ','); + for (auto& l : libs) { + if (l.empty()) { + mLogger.printError("empty library specified."); return Result::Fail; } + mSettings.libraries.emplace_back(std::move(l)); + } + } - mSettings.maxConfigs = tmp; - mSettings.force = false; - maxconfigs = true; + // Set maximum number of #ifdef configurations to check + else if (std::strncmp(argv[i], "--max-configs=", 14) == 0) { + int tmp; + if (!parseNumberArg(argv[i], 14, tmp)) + return Result::Fail; + if (tmp < 1) { + mLogger.printError("argument to '--max-configs=' must be greater than 0."); + return Result::Fail; } - // max ctu depth - else if (std::strncmp(argv[i], "--max-ctu-depth=", 16) == 0) { - if (!parseNumberArg(argv[i], 16, mSettings.maxCtuDepth)) - return Result::Fail; + mSettings.maxConfigs = tmp; + mSettings.force = false; + maxconfigs = true; + } + + // max ctu depth + else if (std::strncmp(argv[i], "--max-ctu-depth=", 16) == 0) { + int temp = 0; + if (!parseNumberArg(argv[i], 16, temp)) + return Result::Fail; + if (temp > 10) { + mLogger.printMessage("--max-ctu-depth is being capped at 10. This limitation will be removed in a future Cppcheck version."); + temp = 10; } + mSettings.maxCtuDepth = temp; + } + + else if (std::strncmp(argv[i], "--max-template-recursion=", 25) == 0) { + if (!parseNumberArg(argv[i], 25, mSettings.maxTemplateRecursion)) + return Result::Fail; + } + + else if (std::strcmp(argv[i],"--no-analyze-all-vs-configs") == 0) { + mSettings.analyzeAllVsConfigs = false; + mAnalyzeAllVsConfigsSetOnCmdLine = true; + } + + else if (std::strcmp(argv[i], "--no-check-headers") == 0) + mSettings.checkHeaders = false; - else if (std::strcmp(argv[i], "--no-cpp-header-probe") == 0) { - mSettings.cppHeaderProbe = false; + else if (std::strcmp(argv[i], "--no-check-unused-templates") == 0) + mSettings.checkUnusedTemplates = false; + + // undocumented option for usage in Python tests to indicate that no build dir should be injected + else if (std::strcmp(argv[i], "--no-cppcheck-build-dir") == 0) { + mSettings.buildDir.clear(); + } + + else if (std::strcmp(argv[i], "--no-cpp-header-probe") == 0) { + mSettings.cppHeaderProbe = false; + } + + // Write results in file + else if (std::strncmp(argv[i], "--output-file=", 14) == 0) + mSettings.outputFile = Path::simplifyPath(argv[i] + 14); + + else if (std::strncmp(argv[i], "--output-format=", 16) == 0) { + if (xmlOptionProvided) { + outputFormatOptionMixingError(); + return Result::Fail; } + const std::string format = argv[i] + 16; + // plist can not be handled here because it requires additional data + if (format == "text") + mSettings.outputFormat = Settings::OutputFormat::text; + else if (format == "sarif") + mSettings.outputFormat = Settings::OutputFormat::sarif; + else if (format == "xml") + mSettings.outputFormat = Settings::OutputFormat::xml; + else if (format == "xmlv2") { + mSettings.outputFormat = Settings::OutputFormat::xml; + mSettings.xml_version = 2; + } else if (format == "xmlv3") { + mSettings.outputFormat = Settings::OutputFormat::xml; + mSettings.xml_version = 3; + } else { + mLogger.printError("argument to '--output-format=' must be 'text', 'sarif', 'xml' (deprecated), 'xmlv2' or 'xmlv3'."); + return Result::Fail; + } + mSettings.plistOutput = ""; + outputFormatOptionProvided = true; + } - // Write results in file - else if (std::strncmp(argv[i], "--output-file=", 14) == 0) - mSettings.outputFile = Path::simplifyPath(argv[i] + 14); - // Experimental: limit execution time for extended valueflow analysis. basic valueflow analysis - // is always executed. - else if (std::strncmp(argv[i], "--performance-valueflow-max-time=", 33) == 0) { - if (!parseNumberArg(argv[i], 33, mSettings.vfOptions.maxTime, true)) - return Result::Fail; + // Experimental: limit execution time for extended valueflow analysis. basic valueflow analysis + // is always executed. + else if (std::strncmp(argv[i], "--performance-valueflow-max-time=", 33) == 0) { + if (!parseNumberArg(argv[i], 33, mSettings.vfOptions.maxTime, true)) + return Result::Fail; + } + + else if (std::strncmp(argv[i], "--performance-valueflow-max-if-count=", 37) == 0) { + if (!parseNumberArg(argv[i], 37, mSettings.vfOptions.maxIfCount, true)) + return Result::Fail; + } + + else if (std::strncmp(argv[i], "--performance-valueflow-max-iterations=", 39) == 0) { + if (!parseNumberArg(argv[i], 39, mSettings.vfOptions.maxIterations, true)) + return Result::Fail; + } + + // Specify platform + else if (std::strncmp(argv[i], "--platform=", 11) == 0) { + std::string p = 11 + argv[i]; + if (p.empty()) { + mLogger.printError("empty platform specified."); + return Result::Fail; } + platform = std::move(p); + } - else if (std::strncmp(argv[i], "--performance-valueflow-max-if-count=", 37) == 0) { - if (!parseNumberArg(argv[i], 37, mSettings.vfOptions.maxIfCount, true)) - return Result::Fail; + // Write results in results.plist + else if (std::strncmp(argv[i], "--plist-output=", 15) == 0) { + std::string path = Path::simplifyPath(argv[i] + 15); + if (path.empty()) + path = "."; + + const std::string plistOutput = Path::toNativeSeparators(path); + if (!Path::isDirectory(plistOutput)) { + std::string message("plist folder does not exist: '"); + message += plistOutput; + message += "'."; + mLogger.printError(message); + return Result::Fail; } - // Specify platform - else if (std::strncmp(argv[i], "--platform=", 11) == 0) { - const std::string platform(11+argv[i]); + if (!endsWith(path,'/')) + path += '/'; - std::string errstr; - const std::vector paths = {argv[0]}; - if (!mSettings.platform.set(platform, errstr, paths, mSettings.debuglookup || mSettings.debuglookupPlatform)) { - mLogger.printError(errstr); - return Result::Fail; - } + mSettings.outputFormat = Settings::OutputFormat::plist; + mSettings.plistOutput = std::move(path); + } - // TODO: remove - // these are loaded via external files and thus have Settings::PlatformFile set instead. - // override the type so they behave like the regular platforms. - if (platform == "unix32-unsigned") - mSettings.platform.type = Platform::Type::Unix32; - else if (platform == "unix64-unsigned") - mSettings.platform.type = Platform::Type::Unix64; - } - - // Write results in results.plist - else if (std::strncmp(argv[i], "--plist-output=", 15) == 0) { - mSettings.plistOutput = Path::simplifyPath(argv[i] + 15); - if (mSettings.plistOutput.empty()) - mSettings.plistOutput = "."; - - const std::string plistOutput = Path::toNativeSeparators(mSettings.plistOutput); - if (!Path::isDirectory(plistOutput)) { - std::string message("plist folder does not exist: '"); - message += plistOutput; - message += "'."; - mLogger.printError(message); - return Result::Fail; - } + // Special Cppcheck Premium options + else if ((std::strncmp(argv[i], "--premium=", 10) == 0 || std::strncmp(argv[i], "--premium-", 10) == 0) && isCppcheckPremium()) { + // valid options --premium=.. + const std::set valid{ + "autosar", + "cert-c-2016", + "cert-c++-2016", + "cert-cpp-2016", + "cert-c", + "cert-c++", + "metrics", + "misra-c-2012", + "misra-c-2023", + "misra-c-2025", + "misra-c++-2008", + "misra-cpp-2008", + "misra-c++-2023", + "misra-cpp-2023", + "bughunting", + "safety", + "debug-progress"}; + // valid options --premium-..= + const std::set valid2{ + "cert-c-int-precision", + "license-file" + }; + + if (std::strcmp(argv[i], "--premium=safety-off") == 0) { + mSettings.safety = false; + continue; + } + if (std::strcmp(argv[i], "--premium=safety") == 0) + mSettings.safety = true; + if (!mSettings.premiumArgs.empty()) + mSettings.premiumArgs += " "; + const std::string p(argv[i] + 10); + const std::string p2(p.find('=') != std::string::npos ? p.substr(0, p.find('=')) : ""); + if (!valid.count(p) && !valid2.count(p2)) { + mLogger.printError("invalid --premium option '" + (p2.empty() ? p : p2) + "'."); + return Result::Fail; + } + mSettings.premiumArgs += "--" + p; + if (startsWith(p, "autosar") || startsWith(p, "cert") || startsWith(p, "misra")) { + // All checkers related to the coding standard should be enabled. The coding standards + // do not all undefined behavior or portability issues. + mSettings.addEnabled("warning"); + mSettings.addEnabled("portability"); + } + } - if (!endsWith(mSettings.plistOutput,'/')) - mSettings.plistOutput += '/'; - } - - // Special Cppcheck Premium options - else if (std::strncmp(argv[i], "--premium=", 10) == 0 && isCppcheckPremium()) { - const std::set valid{ - "autosar", - "cert-c-2016", - "cert-c++-2016", - "cert-cpp-2016", - "misra-c-2012", - "misra-c-2023", - "misra-c++-2008", - "misra-cpp-2008", - "misra-c++-2023", - "misra-cpp-2023", - "bughunting", - "safety"}; - - if (std::strcmp(argv[i], "--premium=safety-off") == 0) { - mSettings.safety = false; - continue; - } - if (std::strcmp(argv[i], "--premium=safety") == 0) - mSettings.safety = true; - if (!mSettings.premiumArgs.empty()) - mSettings.premiumArgs += " "; - const std::string p(argv[i] + 10); - if (!valid.count(p) && !startsWith(p, "cert-c-int-precision=")) { - mLogger.printError("invalid --premium option '" + p + "'."); - return Result::Fail; - } - mSettings.premiumArgs += "--" + p; - if (p == "misra-c-2012" || p == "misra-c-2023") - mSettings.addons.emplace("misra"); - if (startsWith(p, "autosar") || startsWith(p, "cert") || startsWith(p, "misra")) { - // All checkers related to the coding standard should be enabled. The coding standards - // do not all undefined behavior or portability issues. - mSettings.addEnabled("warning"); - mSettings.addEnabled("portability"); - } + // --project + else if (std::strncmp(argv[i], "--project=", 10) == 0) { + if (projectType != ImportProject::Type::NONE) + { + mLogger.printError("multiple --project options are not supported."); + return Result::Fail; } - // --project - else if (std::strncmp(argv[i], "--project=", 10) == 0) { - if (project.projectType != ImportProject::Type::NONE) - { - mLogger.printError("multiple --project options are not supported."); - return Result::Fail; - } + mSettings.checkAllConfigurations = false; // Can be overridden with --max-configs or --force + std::string projectFile = argv[i]+10; + projectType = project.import(projectFile, &mSettings, &mSuppressions, isCppcheckPremium()); + if (projectType == ImportProject::Type::CPPCHECK_GUI) { + for (const std::string &lib : project.guiProject.libraries) + mSettings.libraries.emplace_back(lib); - mSettings.checkAllConfigurations = false; // Can be overridden with --max-configs or --force - std::string projectFile = argv[i]+10; - ImportProject::Type projType = project.import(projectFile, &mSettings); - project.projectType = projType; - if (projType == ImportProject::Type::CPPCHECK_GUI) { - for (const std::string &lib : project.guiProject.libraries) - mSettings.libraries.emplace_back(lib); - - const auto& excludedPaths = project.guiProject.excludedPaths; - std::copy(excludedPaths.cbegin(), excludedPaths.cend(), std::back_inserter(mIgnoredPaths)); - - std::string platform(project.guiProject.platform); - - // keep existing platform from command-line intact - if (!platform.empty()) { - std::string errstr; - const std::vector paths = {projectFile, argv[0]}; - if (!mSettings.platform.set(platform, errstr, paths, mSettings.debuglookup || mSettings.debuglookupPlatform)) { - mLogger.printError(errstr); - return Result::Fail; - } - } + const auto& excludedPaths = project.guiProject.excludedPaths; + std::copy(excludedPaths.cbegin(), excludedPaths.cend(), std::back_inserter(mIgnoredPaths)); + + if (!project.guiProject.platform.empty()) + platform = project.guiProject.platform; - const auto& projectFileGui = project.guiProject.projectFile; - if (!projectFileGui.empty()) { - // read underlying project - projectFile = projectFileGui; - projType = project.import(projectFileGui, &mSettings); + // look for external files relative to project first + lookupPaths.insert(lookupPaths.cbegin(), projectFile); + + const auto& projectFileGui = project.guiProject.projectFile; + if (!projectFileGui.empty()) { + // read underlying project + projectFile = projectFileGui; + projectType = project.import(projectFileGui, &mSettings, &mSuppressions); + if (projectType == ImportProject::Type::CPPCHECK_GUI) { + mLogger.printError("nested Cppcheck GUI projects are not supported."); + return Result::Fail; } } - if (projType == ImportProject::Type::VS_SLN || projType == ImportProject::Type::VS_VCXPROJ) { - if (project.guiProject.analyzeAllVsConfigs == "false") - project.selectOneVsConfig(mSettings.platform.type); - mSettings.libraries.emplace_back("windows"); - } - if (projType == ImportProject::Type::MISSING) { - mLogger.printError("failed to open project '" + projectFile + "'. The file does not exist."); - return Result::Fail; - } - if (projType == ImportProject::Type::UNKNOWN) { - mLogger.printError("failed to load project '" + projectFile + "'. The format is unknown."); - return Result::Fail; - } - if (projType == ImportProject::Type::FAILURE) { - mLogger.printError("failed to load project '" + projectFile + "'. An error occurred."); - return Result::Fail; - } } + if (projectType == ImportProject::Type::VS_SLN || projectType == ImportProject::Type::VS_VCXPROJ) { + mSettings.libraries.emplace_back("windows"); + } + if (projectType == ImportProject::Type::MISSING) { + mLogger.printError("failed to open project '" + projectFile + "'. The file does not exist."); + return Result::Fail; + } + if (projectType == ImportProject::Type::UNKNOWN) { + mLogger.printError("failed to load project '" + projectFile + "'. The format is unknown."); + return Result::Fail; + } + if (projectType == ImportProject::Type::FAILURE) { + mLogger.printError("failed to load project '" + projectFile + "'. An error occurred."); + return Result::Fail; + } + } - // --project-configuration - else if (std::strncmp(argv[i], "--project-configuration=", 24) == 0) { - mVSConfig = argv[i] + 24; - if (!mVSConfig.empty() && (project.projectType == ImportProject::Type::VS_SLN || project.projectType == ImportProject::Type::VS_VCXPROJ)) - project.ignoreOtherConfigs(mVSConfig); - } - - // Only print something when there are errors - else if (std::strcmp(argv[i], "-q") == 0 || std::strcmp(argv[i], "--quiet") == 0) - mSettings.quiet = true; - - // Output relative paths - else if (std::strcmp(argv[i], "-rp") == 0 || std::strcmp(argv[i], "--relative-paths") == 0) - mSettings.relativePaths = true; - else if (std::strncmp(argv[i], "-rp=", 4) == 0 || std::strncmp(argv[i], "--relative-paths=", 17) == 0) { - mSettings.relativePaths = true; - if (argv[i][argv[i][3]=='='?4:17] != 0) { - std::string paths = argv[i]+(argv[i][3]=='='?4:17); - for (;;) { - const std::string::size_type pos = paths.find(';'); - if (pos == std::string::npos) { - mSettings.basePaths.emplace_back(Path::fromNativeSeparators(paths)); - break; - } - mSettings.basePaths.emplace_back(Path::fromNativeSeparators(paths.substr(0, pos))); - paths.erase(0, pos + 1); + // --project-configuration + else if (std::strncmp(argv[i], "--project-configuration=", 24) == 0) { + vsConfig = argv[i] + 24; + if (vsConfig.empty()) { + mLogger.printError("--project-configuration parameter is empty."); + return Result::Fail; + } + if (projectType != ImportProject::Type::VS_SLN && projectType != ImportProject::Type::VS_VCXPROJ) { + mLogger.printError("--project-configuration has no effect - no Visual Studio project provided."); + return Result::Fail; + } + } + + // Only print something when there are errors + else if (std::strcmp(argv[i], "-q") == 0 || std::strcmp(argv[i], "--quiet") == 0) + mSettings.quiet = true; + + // Output relative paths + else if (std::strcmp(argv[i], "-rp") == 0 || std::strcmp(argv[i], "--relative-paths") == 0) + mSettings.relativePaths = true; + else if (std::strncmp(argv[i], "-rp=", 4) == 0 || std::strncmp(argv[i], "--relative-paths=", 17) == 0) { + mSettings.relativePaths = true; + if (argv[i][argv[i][3]=='='?4:17] != 0) { + std::string paths = argv[i]+(argv[i][3]=='='?4:17); + for (;;) { + const std::string::size_type pos = paths.find(';'); + if (pos == std::string::npos) { + mSettings.basePaths.emplace_back(Path::fromNativeSeparators(std::move(paths))); + break; } - } else { - mLogger.printError("no paths specified for the '" + std::string(argv[i]) + "' option."); - return Result::Fail; + mSettings.basePaths.emplace_back(Path::fromNativeSeparators(paths.substr(0, pos))); + paths.erase(0, pos + 1); } + } else { + mLogger.printError("no paths specified for the '" + std::string(argv[i]) + "' option."); + return Result::Fail; } + } - // Report progress - else if (std::strcmp(argv[i], "--report-progress") == 0) { - mSettings.reportProgress = 10; - } + // Report progress + else if (std::strcmp(argv[i], "--report-progress") == 0) { + mSettings.reportProgress = 10; + } - else if (std::strncmp(argv[i], "--report-progress=", 18) == 0) { - int tmp; - if (!parseNumberArg(argv[i], 18, tmp, true)) - return Result::Fail; - mSettings.reportProgress = tmp; + else if (std::strncmp(argv[i], "--report-progress=", 18) == 0) { + if (!parseNumberArg(argv[i], 18, mSettings.reportProgress, true)) + return Result::Fail; + } + + else if (std::strncmp(argv[i], "--report-type=", 14) == 0) { + const std::string typeStr = argv[i] + 14; + if (typeStr == "normal") { + mSettings.reportType = ReportType::normal; + } else if (typeStr == "autosar") { + mSettings.reportType = ReportType::autosar; + } else if (typeStr == "cert-c-2016") { + mSettings.reportType = ReportType::certC; + } else if (typeStr == "cert-cpp-2016") { + mSettings.reportType = ReportType::certCpp; + } else if (typeStr == "misra-c-2012") { + mSettings.reportType = ReportType::misraC2012; + } else if (typeStr == "misra-c-2023") { + mSettings.reportType = ReportType::misraC2023; + } else if (typeStr == "misra-c-2025") { + mSettings.reportType = ReportType::misraC2025; + } else if (typeStr == "misra-cpp-2008") { + mSettings.reportType = ReportType::misraCpp2008; + } else if (typeStr == "misra-cpp-2023") { + mSettings.reportType = ReportType::misraCpp2023; + } else { + mLogger.printError("Unknown report type \'" + typeStr + "\'"); + return Result::Fail; } + } - // Rule given at command line - else if (std::strncmp(argv[i], "--rule=", 7) == 0) { + // Rule given at command line + else if (std::strncmp(argv[i], "--rule=", 7) == 0) { #ifdef HAVE_RULES - Settings::Rule rule; - rule.pattern = 7 + argv[i]; + Settings::Rule rule; + rule.pattern = 7 + argv[i]; - if (rule.pattern.empty()) { - mLogger.printError("no rule pattern provided."); - return Result::Fail; - } + if (rule.pattern.empty()) { + mLogger.printError("no rule pattern provided."); + return Result::Fail; + } - mSettings.rules.emplace_back(std::move(rule)); + mSettings.rules.emplace_back(std::move(rule)); #else - mLogger.printError("Option --rule cannot be used as Cppcheck has not been built with rules support."); - return Result::Fail; + mLogger.printError("Option --rule cannot be used as Cppcheck has not been built with rules support."); + return Result::Fail; #endif - } + } - // Rule file - else if (std::strncmp(argv[i], "--rule-file=", 12) == 0) { + // Rule file + else if (std::strncmp(argv[i], "--rule-file=", 12) == 0) { #ifdef HAVE_RULES - // TODO: improved error handling - wrong root node, etc. - // TODO: consume unused "version" attribute - const std::string ruleFile = argv[i] + 12; - tinyxml2::XMLDocument doc; - const tinyxml2::XMLError err = doc.LoadFile(ruleFile.c_str()); - if (err == tinyxml2::XML_SUCCESS) { - const tinyxml2::XMLElement *node = doc.FirstChildElement(); - // check if it is a single or multi rule configuration - if (node && strcmp(node->Value(), "rules") == 0) - node = node->FirstChildElement("rule"); - for (; node && strcmp(node->Value(), "rule") == 0; node = node->NextSiblingElement()) { - Settings::Rule rule; - - for (const tinyxml2::XMLElement *subnode = node->FirstChildElement(); subnode; subnode = subnode->NextSiblingElement()) { - const char * const subtext = subnode->GetText(); - if (std::strcmp(subnode->Name(), "tokenlist") == 0) { - rule.tokenlist = empty_if_null(subtext); - } - else if (std::strcmp(subnode->Name(), "pattern") == 0) { - rule.pattern = empty_if_null(subtext); - } - else if (std::strcmp(subnode->Name(), "message") == 0) { - for (const tinyxml2::XMLElement *msgnode = subnode->FirstChildElement(); msgnode; msgnode = msgnode->NextSiblingElement()) { - const char * const msgtext = msgnode->GetText(); - if (std::strcmp(msgnode->Name(), "severity") == 0) { - rule.severity = severityFromString(empty_if_null(msgtext)); - } - else if (std::strcmp(msgnode->Name(), "id") == 0) { - rule.id = empty_if_null(msgtext); - } - else if (std::strcmp(msgnode->Name(), "summary") == 0) { - rule.summary = empty_if_null(msgtext); - } - else { - mLogger.printError("unable to load rule-file '" + ruleFile + "' - unknown element '" + msgnode->Name() + "' encountered in 'message'."); - return Result::Fail; - } + // TODO: improved error handling - wrong root node, etc. + // TODO: consume unused "version" attribute + const std::string ruleFile = argv[i] + 12; + tinyxml2::XMLDocument doc; + const tinyxml2::XMLError err = doc.LoadFile(ruleFile.c_str()); + if (err == tinyxml2::XML_SUCCESS) { + const tinyxml2::XMLElement *node = doc.FirstChildElement(); + // check if it is a single or multi rule configuration + if (node && strcmp(node->Value(), "rules") == 0) + node = node->FirstChildElement("rule"); + for (; node && strcmp(node->Value(), "rule") == 0; node = node->NextSiblingElement()) { + Settings::Rule rule; + + for (const tinyxml2::XMLElement *subnode = node->FirstChildElement(); subnode; subnode = subnode->NextSiblingElement()) { + const char * const subname = subnode->Name(); + const char * const subtext = subnode->GetText(); + if (std::strcmp(subname, "tokenlist") == 0) { + rule.tokenlist = empty_if_null(subtext); + } + else if (std::strcmp(subname, "pattern") == 0) { + rule.pattern = empty_if_null(subtext); + } + else if (std::strcmp(subname, "message") == 0) { + for (const tinyxml2::XMLElement *msgnode = subnode->FirstChildElement(); msgnode; msgnode = msgnode->NextSiblingElement()) { + const char * const msgname = msgnode->Name(); + const char * const msgtext = msgnode->GetText(); + if (std::strcmp(msgname, "severity") == 0) { + rule.severity = severityFromString(empty_if_null(msgtext)); + } + else if (std::strcmp(msgname, "id") == 0) { + rule.id = empty_if_null(msgtext); + } + else if (std::strcmp(msgname, "summary") == 0) { + rule.summary = empty_if_null(msgtext); + } + else { + mLogger.printError("unable to load rule-file '" + ruleFile + "' - unknown element '" + msgname + "' encountered in 'message'."); + return Result::Fail; } - } - else { - mLogger.printError("unable to load rule-file '" + ruleFile + "' - unknown element '" + subnode->Name() + "' encountered in 'rule'."); - return Result::Fail; } } - - if (rule.pattern.empty()) { - mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule is lacking a pattern."); + else { + mLogger.printError("unable to load rule-file '" + ruleFile + "' - unknown element '" + subname + "' encountered in 'rule'."); return Result::Fail; } + } - if (rule.id.empty()) { - mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule is lacking an id."); - return Result::Fail; - } + if (rule.pattern.empty()) { + mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule is lacking a pattern."); + return Result::Fail; + } - if (rule.tokenlist.empty()) { - mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule is lacking a tokenlist."); - return Result::Fail; - } + if (rule.id.empty()) { + mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule is lacking an id."); + return Result::Fail; + } - if (rule.tokenlist != "normal" && rule.tokenlist != "define" && rule.tokenlist != "raw") { - mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule is using the unsupported tokenlist '" + rule.tokenlist + "'."); - return Result::Fail; - } + if (rule.tokenlist.empty()) { + mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule is lacking a tokenlist."); + return Result::Fail; + } - if (rule.severity == Severity::none) { - mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule has an invalid severity."); - return Result::Fail; - } + if (rule.tokenlist != "normal" && rule.tokenlist != "define" && rule.tokenlist != "raw") { + mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule is using the unsupported tokenlist '" + rule.tokenlist + "'."); + return Result::Fail; + } - mSettings.rules.emplace_back(std::move(rule)); + if (rule.severity == Severity::none) { + mLogger.printError("unable to load rule-file '" + ruleFile + "' - a rule has an invalid severity."); + return Result::Fail; } - } else { - mLogger.printError("unable to load rule-file '" + ruleFile + "' (" + tinyxml2::XMLDocument::ErrorIDToName(err) + ")."); - return Result::Fail; + + mSettings.rules.emplace_back(std::move(rule)); } -#else - mLogger.printError("Option --rule-file cannot be used as Cppcheck has not been built with rules support."); + } else { + mLogger.printError("unable to load rule-file '" + ruleFile + "' (" + tinyxml2::XMLDocument::ErrorIDToName(err) + ")."); return Result::Fail; -#endif } +#else + mLogger.printError("Option --rule-file cannot be used as Cppcheck has not been built with rules support."); + return Result::Fail; +#endif + } - // Safety certified behavior - else if (std::strcmp(argv[i], "--safety") == 0) - mSettings.safety = true; - - // show timing information.. - else if (std::strncmp(argv[i], "--showtime=", 11) == 0) { - const std::string showtimeMode = argv[i] + 11; - if (showtimeMode == "file") - mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE; - else if (showtimeMode == "file-total") - mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL; - else if (showtimeMode == "summary") - mSettings.showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY; - else if (showtimeMode == "top5") { - mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE; - mLogger.printMessage("--showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead."); - } - else if (showtimeMode == "top5_file") - mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE; - else if (showtimeMode == "top5_summary") - mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY; - else if (showtimeMode == "none") - mSettings.showtime = SHOWTIME_MODES::SHOWTIME_NONE; - else if (showtimeMode.empty()) { - mLogger.printError("no mode provided for --showtime"); - return Result::Fail; - } - else { - mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary."); - return Result::Fail; - } + // Safety certified behavior + else if (std::strcmp(argv[i], "--safety") == 0) + mSettings.safety = true; + + // show timing information.. + else if (std::strncmp(argv[i], "--showtime=", 11) == 0) { + const std::string showtimeMode = argv[i] + 11; + if (showtimeMode == "file") + mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE; + else if (showtimeMode == "file-total") + mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL; + else if (showtimeMode == "summary") + mSettings.showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY; + else if (showtimeMode == "top5_file") + mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE; + else if (showtimeMode == "top5_summary") + mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY; + else if (showtimeMode == "none") + mSettings.showtime = SHOWTIME_MODES::SHOWTIME_NONE; + else if (showtimeMode.empty()) { + mLogger.printError("no mode provided for --showtime"); + return Result::Fail; } - - // --std - else if (std::strncmp(argv[i], "--std=", 6) == 0) { - const std::string std = argv[i] + 6; - Standards tmp; - if (tmp.setC(std)) { - mSettings.standards.c = tmp.c; - } else if (tmp.setCPP(std)) { - mSettings.standards.cpp = tmp.cpp; - } else { - mLogger.printError("unknown --std value '" + std + "'"); - return Result::Fail; - } + else { + mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5_file, top5_summary."); + return Result::Fail; } + } - else if (std::strncmp(argv[i], "--suppress=", 11) == 0) { - const std::string suppression = argv[i]+11; - const std::string errmsg(mSuppressions.nomsg.addSuppressionLine(suppression)); - if (!errmsg.empty()) { - mLogger.printError(errmsg); - return Result::Fail; - } + // --std + else if (std::strncmp(argv[i], "--std=", 6) == 0) { + const std::string std = argv[i] + 6; + if (!mSettings.standards.setStd(std)) { + mLogger.printError("unknown --std value '" + std + "'"); + return Result::Fail; } + } - // Filter errors - else if (std::strncmp(argv[i], "--suppressions-list=", 20) == 0) { - std::string filename = argv[i]+20; - std::ifstream f(filename); - if (!f.is_open()) { - std::string message("couldn't open the file: \""); - message += filename; - message += "\"."; - if (std::count(filename.cbegin(), filename.cend(), ',') > 0 || - std::count(filename.cbegin(), filename.cend(), '.') > 1) { - // If user tried to pass multiple files (we can only guess that) - // e.g. like this: --suppressions-list=a.txt,b.txt - // print more detailed error message to tell user how he can solve the problem - message += "\nIf you want to pass two files, you can do it e.g. like this:"; - message += "\n cppcheck --suppressions-list=a.txt --suppressions-list=b.txt file.cpp"; - } - - mLogger.printError(message); - return Result::Fail; - } - const std::string errmsg(mSuppressions.nomsg.parseFile(f)); - if (!errmsg.empty()) { - mLogger.printError(errmsg); - return Result::Fail; - } + else if (std::strncmp(argv[i], "--suppress=", 11) == 0) { + const std::string suppression = argv[i]+11; + const std::string errmsg(mSuppressions.nomsg.addSuppressionLine(suppression)); + if (!errmsg.empty()) { + mLogger.printError(errmsg); + return Result::Fail; } + } - else if (std::strncmp(argv[i], "--suppress-xml=", 15) == 0) { - const char * filename = argv[i] + 15; - const std::string errmsg(mSuppressions.nomsg.parseXmlFile(filename)); - if (!errmsg.empty()) { - mLogger.printError(errmsg); - return Result::Fail; + // Filter errors + else if (std::strncmp(argv[i], "--suppressions-list=", 20) == 0) { + std::string filename = argv[i]+20; + std::ifstream f(filename); + if (!f.is_open()) { + std::string message("couldn't open the file: \""); + message += filename; + message += "\"."; + if (std::count(filename.cbegin(), filename.cend(), ',') > 0 || + std::count(filename.cbegin(), filename.cend(), '.') > 1) { + // If user tried to pass multiple files (we can only guess that) + // e.g. like this: --suppressions-list=a.txt,b.txt + // print more detailed error message to tell user how he can solve the problem + message += "\nIf you want to pass two files, you can do it e.g. like this:"; + message += "\n cppcheck --suppressions-list=a.txt --suppressions-list=b.txt file.cpp"; } - } - // Output formatter - else if (std::strncmp(argv[i], "--template=", 11) == 0) { - mSettings.templateFormat = argv[i] + 11; - // TODO: bail out when no template is provided? - - if (mSettings.templateFormat == "gcc") { - mSettings.templateFormat = "{bold}{file}:{line}:{column}: {magenta}warning:{default} {message} [{id}]{reset}\\n{code}"; - mSettings.templateLocation = "{bold}{file}:{line}:{column}: {dim}note:{reset} {info}\\n{code}"; - } else if (mSettings.templateFormat == "daca2") { - mSettings.daca = true; - mSettings.templateFormat = "{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]"; - mSettings.templateLocation = "{file}:{line}:{column}: note: {info}"; - } else if (mSettings.templateFormat == "vs") - mSettings.templateFormat = "{file}({line}): {severity}: {message}"; - else if (mSettings.templateFormat == "edit") - mSettings.templateFormat = "{file} +{line}: {severity}: {message}"; - else if (mSettings.templateFormat == "cppcheck1") - mSettings.templateFormat = "{callstack}: ({severity}{inconclusive:, inconclusive}) {message}"; - else if (mSettings.templateFormat == "selfcheck") { - mSettings.templateFormat = "{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}"; - mSettings.templateLocation = "{file}:{line}:{column}: note: {info}\\n{code}"; - mSettings.daca = true; - } else if (mSettings.templateFormat == "simple") { - mSettings.templateFormat = "{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]"; - mSettings.templateLocation = ""; - } - // TODO: bail out when no placeholders are found? + mLogger.printError(message); + return Result::Fail; } - - else if (std::strncmp(argv[i], "--template-location=", 20) == 0) { - mSettings.templateLocation = argv[i] + 20; - // TODO: bail out when no template is provided? - // TODO: bail out when no placeholders are found? + const std::string errmsg(mSuppressions.nomsg.parseFile(f)); + if (!errmsg.empty()) { + mLogger.printError(errmsg); + return Result::Fail; } + } - else if (std::strncmp(argv[i], "--template-max-time=", 20) == 0) { - if (!parseNumberArg(argv[i], 20, mSettings.templateMaxTime)) - return Result::Fail; + else if (std::strncmp(argv[i], "--suppress-xml=", 15) == 0) { + const char * filename = argv[i] + 15; + const std::string errmsg(mSuppressions.nomsg.parseXmlFile(filename)); + if (!errmsg.empty()) { + mLogger.printError(errmsg); + return Result::Fail; } + } - else if (std::strncmp(argv[i], "--typedef-max-time=", 19) == 0) { - if (!parseNumberArg(argv[i], 19, mSettings.typedefMaxTime)) - return Result::Fail; - } + // Output formatter + else if (std::strncmp(argv[i], "--template=", 11) == 0) { + mSettings.templateFormat = argv[i] + 11; + // TODO: bail out when no template is provided? + + if (mSettings.templateFormat == "gcc") { + mSettings.templateFormat = "{bold}{file}:{line}:{column}: {magenta}warning:{default} {message} [{id}]{reset}\\n{code}"; + mSettings.templateLocation = "{bold}{file}:{line}:{column}: {dim}note:{reset} {info}\\n{code}"; + } else if (mSettings.templateFormat == "daca2") { + mSettings.daca = true; + mSettings.templateFormat = "{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]"; + mSettings.templateLocation = "{file}:{line}:{column}: note: {info}"; + } else if (mSettings.templateFormat == "vs") + mSettings.templateFormat = "{file}({line}): {severity}: {message}"; + else if (mSettings.templateFormat == "edit") + mSettings.templateFormat = "{file} +{line}: {severity}: {message}"; + else if (mSettings.templateFormat == "cppcheck1") + mSettings.templateFormat = "{callstack}: ({severity}{inconclusive:, inconclusive}) {message}"; + else if (mSettings.templateFormat == "selfcheck") { + mSettings.templateFormat = "{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}"; + mSettings.templateLocation = "{file}:{line}:{column}: note: {info}\\n{code}"; + mSettings.daca = true; + } else if (mSettings.templateFormat == "simple") { + mSettings.templateFormat = "{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]"; + mSettings.templateLocation = ""; + } + // TODO: bail out when no placeholders are found? + } - else if (std::strncmp(argv[i], "--valueflow-max-iterations=", 27) == 0) { - if (!parseNumberArg(argv[i], 27, mSettings.vfOptions.maxIterations)) - return Result::Fail; - } + else if (std::strncmp(argv[i], "--template-location=", 20) == 0) { + mSettings.templateLocation = argv[i] + 20; + // TODO: bail out when no template is provided? + // TODO: bail out when no placeholders are found? + } - else if (std::strcmp(argv[i], "-v") == 0 || std::strcmp(argv[i], "--verbose") == 0) - mSettings.verbose = true; + else if (std::strncmp(argv[i], "--template-max-time=", 20) == 0) { + if (!parseNumberArg(argv[i], 20, mSettings.templateMaxTime)) + return Result::Fail; + } - // Write results in results.xml - else if (std::strcmp(argv[i], "--xml") == 0) - mSettings.xml = true; + else if (std::strncmp(argv[i], "--typedef-max-time=", 19) == 0) { + if (!parseNumberArg(argv[i], 19, mSettings.typedefMaxTime)) + return Result::Fail; + } - // Define the XML file version (and enable XML output) - else if (std::strncmp(argv[i], "--xml-version=", 14) == 0) { - int tmp; - if (!parseNumberArg(argv[i], 14, tmp)) - return Result::Fail; - if (tmp != 2) { - // We only have xml version 2 - mLogger.printError("'--xml-version' can only be 2."); - return Result::Fail; - } + else if (std::strncmp(argv[i], "--valueflow-max-iterations=", 27) == 0) { + if (!parseNumberArg(argv[i], 27, mSettings.vfOptions.maxIterations)) + return Result::Fail; + } + + else if (std::strcmp(argv[i], "-v") == 0 || std::strcmp(argv[i], "--verbose") == 0) + mSettings.verbose = true; - mSettings.xml_version = tmp; - // Enable also XML if version is set - mSettings.xml = true; + // Write results in results.xml + else if (std::strcmp(argv[i], "--xml") == 0) { + if (outputFormatOptionProvided) { + outputFormatOptionMixingError(); + return Result::Fail; } + mSettings.outputFormat = Settings::OutputFormat::xml; + xmlOptionProvided = true; + } - else { - std::string message("unrecognized command line option: \""); - message += argv[i]; - message += "\"."; - mLogger.printError(message); + // Define the XML file version (and enable XML output) + else if (std::strncmp(argv[i], "--xml-version=", 14) == 0) { + if (outputFormatOptionProvided) { + outputFormatOptionMixingError(); return Result::Fail; } + int tmp; + if (!parseNumberArg(argv[i], 14, tmp)) + return Result::Fail; + if (tmp != 2 && tmp != 3) { + // We only have xml version 2 and 3 + mLogger.printError("'--xml-version' can only be 2 or 3."); + return Result::Fail; + } + + mSettings.xml_version = tmp; + // Enable also XML if version is set + mSettings.outputFormat = Settings::OutputFormat::xml; + xmlOptionProvided = true; } else { - mPathNames.emplace_back(Path::fromNativeSeparators(Path::removeQuotationMarks(argv[i]))); + std::string message("unrecognized command line option: \""); + message += argv[i]; + message += "\"."; + mLogger.printError(message); + return Result::Fail; } } - if (logMissingInclude == 1) - mLogger.printMessage("'--enable=information' will no longer implicitly enable 'missingInclude' starting with 2.16. Please enable it explicitly if you require it."); - if (!loadCppcheckCfg()) return Result::Fail; @@ -1429,10 +1560,18 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a if (mSettings.force) mSettings.maxConfigs = INT_MAX; - else if ((def || mSettings.preprocessOnly) && !maxconfigs) mSettings.maxConfigs = 1U; + if (debug) { + mSettings.debugnormal = true; + mSettings.debugvalueflow = true; + if (mSettings.verbose) { + mSettings.debugast = true; + mSettings.debugsymdb = true; + } + } + if (mSettings.jobs > 1 && mSettings.buildDir.empty()) { // TODO: bail out instead? if (mSettings.checks.isEnabled(Checks::unusedFunction)) @@ -1441,11 +1580,58 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a //mLogger.printMessage("whole program analysis requires --cppcheck-build-dir to be active with -j."); } - if (!mPathNames.empty() && project.projectType != ImportProject::Type::NONE) { + if (!mPathNames.empty() && projectType != ImportProject::Type::NONE) { mLogger.printError("--project cannot be used in conjunction with source files."); return Result::Fail; } + // TODO: conflicts with analyzeAllVsConfigs + if (!vsConfig.empty()) { + // TODO: bail out when this does nothing + project.ignoreOtherConfigs(vsConfig); + } + + if (!platform.empty()) + { + std::string errstr; + if (!mSettings.platform.set(platform, errstr, lookupPaths, mSettings.debuglookup || mSettings.debuglookupPlatform)) { + mLogger.printError(errstr); + return Result::Fail; + } + + // TODO: remove + // these are loaded via external files and thus have Settings::PlatformFile set instead. + // override the type so they behave like the regular platforms. + if (platform == "unix32-unsigned") { + mSettings.platform.type = Platform::Type::Unix32; + mLogger.printMessage("The platform 'unix32-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix32 --funsigned-char' instead"); + } + else if (platform == "unix64-unsigned") { + mSettings.platform.type = Platform::Type::Unix64; + mLogger.printMessage("The platform 'unix64-unsigned' has been deprecated and will be removed in Cppcheck 2.19. Please use '--platform=unix64 --funsigned-char' instead"); + } + } + + if (defaultSign != '\0') + mSettings.platform.defaultSign = defaultSign; + + if (!mSettings.analyzeAllVsConfigs) { + if (projectType != ImportProject::Type::VS_SLN && projectType != ImportProject::Type::VS_VCXPROJ) { + if (mAnalyzeAllVsConfigsSetOnCmdLine) { + mLogger.printError("--no-analyze-all-vs-configs has no effect - no Visual Studio project provided."); + return Result::Fail; + } + } else { + // TODO: bail out when this does nothing + project.selectOneVsConfig(mSettings.platform.type); + } + } + + if (!mSettings.buildDir.empty() && !Path::isDirectory(mSettings.buildDir)) { + mLogger.printError("Directory '" + mSettings.buildDir + "' specified by --cppcheck-build-dir argument has to be existent."); + return Result::Fail; + } + // Print error only if we have "real" command and expect files if (mPathNames.empty() && project.guiProject.pathNames.empty() && project.fileSettings.empty()) { // TODO: this message differs from the one reported in fillSettingsFromArgs() @@ -1453,11 +1639,17 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a return Result::Fail; } + for (auto& path : mIgnoredPaths) + { + path = Path::removeQuotationMarks(std::move(path)); + path = Path::fromNativeSeparators(std::move(path)); + } + if (!project.guiProject.pathNames.empty()) mPathNames = project.guiProject.pathNames; if (!project.fileSettings.empty()) { - project.ignorePaths(mIgnoredPaths); + project.ignorePaths(mIgnoredPaths, mSettings.debugignore); if (project.fileSettings.empty()) { mLogger.printError("no C or C++ source files found."); mLogger.printMessage("all paths were ignored"); // TODO: log this differently? @@ -1466,6 +1658,12 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a mFileSettings = project.fileSettings; } + if (mSettings.debugnormal && mSettings.outputFormat == Settings::OutputFormat::xml && (mPathNames.size() > 1 || mFileSettings.size() > 1)) + { + mLogger.printError("printing debug output in XML format does not support multiple input files."); + return Result::Fail; + } + // Use paths _pathnames if no base paths for relative path output are given if (mSettings.basePaths.empty() && mSettings.relativePaths) mSettings.basePaths = mPathNames; @@ -1506,8 +1704,9 @@ void CmdLineParser::printHelp() const " --check-config Check cppcheck configuration. The normal code\n" " analysis is disabled by this flag.\n" " --check-level=\n" - " Configure how much checking you want:\n" - " * normal: Cppcheck uses some compromises in the checking so\n" + " Configure how much valueflow analysis you want:\n" + " * reduced: Reduce valueflow to finish checking quickly.\n" + " * normal: Cppcheck uses some compromises in the analysis so\n" " the checking will finish in reasonable time.\n" " * exhaustive: deeper analysis that you choose when you can\n" " wait.\n" @@ -1601,10 +1800,9 @@ void CmdLineParser::printHelp() const " this is not needed.\n" " --include=\n" " Force inclusion of a file before the checked file.\n" - " -i Give a source file or source file directory to exclude\n" - " from the check. This applies only to source files so\n" - " header files included by source files are not matched.\n" - " Directory name is matched to all parts of the path.\n" + " -i Exclude source files or directories matching str from\n" + " the check. This applies only to source files so header\n" + " files included by source files are not matched.\n" " --inconclusive Allow that Cppcheck reports even though the analysis is\n" " inconclusive.\n" " There are false positives with this option. Each result\n" @@ -1636,6 +1834,13 @@ void CmdLineParser::printHelp() const " is 2. A larger value will mean more errors can be found\n" " but also means the analysis will be slower.\n" " --output-file= Write results to file, rather than standard error.\n" + " --output-format=\n" + " Specify the output format. The available formats are:\n" + " * text\n" + " * sarif\n" + " * xml (deprecated)\n" + " * xmlv2\n" + " * xmlv3\n" " --platform=, --platform=\n" " Specifies platform specific types and sizes. The\n" " available builtin platforms are:\n" @@ -1676,10 +1881,11 @@ void CmdLineParser::printHelp() const " --premium=