Compare commits

..

2 Commits

Author SHA1 Message Date
amai2012 df05c92bbb
Adjust test to avoid new warning 2022-03-25 16:21:28 +01:00
amai2012 a7194410cf
use-retval for localtime() 2022-03-24 20:18:15 +01:00
773 changed files with 149113 additions and 99816 deletions

View File

@ -1,78 +1,6 @@
---
Checks: >
*,
-abseil-*,
-altera-*,
-android-*,
-boost-*,
-cert-*,
-cppcoreguidelines-*,
-darwin-*,
-fuchsia-*,
-google-*,
-hicpp-*,
-linuxkernel-*,
-llvm-*,
-llvmlibc-*,
-mpi-*,
-objc-*,
-openmp-*,
-zircon-*,
cert-err34-c,
google-explicit-constructor,
cppcoreguidelines-rvalue-reference-param-not-moved,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-empty-catch,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-bugprone-switch-missing-default-case,
-bugprone-unchecked-optional-access,
-clang-analyzer-*,
-concurrency-mt-unsafe,
-misc-const-correctness,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-throw-by-value-catch-by-reference,
-misc-use-anonymous-namespace,
-modernize-avoid-c-arrays,
-modernize-deprecated-ios-base-aliases,
-modernize-use-nullptr,
-misc-include-cleaner,
-misc-unused-using-decls,
-modernize-loop-convert,
-modernize-macro-to-enum,
-modernize-raw-string-literal,
-modernize-replace-auto-ptr,
-modernize-return-braced-init-list,
-modernize-type-traits,
-modernize-use-auto,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-performance-avoid-endl,
-performance-inefficient-string-concatenation,
-performance-no-automatic-move,
-performance-noexcept-swap,
-portability-simd-intrinsics,
-portability-std-allocator-const,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-container-data-pointer,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-identifier-naming,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-suspicious-call-argument,
-readability-uppercase-literal-suffix
Checks: '*,-abseil-*,-altera-*,-android-*,-cert-*,-cppcoreguidelines-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-named-parameter,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-modernize-use-override,-modernize-pass-by-value,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-misc-unused-using-decls,-modernize-use-emplace,-readability-const-return-type,-performance-unnecessary-value-param,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-readability-non-const-parameter,-misc-non-private-member-variables-in-classes,-bugprone-suspicious-string-compare,-readability-misleading-indentation,-clang-analyzer-*,-bugprone-signed-char-misuse,-readability-make-member-function-const,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-bugprone-suspicious-include,-modernize-replace-random-shuffle,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-modernize-use-equals-delete,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument'
WarningsAsErrors: '*'
HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h'
CheckOptions:
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: readability-simplify-boolean-expr.SimplifyDeMorgan
value: '0'
value: '1'

View File

@ -4,5 +4,7 @@ exclude_paths:
- htmlreport/example.cc
- samples/**/bad.c
- samples/**/bad.cpp
- test/test.cxx
- test/cfg/*.c
- test/cfg/*.cpp
- test/synthetic/*.c

19
.gitattributes vendored
View File

@ -1,19 +0,0 @@
## standard default enconding
* text=auto
## UNIX specific files
*.sh text eol=lf
## Windows specific files
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf
*.sln text eol=crlf
*.wixproj text eol=crlf
*.wxi text eol=crlf
*.wxs text eol=crlf
## Binary resources
*.pdf binary

View File

@ -4,17 +4,7 @@
name: CI-cygwin
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push,pull_request]
defaults:
run:
@ -24,35 +14,36 @@ jobs:
build_cygwin:
strategy:
matrix:
os: [windows-2022]
arch: [x64]
include:
- platform: 'x86_64'
packages: |
gcc-g++
python3
os: [windows-2019]
arch: [x64, x86]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Set up Cygwin
uses: cygwin/cygwin-install-action@master
uses: egor-tensin/setup-cygwin@v3
with:
platform: ${{ matrix.arch }}
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
- name: Build cppcheck
run: |
C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j2 check
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2
- name: Build test
run: |
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2 testrunner
- name: Run test
run: |
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2 check
- name: Extra test for misra
run: |
cd %GITHUB_WORKSPACE%\addons\test
..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64
python3 ..\misra.py -verify misra\misra-test.c.dump
..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE%\addons\test
..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 && python3 ..\misra.py -verify misra\misra-test.c.dump
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE%
.\cppcheck --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c

View File

@ -4,70 +4,38 @@
name: CI-mingw
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push,pull_request]
defaults:
run:
shell: msys2 {0}
shell: cmd
jobs:
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]
arch: [x64] # TODO: fix x86 build?
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
with:
release: false # use pre-installed
install: >-
mingw-w64-x86_64-lld
mingw-w64-x86_64-ccache
platform: ${{ matrix.arch }}
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
# TODO: bail out on warning
- name: Build cppcheck
run: |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 cppcheck
env:
LDFLAGS: -fuse-ld=lld # use lld for faster linking
mingw32-make -j2
- name: Build test
run: |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 testrunner
env:
LDFLAGS: -fuse-ld=lld # use lld for faster linking
mingw32-make -j2 testrunner
- name: Run test
run: |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 check
env:
LDFLAGS: -fuse-ld=lld # use lld for faster linking
mingw32-make -j2 check

View File

@ -2,166 +2,73 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: CI-unixish-docker
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build_cmake:
build:
strategy:
matrix:
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
include:
- build_gui: false
- image: "ubuntu:23.10"
build_gui: true
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:21.10"]
fail-fast: false # Prefer quick result
runs-on: ubuntu-22.04
# TODO: is this actually applied to the guest?
env:
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros
runs-on: ubuntu-20.04
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Install missing software on CentOS 7
if: matrix.image == 'centos:7'
run: |
yum install -y cmake gcc-c++ make pcre-devel
yum --enablerepo=extras install -y epel-release
yum install -y ccache
yum install -y cmake gcc-c++ make
yum install -y pcre-devel
- name: Install missing software on ubuntu
if: contains(matrix.image, 'ubuntu')
if: matrix.image != 'centos:7'
run: |
apt-get update
apt-get install -y cmake g++ make libxml2-utils libpcre3-dev
apt-get install -y cmake g++ make python libxml2-utils
apt-get install -y libpcre3-dev
- name: Install missing software (gui) on latest ubuntu
if: matrix.build_gui
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"
# - it doesn't support centos
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
with:
key: ${{ github.workflow }}-${{ matrix.image }}
# tests require CMake 3.9 - no ccache available
- name: CMake build (no tests / no ccache)
if: matrix.image == 'ubuntu:14.04'
# tests require CMake 3.4
- name: Test CMake build (no tests)
if: matrix.image != 'ubuntu:21.10'
run: |
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DHAVE_RULES=On ..
cmake --build . -- -j$(nproc)
cd ..
# tests require CMake 3.9 - ccache available
- name: CMake build (no tests)
if: matrix.image == 'centos:7' || matrix.image == 'ubuntu:16.04'
- name: Test CMake build
if: matrix.image == 'ubuntu:21.10'
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 != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04' }}
run: |
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
cmake --build . -- -j$(nproc)
- 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 --build cmake.output -- -j$(nproc)
- name: Run CMake test
if: matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04'
run: |
cmake --build cmake.output --target check -- -j$(nproc)
build_make:
strategy:
matrix:
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
fail-fast: false # Prefer quick result
runs-on: ubuntu-22.04
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v3
- name: Install missing software on CentOS 7
if: matrix.image == 'centos:7'
run: |
yum install -y gcc-c++ make which python3 pcre-devel
yum --enablerepo=extras install -y epel-release
yum install -y ccache
- name: Install missing software on ubuntu
if: contains(matrix.image, 'ubuntu')
run: |
apt-get update
apt-get install -y g++ make python3 libxml2-utils libpcre3-dev
# needs to be called after the package installation since
# - it doesn't call "apt-get update"
# - it doesn't support centos
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
with:
key: ${{ github.workflow }}-${{ matrix.image }}
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On ..
cmake --build . --target check -- -j$(nproc)
cd ..
- name: Build cppcheck
run: |
# "/usr/lib64" for centos / "/usr/lib" for ubuntu
export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w"
make clean
make -j$(nproc) HAVE_RULES=yes
- name: Build test
run: |
# "/usr/lib64" for centos / "/usr/lib" for ubuntu
export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w"
make -j$(nproc) testrunner HAVE_RULES=yes
- name: Run test
run: |
make -j$(nproc) check HAVE_RULES=yes
# requires python3
- name: Run extra tests
run: |
tools/generate_and_run_more_tests.sh
# requires which
- name: Validate
run: |
make -j$(nproc) checkCWEEntries validateXML
@ -170,10 +77,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

View File

@ -2,152 +2,75 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: CI-unixish
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build_cmake_tinyxml2:
build:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
include:
- use_qt6: On
- os: ubuntu-20.04
use_qt6: Off
os: [ubuntu-18.04, ubuntu-20.04, macos-10.15]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
env:
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros
steps:
- uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
- uses: actions/checkout@v2
- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off'
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install libxml2-utils libtinyxml2-dev qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
sudo apt-get install libxml2-utils
sudo apt-get install libz3-dev libtinyxml2-dev
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev qt5-default
- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On'
- name: Fix missing z3_version.h
if: matrix.os == 'ubuntu-18.04'
run: |
sudo apt-get update
# 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
cp externals/z3_version_old.h externals/z3_version.h
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
# pcre was removed from runner images in November 2022
brew install coreutils qt@6 tinyxml2 pcre
brew install coreutils python3 z3 qt@5
- name: Install missing Python packages
run: |
python3 -m pip install pip --upgrade
python3 -m pip install pytest
- 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 --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 --build cmake.output.tinyxml2 -- -j$(nproc)
mkdir cmake.output.tinyxml2
cd cmake.output.tinyxml2
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off ..
cmake --build . -- -j$(nproc)
cd ..
- name: Run CMake test (system tinyxml2)
if: contains(matrix.os, 'ubuntu')
run: |
cmake --build cmake.output.tinyxml2 --target check -- -j$(nproc)
build_cmake:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
include:
- use_qt6: On
- os: ubuntu-20.04
use_qt6: Off
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@v3
- 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
uses: egor-tensin/setup-gcc@v1
if: matrix.os == 'ubuntu-22.04'
with:
version: 13
platform: x64
- name: Select compiler
if: matrix.os == 'ubuntu-22.04'
run: |
echo "CXX=g++-13" >> $GITHUB_ENV
- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On'
run: |
sudo apt-get update
# 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
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
# pcre was removed from runner images in November 2022
brew install coreutils qt@6 pcre
- name: CMake build 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)
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On ..
cmake --build . -- -j$(nproc)
cd ..
- name: CMake build 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 --build cmake.output -- -j$(nproc)
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 ..
cmake --build . -- -j$(nproc)
cd ..
- name: Run CMake test
run: |
@ -155,259 +78,59 @@ jobs:
- name: Run CTest
run: |
pushd cmake.output
ctest --output-on-failure -j$(nproc)
cd cmake.output
ctest -j$(nproc)
cd ..
build_uchar:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
- name: Build and test with Unsigned char
run: |
brew install coreutils
- name: Build with Unsigned char
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make clean
make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
- name: Test with Unsigned char
run: |
./testrunner TestSymbolDatabase
build_mathlib:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils
- name: Build with TEST_MATHLIB_VALUE
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all
- name: Test with TEST_MATHLIB_VALUE
run: |
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE check
check_nonneg:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
# coreutils contains "g++" (default is "c++") and "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils
- name: Check syntax with NONNEG
run: |
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:
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]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils qt@5
# expose qmake
brew link qt@5 --force
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
- name: Build GUI
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)
# TODO: binaries are in a different location on macos
- name: Build and Run GUI tests
if: contains(matrix.os, 'ubuntu')
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/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)
build:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install libxml2-utils
# packages for strict cfg checks
- name: Install missing software on ubuntu 22.04 (cfg)
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get install libcairo2-dev libcurl4-openssl-dev liblua5.3-dev libssl-dev libsqlite3-dev libcppunit-dev libsigc++-2.0-dev libgtk-3-dev libboost-all-dev libwxgtk3.0-gtk3-dev xmlstarlet qtbase5-dev
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
# pcre was removed from runner images in November 2022
brew install coreutils python3 pcre gnu-sed
- name: Install missing Python packages
run: |
python3 -m pip install pip --upgrade
python3 -m pip install pytest
python3 -m pip install pytest-timeout
- name: Build cppcheck
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) HAVE_RULES=yes
make clean
make -j$(nproc) USE_Z3=yes HAVE_RULES=yes
- name: Build test
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) testrunner HAVE_RULES=yes
make -j$(nproc) testrunner USE_Z3=yes HAVE_RULES=yes
- name: Run test
run: |
make -j$(nproc) check HAVE_RULES=yes
make -j$(nproc) check USE_Z3=yes HAVE_RULES=yes
# requires "gnu-sed" installed on macos
# the script uses sed parameters not supported by MacOS
- name: Run extra tests
if: contains(matrix.os, 'ubuntu')
run: |
tools/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 test-*.py
python3 -m pytest test-*.py
cd ../../..
ln -s cppcheck 'cpp check'
cd 'cpp check/test/cli'
python3 -m pytest -Werror --strict-markers -vv test-*.py
python3 -m pytest test-*.py
# fails on macos since some includes (e.g. sys/epoll.h) are not available
- name: Run cfg tests
if: matrix.os != 'ubuntu-22.04'
if: contains(matrix.os, 'ubuntu')
run: |
make -j$(nproc) checkcfg
- name: Run cfg tests (strict)
if: matrix.os == 'ubuntu-22.04'
# it seems macos has no "wc" command
- name: Run showtimetop5 tests
if: contains(matrix.os, 'ubuntu')
run: |
make -j$(nproc) checkcfg
env:
STRICT: 1
./tools/test_showtimetop5.sh
- name: Run --dump test
run: |
@ -418,101 +141,96 @@ jobs:
run: |
make -j$(nproc) checkCWEEntries validateXML
# TODO: move to scriptcheck.yml so these are tested with all Python versions?
- name: Test addons
run: |
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety addons/test/threadsafety
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety --std=c++03 addons/test/threadsafety
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra addons/test/misra/crash*.c
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra --enable=information addons/test/misra/config*.c
./cppcheck --addon=threadsafety addons/test/threadsafety
./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
./cppcheck --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
cd addons/test
../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64 && python3 ../misra.py -verify misra/misra-test.c.dump
../../cppcheck --addon=misra --platform=avr8 --error-exitcode=1 misra/misra-test-avr8.c
./cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
pushd addons/test
# We'll force C89 standard to enable an additional verification for
# rules 5.4 and 5.5 which have standard-dependent options.
../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64
python3 ../misra.py -verify misra/misra-test.c.dump
# TODO: do we need to verify something here?
../../cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.h
../../cppcheck --dump misra/misra-test.cpp
python3 ../misra.py -verify misra/misra-test.cpp.dump
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_ascii.txt -verify misra/misra-test.cpp.dump
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_utf8.txt -verify misra/misra-test.cpp.dump
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_windows1250.txt -verify misra/misra-test.cpp.dump
../../cppcheck --addon=misra --enable=style --platform=avr8 --error-exitcode=1 misra/misra-test-avr8.c
../../cppcheck --dump misc-test.cpp
python3 ../misc.py -verify misc-test.cpp.dump
../../cppcheck --dump naming_test.c
python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
../../cppcheck --dump naming_test.cpp
python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
../../cppcheck --dump namingng_test.c
python3 ../namingng.py --configfile ../naming.json --verify namingng_test.c.dump
- name: Build democlient
if: matrix.os == 'ubuntu-22.04'
- name: Build GUI on ubuntu
if: contains(matrix.os, 'ubuntu')
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
pushd gui
qmake CONFIG+=debug HAVE_QCHART=yes
make -j$(nproc)
selfcheck:
needs: build # wait for all tests to be successful first
runs-on: ubuntu-22.04 # run on the latest image only
steps:
- uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
- name: Install missing software on ubuntu
- name: Run GUI tests on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev libboost-container-dev
pushd gui/test/cppchecklibrarydata
qmake CONFIG+=debug
make -j$(nproc)
./test-cppchecklibrarydata
popd
pushd gui/test/filelist
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-filelist
popd
pushd gui/test/projectfile
qmake CONFIG+=debug
make -j$(nproc)
./test-projectfile
popd
pushd gui/test/translationhandler
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-translationhandler
popd
pushd gui/test/xmlreportv2
qmake CONFIG+=debug
make -j$(nproc)
# TODO: requires X session
#./test-xmlreportv2
- name: Generate Qt help file on ubuntu 18.04
if: matrix.os == 'ubuntu-18.04'
run: |
pushd gui/help
qcollectiongenerator online-help.qhcp -o online-help.qhc
- name: Generate Qt help file on ubuntu 20.04
if: matrix.os == 'ubuntu-20.04'
run: |
pushd gui/help
qhelpgenerator online-help.qhcp -o online-help.qhc
- name: Build triage on ubuntu
if: matrix.os == 'ubuntu-20.04'
run: |
pushd tools/triage
qmake CONFIG+=debug
make -j$(nproc)
- name: Build Fuzzer
if: matrix.os == 'ubuntu-20.04'
run: |
pushd oss-fuzz
make -j$(nproc) CXX=clang++ CXXFLAGS="-fsanitize=address" fuzz-client translate
- name: Self check (build)
if: matrix.os == 'ubuntu-20.04'
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
# compile with verification and ast matchers
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2 -w -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
# TODO: update to Qt6
- name: CMake
run: |
cmake -S . -B cmake.output -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=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
- name: Generate dependencies
run: |
# make sure auto-generated GUI files exist
make -C cmake.output autogen
make -C cmake.output gui-build-deps triage-build-ui-deps
make clean
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2" MATCHCOMPILER=yes VERIFY=1
# Run self check after "Build GUI" to include generated headers in analysis
- name: Self check
if: matrix.os == 'ubuntu-20.04'
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,internal --exception-handling --debug-warnings --check-level=exhaustive"
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
ec=0
# TODO: add --check-config
# early exit
if [ $ec -eq 1 ]; then
exit $ec
fi
# self check simplecpp
./cppcheck $selfcheck_options externals/simplecpp || ec=1
# self check lib/cli
mkdir b1
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json cli lib || ec=1
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck --cppcheck-build-dir=b1 -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib --addon=naming.json -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings cli lib
# check gui with qt settings
mkdir b2
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b2 -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui || ec=1
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck --cppcheck-build-dir=b2 -D__CPPCHECK__ -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib --library=qt --addon=naming.json -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings gui/*.cpp gui/temp/*.cpp
# self check test and tools
./cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ -DQ_MOC_OUTPUT_REVISION=67 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli -Igui --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings test/*.cpp tools/*.cpp
# triage
./cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage || ec=1
exit $ec
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ -DQ_MOC_OUTPUT_REVISION=67 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib --library=qt -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Igui --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings tools/triage

View File

@ -4,79 +4,20 @@
name: CI-windows
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push,pull_request]
defaults:
run:
shell: cmd
# TODO: choose/add a step to bail out on compiler warnings (maybe even the release build)
jobs:
build_qt:
strategy:
matrix:
os: [windows-2019, windows-2022]
qt_ver: [5.15.2, 6.6.0]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install Qt ${{ matrix.qt_ver }}
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
modules: 'qtcharts'
cache: true
- name: Build GUI release (qmake)
if: startsWith(matrix.qt_ver, '5')
run: |
cd gui || exit /b !errorlevel!
qmake HAVE_QCHART=yes || exit /b !errorlevel!
nmake release || exit /b !errorlevel!
env:
CL: /MP
- name: Deploy GUI
if: startsWith(matrix.qt_ver, '5')
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!
- name: Build GUI release (CMake)
if: startsWith(matrix.qt_ver, '6')
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!
# TODO: deploy with CMake/Qt6
build:
strategy:
matrix:
os: [windows-2019, windows-2022]
config: [debug, release]
arch: [x64, x86]
qt_ver: ['', 5.15.2]
fail-fast: false
runs-on: ${{ matrix.os }}
@ -84,124 +25,171 @@ jobs:
env:
# see https://www.pcre.org/original/changelog.txt
PCRE_VERSION: 8.45
# see https://github.com/Z3Prover/z3/releases:
Z3_VERSION: 4.8.15
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
if: matrix.arch == 'x64' || matrix.qt_ver == ''
- name: Set up Python 3.12
if: matrix.config == 'release'
uses: actions/setup-python@v4
- name: Set up Python 3.10
if: matrix.qt_ver == ''
uses: actions/setup-python@v2
with:
python-version: '3.12'
check-latest: true
python-version: '3.10'
- name: Set up Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
arch: ${{ matrix.arch }}
- name: Cache PCRE
id: cache-pcre
uses: actions/cache@v3
uses: actions/cache@v2
if: matrix.arch == 'x64' || matrix.qt_ver == ''
with:
path: |
externals\pcre.h
externals\pcre.lib
externals\pcre64.lib
key: pcre-${{ env.PCRE_VERSION }}-x64-bin-win
path: pcre-${{ env.PCRE_VERSION }}.zip
key: pcre-${{ env.PCRE_VERSION }}
- name: Download PCRE
if: steps.cache-pcre.outputs.cache-hit != 'true'
if: (matrix.arch == 'x64' || matrix.qt_ver == '') && 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'
if: matrix.arch == 'x64' || matrix.qt_ver == ''
run: |
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!
nmake || exit /b !errorlevel!
copy pcre.h ..\externals || exit /b !errorlevel!
copy pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
if "${{ matrix.arch }}" == "x86" (
copy pcre.lib ..\externals\pcre.lib || exit /b !errorlevel!
) else (
copy pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
)
env:
CL: /MP
- name: Cache Z3 Library
id: cache-z3
uses: actions/cache@v2
if: matrix.arch == 'x64' || matrix.qt_ver == ''
with:
path: z3-${{ env.Z3_VERSION }}-${{ matrix.arch }}-win.zip
key: z3-${{ env.Z3_VERSION }}-${{ matrix.arch }}-win
- name: Download Z3 library
if: (matrix.arch == 'x64' || matrix.qt_ver == '') && steps.cache-z3.outputs.cache-hit != 'true'
run: |
curl -fsSL https://github.com/Z3Prover/z3/releases/download/z3-%Z3_VERSION%/z3-%Z3_VERSION%-${{ matrix.arch }}-win.zip -o z3-%Z3_VERSION%-${{ matrix.arch }}-win.zip || exit /b !errorlevel!
- name: Install Z3 library
if: matrix.arch == 'x64' || matrix.qt_ver == ''
run: |
7z x z3-%Z3_VERSION%-${{ matrix.arch }}-win.zip -oexternals -r -y || exit /b !errorlevel!
move externals\z3-%Z3_VERSION%-${{ matrix.arch }}-win externals\z3 || exit /b !errorlevel!
- name: Cache Qt ${{ matrix.qt_ver }}
if: matrix.qt_ver != '' && matrix.arch == 'x64'
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ../Qt
key: Windows-QtCache-${{ matrix.qt_ver }}-qtcharts
# no 32-bit Qt available
- name: Install Qt ${{ matrix.qt_ver }}
if: matrix.qt_ver != '' && matrix.arch == 'x64'
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt_ver }}
modules: 'qtcharts'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Install missing Python packages
if: matrix.config == 'release'
if: matrix.qt_ver == ''
run: |
python -m pip install pip --upgrade || exit /b !errorlevel!
python -m pip install pytest || exit /b !errorlevel!
python -m pip install pytest-custom_exit_code || exit /b !errorlevel!
python -m pip install pytest-timeout || exit /b !errorlevel!
- name: Build GUI release
if: matrix.qt_ver != '' && matrix.arch == 'x64'
run: |
cd gui || exit /b !errorlevel!
qmake HAVE_QCHART=yes || exit /b !errorlevel!
nmake release || exit /b !errorlevel!
env:
CL: /MP
- name: Deploy GUI
if: matrix.qt_ver != '' && matrix.arch == 'x64'
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!
- name: Run CMake
if: false # TODO: enable
if: false && matrix.qt_ver == ''
run: |
cmake -S . -B build -DBUILD_TESTS=On || exit /b !errorlevel!
set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" (
set ARCH=Win32
)
rm -rf build
mkdir build
cd build
cmake -DBUILD_TESTS=On .. || exit /b !errorlevel!
- name: Build CLI debug configuration using MSBuild
if: matrix.config == 'debug'
if: matrix.qt_ver == ''
run: |
set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" (
set ARCH=Win32
)
:: cmake --build build --target check --config Debug || exit /b !errorlevel!
msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel!
msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel!
- name: Run Debug test
if: matrix.config == 'debug'
if: matrix.qt_ver == ''
run: .\bin\debug\testrunner.exe || exit /b !errorlevel!
- name: Build CLI release configuration using MSBuild
if: matrix.config == 'release'
if: matrix.qt_ver == ''
run: |
set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" (
set ARCH=Win32
)
:: cmake --build build --target check --config Release || exit /b !errorlevel!
msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel!
msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel!
- name: Run Release test
if: matrix.config == 'release'
if: matrix.qt_ver == ''
run: .\bin\testrunner.exe || exit /b !errorlevel!
- name: Run test/cli
if: matrix.config == 'release'
if: matrix.qt_ver == ''
run: |
:: since FILESDIR is not set copy the binary to the root so the addons are found
:: copy .\build\bin\Release\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
copy .\bin\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
copy .\bin\cppcheck-core.dll .\cppcheck-core.dll || exit /b !errorlevel!
cd test/cli || exit /b !errorlevel!
:: python -m pytest -Werror --strict-markers -vv --suppress-no-test-exit-code test-clang-import.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-helloworld.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-inline-suppress.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-more-projects.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-other.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-proj2.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-suppress-syntaxError.py || exit /b !errorlevel!
:: python -m pytest --suppress-no-test-exit-code test-clang-import.py || exit /b !errorlevel!
python -m pytest test-helloworld.py || exit /b !errorlevel!
python -m pytest test-inline-suppress.py || exit /b !errorlevel!
python -m pytest test-more-projects.py || exit /b !errorlevel!
python -m pytest test-proj2.py || exit /b !errorlevel!
python -m pytest test-suppress-syntaxError.py || exit /b !errorlevel!
- name: Test addons
if: matrix.config == 'release'
if: matrix.qt_ver == ''
run: |
.\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!
.\cppcheck.exe --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c
cd addons\test
rem We'll force C89 standard to enable an additional verification for
rem rules 5.4 and 5.5 which have standard-dependent options.
..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 || exit /b !errorlevel!
python3 ..\misra.py -verify misra\misra-test.c.dump || exit /b !errorlevel!
rem TODO: do we need to verify something here?
..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra\misra-test.h || exit /b !errorlevel!
..\..\cppcheck --dump misra\misra-test.cpp || exit /b !errorlevel!
python3 ..\misra.py -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_ascii.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_utf8.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_windows1250.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
..\..\cppcheck --addon=misra --enable=style --platform=avr8 --error-exitcode=1 misra\misra-test-avr8.c || exit /b !errorlevel!
..\..\cppcheck --dump misc-test.cpp || exit /b !errorlevel!
python3 ..\misc.py -verify misc-test.cpp.dump || exit /b !errorlevel!
..\..\cppcheck --dump naming_test.c || exit /b !errorlevel!
rem TODO: fix this - does not fail on Linux
rem python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump || exit /b !errorlevel!
..\..\cppcheck --dump naming_test.cpp || exit /b !errorlevel!
python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump || exit /b !errorlevel!
..\..\cppcheck --dump namingng_test.c || exit /b !errorlevel!
python3 ..\namingng.py --configfile ..\naming.json --verify namingng_test.c.dump || exit /b !errorlevel!
..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 && python3 ..\misra.py -verify misra\misra-test.c.dump

View File

@ -2,122 +2,52 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: address sanitizer
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
container:
image: "ubuntu:21.10"
env:
QT_VERSION: 5.15.2
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@v3
- uses: actions/checkout@v2
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
check-latest: true
python-version: '3.10'
- 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
apt-get update
apt-get install -y make libz3-dev libpcre3-dev
apt-get install -y clang-13
- 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 17
- name: Install Qt ${{ env.QT_VERSION }}
if: false
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
- name: Install missing Python packages
run: |
python3 -m pip install pip --upgrade
python3 -m pip install pytest
python3 -m pip install pytest-timeout
# 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 -DWITH_QCHART=Off -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=Off -DDISABLE_DMAKE=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: make -j$(nproc) cppcheck testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes VERIFY=1
env:
CC: clang-17
CXX: clang++-17
- name: Build cppcheck
run: |
cmake --build cmake.output --target cppcheck -- -j $(nproc)
- name: Build test
run: |
cmake --build cmake.output --target testrunner -- -j $(nproc)
CC: clang-13
CXX: clang++-13
CXXFLAGS: "-fsanitize=address -O2 -g3 -DCPPCHK_GLIBCXX_DEBUG"
CPPFLAGS: "-DCHECK_INTERNAL"
- name: Run tests
run: ./cmake.output/bin/testrunner
run: ./testrunner
- name: Run cfg tests
run: |
cmake --build cmake.output --target checkcfg -- -j $(nproc)
# TODO: re-enable - was being killed because of incresaed memory usage
# - name: Self check
# run: |
# ./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings cli lib
# ./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ -DQT_VERSION=0x050000 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings gui/*.cpp
# ./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli -Igui --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings test/*.cpp tools
# 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)
# TODO: This does takes too long to run
# - name: Bughunting lib
# run: ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib
- 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-*.py
- name: Generate dependencies
if: false
run: |
# make sure auto-generated GUI files exist
make -C cmake.output autogen
make -C cmake.output gui-build-deps triage-build-ui-deps
# TODO: this is currently way too slow (~60 minutes) to enable it
# TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError
- name: Self check
if: false
run: |
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5_summary -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --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 lib || ec=1
./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -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/*.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 --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1
exit $ec

47
.github/workflows/bughunting.yml vendored Normal file
View File

@ -0,0 +1,47 @@
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: bughunting
# TODO: enable this when
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install missing software
run: |
sudo apt-get update
sudo apt-get install z3 libz3-dev
- name: Build cppcheck
run: |
make -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes
env:
CXXFLAGS: "-O2 -march=native"
# currently to slow to execute it in the CI
- name: Run CVE suite
run: |
python test/bug-hunting/cve.py
- name: Run ITC suite
run: |
git clone https://github.com/regehr/itc-benchmarks.git ~/itc
python test/bug-hunting/itc.py
- name: Run juliet
run: |
mkdir ~/juliet
curl https://samate.nist.gov/SARD/testsuites/juliet/Juliet_Test_Suite_v1.3_for_C_Cpp.zip -o ~/juliet/juliet.zip
cd ~/juliet && unzip -qq ~/juliet/juliet.zip
python test/bug-hunting/juliet.py

View File

@ -1,22 +1,12 @@
name: Build manual
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
convert_via_pandoc:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- run: |
mkdir output
@ -24,35 +14,12 @@ jobs:
- uses: docker://pandoc/latex:2.9
with:
args: --output=output/manual.html man/manual.md
- uses: docker://pandoc/latex:2.9
with:
args: --output=output/manual.pdf man/manual.md
- uses: docker://pandoc/latex:2.9
with:
args: --output=output/manual-premium.pdf man/manual-premium.md
- uses: actions/upload-artifact@v3
args: --output=output/manual.pdf man/manual.md
- uses: actions/upload-artifact@v2
with:
name: output
path: output
manpage:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install missing software on ubuntu
run: |
sudo apt-get update
sudo apt-get install -y xsltproc docbook-xsl
- name: build manpage
run: |
make man
- uses: actions/upload-artifact@v3
with:
name: cppcheck.1
path: cppcheck.1

View File

@ -1,26 +0,0 @@
name: CIFuzz
on: [pull_request]
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'cppcheck'
dry-run: false
language: c++
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'cppcheck'
fuzz-seconds: 300
dry-run: false
language: c++
- name: Upload Crash
uses: actions/upload-artifact@v3
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts

View File

@ -2,69 +2,58 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: clang-tidy
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
container:
image: "ubuntu:21.10"
env:
QT_VERSION: 6.6.0
QT_VERSION: 5.15.2
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- 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
apt-get update
apt-get install -y cmake g++ make
apt-get install -y libz3-dev
apt-get install -y libpcre3-dev
apt-get install -y libffi7 # work around missing dependency for Qt install step
apt-get install -y clang-tidy-13
- 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 17
sudo apt-get install -y clang-tidy-17
- name: Cache Qt ${{ env.QT_VERSION }}
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ../Qt
key: Linux-QtCache-${{ env.QT_VERSION }}-qtcharts
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v2
with:
install-deps: 'nosudo'
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
- name: Verify clang-tidy configuration
run: |
clang-tidy-17 --verify-config
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- 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
env:
CC: clang-17
CXX: clang++-17
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off ..
cd ..
- name: Prepare CMake dependencies
run: |
# 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 -C cmake.output lib/CMakeFiles/lib_objs.dir/cmake_pch.hxx.cxx
make -C cmake.output test/CMakeFiles/testrunner.dir/cmake_pch.hxx.cxx
# make sure the auto-generated GUI sources exist
make -C cmake.output autogen

View File

@ -1,22 +1,11 @@
name: "CodeQL"
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
security-events: write
on: [push, pull_request]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
fail-fast: false
@ -29,16 +18,17 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Install missing software on ubuntu
run: |
sudo apt-get update
sudo apt-get install libxml2-utils
sudo apt-get install libz3-dev libz3-4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -48,7 +38,7 @@ jobs:
setup-python-dependencies: false
- run: |
make -j$(nproc) HAVE_RULES=yes cppcheck
make -j$(nproc) USE_Z3=yes HAVE_RULES=yes cppcheck
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v1

View File

@ -2,64 +2,46 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: Coverage
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ runner.os }}
- uses: actions/checkout@v2
- name: Install missing software on ubuntu
run: |
sudo apt-get update
sudo apt-get install libxml2-utils lcov
- name: Install missing Python packages on ubuntu
run: |
sudo apt-get install libxml2-utils
sudo apt-get install libz3-dev libz3-4
sudo apt-get install lcov
sudo apt-get install libcppunit-dev
python -m pip install pip --upgrade
python -m pip install lcov_cobertura
- name: Compile instrumented
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) all CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes
- name: Run instrumented tests
run: |
./testrunner
test/cfg/runtests.sh
make -j$(nproc) test CXXFLAGS="-g -fprofile-arcs -ftest-coverage" USE_Z3=yes HAVE_RULES=yes
- name: Generate coverage report
run: |
rm -rf coverage_report
./testrunner
test/cfg/runtests.sh
gcov lib/*.cpp -o lib/
lcov --directory ./ --capture --output-file lcov_tmp.info -b ./
lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info
genhtml lcov.info -o coverage_report --frame --legend --demangle-cpp
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v2
with:
name: Coverage results
path: coverage_report
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v1.2.1
with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
# file: ./coverage.xml # optional

View File

@ -1,43 +0,0 @@
name: cppcheck-premium
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04 # run on the latest image only
env:
PREMIUM_VERSION: devdrop-20231105
steps:
- uses: actions/checkout@v3
- name: Download cppcheckpremium
run: |
wget https://files.cppchecksolutions.com/cppcheckpremium-${{ env.PREMIUM_VERSION }}-amd64.tar.gz
tar xzf cppcheckpremium-${{ env.PREMIUM_VERSION }}-amd64.tar.gz
- name: Generate a license file
run: |
echo cppcheck > cppcheck.lic
echo 231231 >> cppcheck.lic
echo 80000 >> cppcheck.lic
echo 57e08c39523ab54d >> cppcheck.lic
echo path:lib >> cppcheck.lic
- name: Check
run: |
cppcheckpremium-${{ env.PREMIUM_VERSION }}/premiumaddon --check-loc-license cppcheck.lic > cppcheck-premium-loc
cppcheckpremium-${{ env.PREMIUM_VERSION }}/cppcheck -j$(nproc) -D__GNUC__ -D__CPPCHECK__ --suppressions-list=cppcheckpremium-suppressions --platform=unix64 --enable=style --premium=misra-c++-2008 --premium=cert-c++-2016 --inline-suppr --error-exitcode=1 lib

View File

@ -2,28 +2,18 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: format
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Cache uncrustify
uses: actions/cache@v3
uses: actions/cache@v2
id: cache-uncrustify
with:
path: |
@ -35,13 +25,13 @@ jobs:
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
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -- -j$(nproc) -s
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -- -j$(nproc) -s
mkdir ~/uncrustify
cd build && cp uncrustify ~/uncrustify/
cp uncrustify ~/uncrustify/
- name: Uncrustify check
run: |
~/uncrustify/uncrustify -c .uncrustify.cfg -l CPP --no-backup --replace */*.cpp */*.h
git diff
git diff | diff - /dev/null &> /dev/null
~/uncrustify/uncrustify -c .uncrustify.cfg -l CPP --check */*.cpp */*.h

View File

@ -2,167 +2,62 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: include-what-you-use
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
permissions:
contents: read
on: workflow_dispatch
jobs:
iwyu:
build:
strategy:
matrix:
image: ["fedora:latest"] # "debian:unstable" / "archlinux:latest"
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
container:
image: "fedora:latest"
image: "kalilinux/kali-rolling"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
# TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image
- name: Install missing software on debian/ubuntu
if: contains(matrix.image, 'debian')
- name: Install missing software
run: |
apt-get update
apt-get install -y cmake g++ make libpcre3-dev
apt-get install -y cmake g++ make libz3-dev libpcre3-dev
apt-get install -y qtbase5-dev qttools5-dev libqt5charts5-dev
apt-get install -y wget iwyu
ln -s ../x86_64-linux-gnu/qt5 /usr/include/qt
- name: Install missing software on archlinux
if: contains(matrix.image, 'archlinux')
run: |
set -x
pacman -Sy
pacman -S cmake make gcc qt5-base qt5-tools qt5-charts pcre wget --noconfirm
pacman-key --init
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
pacman-key --lsign-key 3056513887B78AEB
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm
echo "[chaotic-aur]" >> /etc/pacman.conf
echo "Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf
pacman -Sy
pacman -S include-what-you-use --noconfirm
ln -s iwyu-tool /usr/sbin/iwyu_tool
# TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image
- name: Install missing software on Fedora
if: contains(matrix.image, 'fedora')
run: |
dnf install -y cmake gcc-c++ qt5-qtbase-devel qt5-linguist qt5-qttools-devel qt5-qtcharts-devel pcre-devel
dnf install -y wget iwyu
ln -s iwyu_tool.py /usr/bin/iwyu_tool
ln -s qt5 /usr/include/qt
# TODO: switch to Qt 6 after we enabled the Qt mappings again
- 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 -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off ..
cd ..
- name: Prepare CMake dependencies
run: |
# 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 -C cmake.output lib/CMakeFiles/lib_objs.dir/cmake_pch.hxx.cxx
#make -C cmake.output test/CMakeFiles/testrunner.dir/cmake_pch.hxx.cxx
# 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: Build Qt mappings
run: |
wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-qt.py
python3 iwyu-mapgen-qt.py /usr/include/qt/ > qt5.imp
python3 iwyu-mapgen-qt.py /usr/include/x86_64-linux-gnu/qt5/ > qt5.imp
# TODO: the mapping file causes a massive slowdown so we cannot use it at the moment.
# add "-Xiwyu --mapping_file=qt5.imp" at the end of the whole command if we can use them.
- name: iwyu_tool
run: |
PWD=$(pwd)
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -Xiwyu --mapping_file=$PWD/qt5.imp -I/usr/lib/clang/17/include > iwyu.log
# do not fail for now so the output is being saved
iwyu_tool -p cmake.output -j $(nproc) -- -w > iwyu.log || true
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: Compilation Database
path: ./cmake.output/compile_commands.json
- uses: actions/upload-artifact@v3
if: success() || failure()
- uses: actions/upload-artifact@v2
with:
name: Qt Mappings
path: ./qt5.imp
- uses: actions/upload-artifact@v3
if: success() || failure()
- uses: actions/upload-artifact@v2
with:
name: Logs (include-what-you-use)
name: Logs
path: ./*.log
clang-include-cleaner:
runs-on: ubuntu-22.04
env:
QT_VERSION: 5.15.2
steps:
- uses: actions/checkout@v3
- 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
- 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 17
sudo apt-get install -y clang-tools-17
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
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 -DBUILD_TESTS=On -DBUILD_GUI=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
env:
CC: clang-17
CXX: clang++-17
- name: Prepare CMake dependencies
run: |
# 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 -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-17 --print=changes --extra-arg=-w -p cmake.output > clang-include-cleaner.log 2>&1
- uses: actions/upload-artifact@v3
with:
name: Logs (clang-include-cleaner)
path: ./*.log

View File

@ -12,9 +12,6 @@ on:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: read
defaults:
run:
shell: cmd
@ -23,147 +20,135 @@ jobs:
build:
runs-on: windows-2022
runs-on: windows-2019
env:
# see https://www.pcre.org/original/changelog.txt
PCRE_VERSION: 8.45
# see https://github.com/Z3Prover/z3/releases:
Z3_VERSION: 4.8.15
QT_VERSION: 5.15.2
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Set up Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Setup msbuild.exe
uses: microsoft/setup-msbuild@v1.0.2
- name: Cache PCRE
id: cache-pcre
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: |
externals\pcre.h
externals\pcre64.lib
key: pcre-${{ env.PCRE_VERSION }}-bin-x64-win-release-job
path: pcre-${{ env.PCRE_VERSION }}.zip
key: pcre-${{ env.PCRE_VERSION }}
- 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!
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip
- name: Install PCRE
if: steps.cache-pcre.outputs.cache-hit != 'true'
run: |
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!
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!
7z x pcre-%PCRE_VERSION%.zip
cd pcre-%PCRE_VERSION%
cmake . -G "Visual Studio 16 2019" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF
msbuild -m PCRE.sln /p:Configuration=Release /p:Platform=x64
copy pcre.h ..\externals
copy Release\pcre.lib ..\externals\pcre64.lib
- name: Cache Z3 Library
id: cache-z3
uses: actions/cache@v2
with:
path: z3-${{ env.Z3_VERSION }}-x64-win.zip
key: z3-${{ env.Z3_VERSION }}-x64-win
- name: Download Z3 library
if: steps.cache-z3.outputs.cache-hit != 'true'
run: |
curl -fsSL https://github.com/Z3Prover/z3/releases/download/z3-%Z3_VERSION%/z3-%Z3_VERSION%-x64-win.zip -o z3-%Z3_VERSION%-x64-win.zip
- name: Install Z3 library
run: |
7z x z3-%Z3_VERSION%-x64-win.zip -oexternals -r -y
move externals\z3-%Z3_VERSION%-x64-win externals\z3
- name: Cache Qt ${{ env.QT_VERSION }}
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ../Qt
key: Windows-QtCache-${{ env.QT_VERSION }}-qtcharts-qthelp
# 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@v2
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
tools: 'tools_opensslv3_x64'
cache: true
modules: 'qtcharts qthelp'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Create .qm
run: |
cd gui || exit /b !errorlevel!
lupdate gui.pro -no-obsolete || exit /b !errorlevel!
lrelease gui.pro -removeidentical || exit /b !errorlevel!
cd gui
lupdate gui.pro
lrelease gui.pro -removeidentical
- name: Matchcompiler
run: python tools\matchcompiler.py --write-dir lib || exit /b !errorlevel!
run: python tools\matchcompiler.py --write-dir lib
- name: Build x64 release GUI
run: |
cd gui || exit /b !errorlevel!
qmake HAVE_QCHART=yes || exit /b !errorlevel!
nmake release || exit /b !errorlevel!
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd gui
qmake HAVE_QCHART=yes
nmake release
env:
CL: /MP
- 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\gui
del Build\gui\cppcheck-gui.ilk
del Build\gui\cppcheck-gui.pdb
# 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
run: |
pip install -U pyinstaller || exit /b !errorlevel!
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!
run: msbuild -m cppcheck.sln /t:cli /p:Configuration=Release-PCRE /p:Platform=x64
- 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!
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!
xcopy /s gui\help win_installer\files\help || exit /b !errorlevel!
del win_installer\files\translations\*.qm || exit /b !errorlevel!
move gui\*.qm win_installer\files\translations || 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!
move Build\gui win_installer\files
mkdir win_installer\files\addons
copy addons\*.* win_installer\files\addons
mkdir win_installer\files\cfg
copy cfg\*.cfg win_installer\files\cfg
mkdir win_installer\files\platforms
copy platforms\*.xml win_installer\files\platforms
copy bin\cppcheck.exe win_installer\files
copy bin\cppcheck-core.dll win_installer\files
copy externals\z3\bin\libz3.dll win_installer\files
mkdir win_installer\files\help
xcopy /s gui\help win_installer\files\help
del win_installer\files\translations\*.qm
move gui\*.qm win_installer\files\translations
- name: Build Installer
run: |
cd win_installer || exit /b !errorlevel!
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd win_installer
REM Read ProductVersion
for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a
REM Remove double quotes
set PRODUCTVER=%PRODUCTVER:"=%
echo ProductVersion="%PRODUCTVER%" || exit /b !errorlevel!
msbuild -m cppcheck.wixproj -p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }} || exit /b !errorlevel!
echo ProductVersion=%PRODUCTVER%
msbuild -m cppcheck.wixproj /p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v2
with:
name: installer
path: win_installer/Build/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v2
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!
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\sqldrivers || 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\opengl32sw.dll || exit /b !errorlevel!
del win_installer\files\Qt5Svg.dll || exit /b !errorlevel!
del win_installer\files\vc_redist.x64.exe || exit /b !errorlevel!
- uses: actions/upload-artifact@v3
with:
name: portable
path: win_installer\files

View File

@ -2,73 +2,49 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: scriptcheck
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
# 'ubuntu-22.04' removes Python 2.7, 3.6 and 3.6 so keep the previous LTS version
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ runner.os }}
- uses: actions/checkout@v2
- name: Cache Cppcheck
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: cppcheck
key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }}
- name: build cppcheck
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) -s CXXFLAGS="-w"
make -j$(nproc) -s
strip -s ./cppcheck
scriptcheck:
needs: build
# 'ubuntu-22.04' removes Python 2.7, 3.5 and 3.6 so keep the previous LTS version
# 'ubutunu-20.04' no longer works on 2.7 - TODO: re-added in a different way or remove support for it?
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
include:
- python-version: '3.12'
python-latest: true
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10']
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Restore Cppcheck
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: cppcheck
key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install missing software on ubuntu
run: |
@ -86,9 +62,6 @@ jobs:
- name: Install missing software on ubuntu (Python 3)
if: matrix.python-version != '2.7'
run: |
# shellcheck cannot be installed via pip
# ERROR: Could not find a version that satisfies the requirement shellcheck (from versions: none)
# ERROR: No matching distribution found for shellcheck
sudo apt-get install shellcheck
python -m pip install pip --upgrade
python -m pip install natsort
@ -101,25 +74,22 @@ jobs:
python -m pip install psutil
- name: run Shellcheck
if: matrix.python-latest
if: matrix.python-version == '3.10'
run: |
find . -name "*.sh" | xargs shellcheck --exclude SC2002,SC2013,SC2034,SC2035,SC2043,SC2046,SC2086,SC2089,SC2090,SC2129,SC2211,SC2231
- name: run pylint
if: matrix.python-latest
if: matrix.python-version == '3.10'
run: |
echo "FIXME pylint is disabled for now because it fails to import files:"
echo "FIXME addons/runaddon.py:1:0: E0401: Unable to import 'cppcheckdata' (import-error)"
echo "FIXME addons/runaddon.py:1:0: E0401: Unable to import 'cppcheck' (import-error)"
# pylint --rcfile=pylintrc_travis --jobs $(nproc) addons/*.py htmlreport/cppcheck-htmlreport htmlreport/*.py tools/*.py
pylint --rcfile=pylintrc_travis --jobs $(nproc) addons/*.py htmlreport/cppcheck-htmlreport htmlreport/*.py tools/*.py
- name: check .json files
if: matrix.python-latest
if: matrix.python-version == '3.10'
run: |
find . -name '*.json' | xargs -n 1 python -m json.tool > /dev/null
- name: Validate
if: matrix.python-latest
if: matrix.python-version == '3.10'
run: |
make -j$(nproc) validateCFG validatePlatforms validateRules
@ -139,18 +109,9 @@ jobs:
run: |
python tools/test_matchcompiler.py
# 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/test-*.py
env:
PYTHONPATH: ./addons
- name: test addons
if: matrix.python-version != '3.9' && matrix.python-version != '3.10'
run: |
python -m pytest -Werror --strict-markers -vv addons/test/test-*.py
python -m pytest addons/test/test-*.py
env:
PYTHONPATH: ./addons
@ -162,39 +123,12 @@ jobs:
- name: test reduce
run: |
python -m pytest -Werror --strict-markers -vv tools/test_reduce.py
python -m pytest tools/test_reduce.py
env:
PYTHONPATH: ./tools
- name: test donate_cpu_lib
if: matrix.python-version != '2.7'
run: |
python -m pytest -Werror --strict-markers -vv tools/test_donate_cpu_lib.py
env:
PYTHONPATH: ./tools
- name: test donate_cpu_server
if: matrix.python-version != '2.7'
run: |
python -m pytest -Werror --strict-markers -vv tools/test_donate_cpu_server.py
env:
PYTHONPATH: ./tools
dmake:
strategy:
matrix:
os: [ubuntu-22.04, macos-12, windows-2022]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: run dmake
run: |
make -j2 CXXFLAGS="-w" run-dmake
- name: check diff
- name: dmake
if: matrix.python-version == '3.10'
run: |
make -j$(nproc) run-dmake
git diff --exit-code

View File

@ -2,70 +2,54 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: selfcheck
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
env:
QT_VERSION: 6.6.0
QT_VERSION: 5.15.2
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Install missing software
run: |
sudo apt-get update
sudo apt-get install libboost-container-dev
sudo apt-get install libz3-dev
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
- name: Cache Qt ${{ env.QT_VERSION }}
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
key: ${{ github.workflow }}-${{ runner.os }}
- name: Install missing software
run: |
sudo apt-get update
sudo apt-get install clang-14 valgrind
path: ../Qt
key: Linux-QtCache-${{ env.QT_VERSION }}-qtcharts
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
cached: ${{ steps.cache-qt.outputs.cache-hit }}
# TODO: cache this - perform same build as for the other self check
- name: Self check (build)
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
# valgrind cannot handle DWARF 5 yet so force version 4
# work around performance regression with -inline-deferral
make -j$(nproc) -s CXXFLAGS="-O2 -w -DHAVE_BOOST -gdwarf-4 -mllvm -inline-deferral" MATCHCOMPILER=yes
env:
CC: clang-14
CXX: clang++-14
make clean
make -j$(nproc) -s CXXFLAGS="-O2 -w" MATCHCOMPILER=yes
- 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
mkdir cmake.output
pushd cmake.output
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=ON -DWITH_QCHART=ON -DCMAKE_GLOBAL_AUTOGEN_TARGET=On ..
- name: Generate dependencies
run: |
# make sure the precompiled headers exist
make -C cmake.output lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx
make -C cmake.output lib/CMakeFiles/lib_objs.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
@ -75,20 +59,21 @@ jobs:
- 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 --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__GNUC__ -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 --inconclusive --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
# the following steps are duplicated from above since setting up the build node in a parallel step takes longer than the actual steps
- 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
mkdir cmake.output.notest
pushd cmake.output.notest
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=0 -DBUILD_GUI=ON -DWITH_QCHART=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 -C cmake.output.notest lib/CMakeFiles/lib_objs.dir/cmake_pch.hxx.cxx
# make sure auto-generated GUI files exist
make -C cmake.output.notest autogen
make -C cmake.output.notest gui-build-deps
@ -96,40 +81,6 @@ jobs:
# 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 --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__GNUC__ -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 --inconclusive --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
- name: Fetch corpus
run: |
wget https://github.com/danmar/cppcheck/archive/refs/tags/2.8.tar.gz
tar xvf 2.8.tar.gz
- name: CMake (corpus / no test)
run: |
cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On
- name: Generate dependencies (corpus)
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.corpus autogen
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 --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
env:
DISABLE_VALUEFLOW: 1
- uses: actions/upload-artifact@v3
with:
name: Callgrind Output
path: ./callgrind.*
DISABLE_VALUEFLOW: 1

View File

@ -1,122 +0,0 @@
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: thread sanitizer
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
env:
QT_VERSION: 5.15.2
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@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
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
- 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 17
- name: Install Qt ${{ env.QT_VERSION }}
if: false
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
- name: Install missing Python packages
run: |
python3 -m pip install pip --upgrade
python3 -m pip install pytest
python3 -m pip install pytest-timeout
- name: CMake
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=Off -DWITH_QCHART=Off -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DUSE_THREADS=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 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
CC: clang-17
CXX: clang++-17
- name: Build cppcheck
run: |
cmake --build cmake.output --target cppcheck -- -j $(nproc)
- name: Build test
run: |
cmake --build cmake.output --target testrunner -- -j $(nproc)
- name: Run tests
run: ./cmake.output/bin/testrunner
- name: Run cfg tests
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-*.py
- name: Generate dependencies
if: false
run: |
# make sure auto-generated GUI files exist
make -C cmake.output autogen
make -C cmake.output gui-build-deps triage-build-ui-deps
# TODO: disabled for now as it takes around 40 minutes to finish
# set --error-exitcode=0 so we only fail on sanitizer issues - since it uses threads for execution it will exit the whole process on the first issue
- name: Self check
if: false
run: |
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5_summary -D__GNUC__ --error-exitcode=0 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --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 -DCHECK_INTERNAL cli lib || ec=1
./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -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/*.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 --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1
exit $ec

View File

@ -2,118 +2,51 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: undefined behaviour sanitizers
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
container:
image: "ubuntu:21.10"
env:
QT_VERSION: 5.15.2
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
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
check-latest: true
python-version: '3.10'
- 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
apt-get update
apt-get install -y make libz3-dev libpcre3-dev
apt-get install -y clang-13
- 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 17
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
- name: Install missing Python packages
run: |
python3 -m pip install pip --upgrade
python3 -m pip install pytest
python3 -m pip install pytest-timeout
# TODO: disable warnings
- name: CMake
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=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 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: make -j$(nproc) cppcheck testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes VERIFY=1
env:
CC: clang-17
CXX: clang++-17
- name: Build cppcheck
run: |
cmake --build cmake.output --target cppcheck -- -j $(nproc)
- name: Build test
run: |
cmake --build cmake.output --target testrunner -- -j $(nproc)
CC: clang-13
CXX: clang++-13
CXXFLAGS: "-fsanitize=undefined -fsanitize=nullability -fno-sanitize=signed-integer-overflow -O2 -g3 -DCPPCHK_GLIBCXX_DEBUG"
CPPFLAGS: "-DCHECK_INTERNAL"
- name: Run tests
run: ./cmake.output/bin/testrunner
run: ./testrunner
- name: Run cfg tests
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-*.py
- name: Generate dependencies
run: |
# make sure auto-generated GUI files exist
make -C cmake.output autogen
make -C cmake.output gui-build-deps triage-build-ui-deps
# 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,internal --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 lib || ec=1
./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -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/*.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 --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1
exit $ec
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings cli lib
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ -DQT_VERSION=0x050000 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings gui/*.cpp
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli -Igui --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings test/*.cpp tools
# TODO: This does takes too long to run
# - name: Bughunting lib
# run: ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib

View File

@ -2,60 +2,51 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: valgrind
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Prepare
run: |
sudo apt-get update
sudo apt-get install debian-goodies ubuntu-dbgsym-keyring
# the key expired and the ubuntu-dbgsym-keyring package does not yet include the latest one - see https://bugs.launchpad.net/ubuntu/+source/ubuntu-keyring/+bug/1920640
wget -O - http://ddebs.ubuntu.com/dbgsym-release-key.asc | sudo apt-key add -
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ runner.os }}
- name: Add debug repos on ubuntu
run: |
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
- name: Install missing software
run: |
sudo apt-get update
sudo apt-get install libxml2-utils
sudo apt-get install valgrind
sudo apt-get install libboost-container-dev
sudo apt-get install debuginfod
sudo apt-get install libz3-dev libz3-4 libz3-4-dbgsym
sudo apt-get install libc6-dbg-amd64-cross
- name: Build cppcheck
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) HAVE_RULES=yes MATCHCOMPILER=yes
CXXFLAGS="-O1 -g" make -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes
- name: Build test
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) testrunner HAVE_RULES=yes MATCHCOMPILER=yes
CXXFLAGS="-O1 -g" make -j$(nproc) testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes
- name: Run valgrind
run: |
ec=0
valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate 9>memcheck.log || ec=1
valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate 9>memcheck.log
cat memcheck.log
exit $ec
env:
DEBUGINFOD_URLS: https://debuginfod.ubuntu.com
- uses: actions/upload-artifact@v3
if: success() || failure()
- uses: actions/upload-artifact@v2
with:
name: Logs
path: ./*.log

98
.gitignore vendored
View File

@ -2,16 +2,16 @@
*.gcno
*.o
*.pyc
/cppcheck
/cppcheck.exe
cppcheck
cppcheck.exe
cppcheck-core.dll
/dmake
/dmake.exe
dmake
dmake.exe
reduce
reduce.exe
tags
/testrunner
/testrunner.exe
testrunner
testrunner.exe
tools/daca2*.html
tools/dmake
tools/errmsg
@ -20,9 +20,6 @@ tools/extracttests
# dump files generated by Cppcheck
*.*.dump
# CTU info files generated by Cppcheck
*.*.ctu-info
# VS generated files
*.aps
*.idb
@ -34,17 +31,16 @@ tools/extracttests
*.sdf
*.suo
*.user
/.vs/
UpgradeLog*.htm
.vs/
# VS build folders
bin/
Build/
BuildTmp/
/cli/temp/
cli/temp/
ipch/
/lib/temp/
/test/temp/
lib/temp/
test/temp/
# XCode build folders and files
*.mode[0-9]v[0-9]
@ -52,33 +48,32 @@ ipch/
build/
# GUI build folders
/gui/debug/
/gui/release/
/gui/temp/
/triage/temp
gui/debug/
gui/release/
gui/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
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/
@ -95,7 +90,7 @@ htmlreport/MANIFEST
*.kdev4
# Common cmake build directories
build**/
build*
# Temporal files
*.swp
@ -106,33 +101,28 @@ prime
parts
stage
*.snap
/snap/.snapcraft
snap/.snapcraft
# Manual folder
/man/manual.log
/man/manual.tex
/man/*.pdf
/man/*.html
man/manual.log
man/manual.tex
man/*.pdf
man/*.html
# CLion
/.idea
.idea
/.metadata/
/cmake-build-*
/.run
cmake-*
# clang tooling temporary files
.clangd/
.cache/
compile_commands.json
# qmake
.qmake.stash
/gui/.qmake.stash
#vs code
/.vscode
.vscode
#debian build system
/debian
/release_files
*.lha

View File

@ -1,28 +0,0 @@
missingIncludeSystem
# temporary suppressions - fix the warnings!
simplifyUsing:lib/valueptr.h
varid0:gui/projectfile.cpp
naming-privateMemberVariable:gui/test/cppchecklibrarydata/testcppchecklibrarydata.h
symbolDatabaseWarning:*/moc_*.cpp
simplifyUsing:*/moc_*.cpp
# warnings in Qt generated code we cannot fix
funcArgNamesDifferent:*/moc_*.cpp
naming-varname:*/ui_*.h
functionStatic:*/ui_fileview.h
# --debug-warnings suppressions
valueFlowBailout
valueFlowBailoutIncompleteVar
autoNoType
naming-varname:externals/simplecpp/simplecpp.h
naming-privateMemberVariable:externals/simplecpp/simplecpp.h
# 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

View File

@ -1,15 +1,13 @@
# we are not using all methods of their interfaces
unusedFunction:externals/*/*
unusedFunction:externals/tinyxml2/tinyxml2.cpp
unusedFunction:externals/simplecpp/simplecpp.cpp
# TODO: fix these
# false positive - # 10660
unusedFunction:gui/mainwindow.cpp
unusedFunction:gui/resultstree.cpp
unusedFunction:gui/codeeditor.*
unusedFunction:gui/codeeditor.cpp
# usage is disabled
unusedFunction:lib/symboldatabase.cpp
# false positive - #10661
unusedFunction:oss-fuzz/main.cpp
# Q_OBJECT functions which are not called in our code
unusedFunction:cmake.output.notest/gui/cppcheck-gui_autogen/*/moc_aboutdialog.cpp
unusedFunction:oss-fuzz/main.cpp

View File

@ -18,7 +18,21 @@ env:
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
- travis_retry sudo apt-get install -qq python3-pip libxml2-utils libpcre3 gdb unzip wx-common xmlstarlet python3-dev liblua5.3-dev libcurl3 libcairo2-dev libsigc++-2.0-dev tidy libopencv-dev libz3-dev
# Python 2 modules
- travis_retry python2 -m pip install --user pytest==4.6.4
- travis_retry python2 -m pip install --user unittest2
- travis_retry python2 -m pip install --user pexpect # imported by tools/ci.py
- travis_retry python2 -m pip install --user pygments
# Python 3 modules
- travis_retry python3 -m pip install --user setuptools --upgrade
- travis_retry python3 -m pip install --user pytest
- travis_retry python3 -m pip install --user unittest2
- travis_retry python3 -m pip install --user pexpect # imported by tools/ci.py
- travis_retry python3 -m pip install --user requests # imported by tools/pr.py
- travis_retry python3 -m pip install --user pygments
- travis_retry python3 -m pip install --user natsort
- cp externals/z3_version_old.h externals/z3_version.h # because travis z3 version is old
matrix:
# do notify immediately about it when a job of a build fails.
@ -41,3 +55,50 @@ matrix:
- echo $CXXFLAGS
- make -s MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck -j$(nproc)
- sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck install
# check if it actually works:
- /usr/bin/cppcheck -j$(nproc) ./cli
# check addons/misc.py
- cd addons/test
- ${CPPCHECK} --dump misc-test.cpp
- python3 ../misc.py -verify misc-test.cpp.dump
- cd ../../
# check addons/misra.py
- cd addons/test
# We'll force C89 standard to enable an additional verification for
# rules 5.4 and 5.5 which have standard-dependent options.
- ${CPPCHECK} --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.c
- ${CPPCHECK} --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.h
- python3 ../misra.py -verify misra/misra-test.c.dump
- ${CPPCHECK} --dump misra/misra-test.cpp
- python3 ../misra.py -verify misra/misra-test.cpp.dump
- python ../misra.py --rule-texts=misra/misra2012_rules_dummy_ascii.txt -verify misra/misra-test.cpp.dump
- python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_ascii.txt -verify misra/misra-test.cpp.dump
- python ../misra.py --rule-texts=misra/misra2012_rules_dummy_utf8.txt -verify misra/misra-test.cpp.dump
- python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_utf8.txt -verify misra/misra-test.cpp.dump
- python ../misra.py --rule-texts=misra/misra2012_rules_dummy_windows1250.txt -verify misra/misra-test.cpp.dump
- python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_windows1250.txt -verify misra/misra-test.cpp.dump
- cd ../../
# check addons/naming.py
- cd addons/test
- ${CPPCHECK} --dump naming_test.c
- python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
- ${CPPCHECK} --dump naming_test.cpp
- python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
- cd ../..
# check addons/namingng.py
- cd addons/test
- ${CPPCHECK} --dump namingng_test.c
- python3 ../namingng.py --configfile ../naming.json --verify namingng_test.c.dump
- cd ../..
script:
# fail the entire job as soon as one of the subcommands exits non-zero to save time and resources
- set -e
# check with TEST_MATHLIB_VALUE enabled
- touch lib/mathlib.cpp test/testmathlib.cpp
- echo $CXXFLAGS
- make -s check -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE
- touch lib/mathlib.cpp test/testmathlib.cpp
# compile cppcheck, default build
- echo $CXXFLAGS
- make -s check -j$(nproc)

View File

@ -0,0 +1,8 @@
unreadVariable
shadowVar
shadowFunction
unusedStructMember
nullPointer
uninitvar
noExplicitConstructor

23
.travis_suppressions Normal file
View File

@ -0,0 +1,23 @@
unusedPrivateFunction:test/testbufferoverrun.cpp
unusedPrivateFunction:test/testcmdlineparser.cpp
shadowFunction
bitwiseOnBoolean
# temporary suppressions - fix the warnings!
unusedPrivateFunction:test/test*.cpp
useStlAlgorithm
simplifyUsing:lib/valueptr.h
symbolDatabaseWarning:gui/temp/moc_*.cpp
simplifyUsing:gui/temp/moc_*.cpp
symbolDatabaseWarning:tools/triage/moc_*.cpp
# --debug-warnings suppressions
valueFlowBailout
valueFlowBailoutIncompleteVar
autoNoType
bailoutUninitVar
*:gui/test/*
*:test/test.cxx
*:test/cfg/*
*:externals/*/*

49
AUTHORS
View File

@ -21,7 +21,6 @@ Alexey Eryomenko
Alexey Zhikhartsev
Alfi Maulana
Ali Can Demiralp
Alon Alexander
Alon Liberman
Ameen Ali
Andreas Bacher
@ -31,14 +30,10 @@ Andreas Pokorny
Andreas Rönnquist
Andreas Vollenweider
Andrei Karas
Andrew C Aitchison
Andrew C. Martin
Andrew D. Bancroft
Andy Holmes
Andy Maloney
Aneesh Azhakesan S
Ankita Gupta
Anton Lindqvist
Antti Tuppurainen
Anurag Garg
Armin Müller
@ -65,9 +60,7 @@ Boris Barbulovski
Boris Egorov
Boussaffa Walid
Bo Rydberg
bzgec
Carl Michael Grüner Monzón
Carl Morgan
Carlo Marcelo Arenas Belón
Carlos Gomes Martinho
Carl-Oskar Larsson
@ -76,17 +69,14 @@ Changkyoon Kim
Chris Lalancette
Christian Ehrlicher
Christian Franke
Christoph Grüninger
Christoph Schmidt
Christoph Strehle
Chuck Larson
Cilyan Olowen
Claus Jensby Madsen
Colomban Wendling
Conrado Gouvea
daisuke-chiba
Daniel Friedrich
David Korczynski
Daniel Marjamäki
David Hallas
David Korth
@ -96,7 +86,6 @@ Deepak Gupta
dencat
Diego de las Heras
Dirk Jagdmann
Dirk Mueller
Dmitriy
Dmitry Marakasov
Dmitry-Me
@ -105,7 +94,6 @@ Edoardo Prezioso
Eivind Tagseth
Elbert Pol
Emmanuel Blot
Eric Lemanissier
Eric Malenfant
Eric Sesterhenn
Erik Hovland
@ -127,11 +115,8 @@ Garrett Bodily
Gary Leutheuser
gaurav kaushik
Gennady Feldman
Georgi D. Sotirov
Georgy Komarov
Gerbo Engels
Gerhard Zlabinger
Gerik Rhoden
Gianfranco Costamagna
Gianluca Scacco
Gleydson Soares
@ -139,11 +124,9 @@ Goran Džaferi
Graham Whitted
Greg Hewgill
Guillaume A.
Guillaume Chauvel
Guillaume Miossec
Gustav Palmqvist
Günther Makulik
Haowei Hsu
Harald Scheidl
Heiko Bauke
Heiko Eißfeldt
@ -162,22 +145,17 @@ Jan Egil Ruud
Jan Hellwig
János Maros
Jay Sigbrandt
Jedrzej Klocek
Jens Bäckman
Jens Yllman
Jérémy Lefaure
Jes Ramsing
Jesse Boswell
Jim Kuhn
Jim Zhou
jlguardi
Johan Bertrand
Johan Samuelson
John Marshall
John-Paul Ore
John Smits
Jonathan Clohessy
Jonathan Haehne
Jonathan Neuschäfer
Jonathan Thackray
José Martins
@ -198,18 +176,15 @@ Ketil Skjerve
Kevin Christian
Kevin Kendzia
Kimmo Varis
Kleber Tarcísio
Konrad Grochowski
Konrad Windszus
Kumar Ashwani
Kushal Chandar
Kyle Chisholm
Lars Even Almaas
larudwer
Lau bakman
Lauri Nurmi
Leandro Lisboa Penz
Leila F. Rahman
Lena Herscheid
Leon De Andrade
Lieven de Cock
@ -229,9 +204,7 @@ Marco Trevisan
Marek Zmysłowski
Marian Klymov
Mark de Wever
Mark Hermeling
Markus Elfring
Martin Delille
Martin Ettl
Martin Exner
Martin Güthle
@ -239,7 +212,6 @@ Martin Herren
Márton Csordás
Masafumi Koba
Massimo Paladin
Mateusz Michalak
Mateusz Pusz
Mathias De Maré
Mathias Schmid
@ -249,7 +221,6 @@ Matthias Schmieder
Matt Johnson
Maurice Gilden
Mavik
Michael Drake
Michael Løiten
Miika-Petteri Matikainen
Mika Attila
@ -275,9 +246,7 @@ Oleksandr Redko
Oliver Schode
Oliver Stöneberg
Olivier Croquette
Patrick Oppenlander
Paul Aitken
Paul Bersee
Paul Fultz II
Pavel Bibergal
Pavel Pimenov
@ -292,13 +261,9 @@ Philipp Kloke
Pierre Schweitzer
Pino Toscano
Pranav Khanna
Radek Jarecki
Rainer Wiesenfarth
Ramzan Bekbulatov
Raphael Geissert
Razvan Ioan Alexe
Reijo Tomperi
Rainer Wiesenfarth
Riccardo Ghetta
Richard A. Smith
Richard Quirk
@ -316,23 +281,18 @@ root
Rosen Penev
Rudi Danner
Rudolf Grauberger
Ryan M. Lederman
Ryan Pavlik
Samir Aguiar
Sam Truscott
Samuel Degrande
Samuel Poláček
Sandeep Dutta
Savvas Etairidis
Scott Furry
Sebastian Held
Sebastian Matuschka
Sébastien Debrard
Sergei Chernykh
Sergei Trofimovich
Sergey Burgsdorf
Shane Tapp
Shohei YOSHIDA
Simon Cornell
Simon Kagstrom
Simon Large
@ -341,7 +301,6 @@ Simon Shanks
Slava Semushin
Stas Cymbalov
Stefan Beller
Stefan Hagen
Stefan Naewe
Stefan van Kessel
Stefan Weil
@ -357,33 +316,27 @@ Sylvain Joubert
Tam Do Thanh
Teddy Didé
Thomas Arnhold
Tomasz Edward Posluszny
Thomas Jarosch
Thomas Niederberger
Thomas Otto
Thomas P. K. Healy
Thomas Sondergaard
Thorsten Sick
Tim Blume
Tim Gerundt
tititiou36
Tobias Weibel
Tomasz Kłoczko
Tom Pollok
Tomo Dote
Toralf Förster
Troshin V.S.
Tyson Nottingham
Valentin Batz
Valerii Lashmanov
Vasily Maslyukov
Veli-Matti Visuri
WenChung Chiu
Vesa Pikki
Ville-Pekka Vahteala
Ville Skyttä
Vincent Le Garrec
Wang Haoyu
WenChung Chiu
Wolfgang Stöggl
x29a
XhmikosR

View File

@ -1,14 +1,10 @@
cmake_minimum_required(VERSION 2.8.12)
project(Cppcheck)
include(cmake/cxx11.cmake)
use_cxx11()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(GNUInstallDirs)
include(cmake/ccache.cmake)
include(cmake/compilerCheck.cmake)
include(cmake/versions.cmake)
include(cmake/options.cmake)
@ -16,57 +12,28 @@ include(cmake/findDependencies.cmake)
include(cmake/compileroptions.cmake)
include(cmake/compilerDefinitions.cmake)
include(cmake/buildFiles.cmake)
include(cmake/printInfo.cmake)
if(BUILD_GUI)
include(cmake/cxx11.cmake)
if (BUILD_GUI)
include(cmake/qtCompat.cmake)
endif()
use_cxx11()
file(GLOB addons "addons/*.py")
file(GLOB cfgs "cfg/*.cfg")
file(GLOB platforms "platforms/*.xml")
if(LIBXML2_XMLLINT_EXECUTABLE)
add_custom_target(validateCFG DEPENDS validateCFG-cmd)
add_custom_command(OUTPUT validateCFG-cmd
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng)
find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint)
if (LIBXML2_XMLLINT_EXECUTABLE)
add_custom_target(validateCFG ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng)
foreach(cfg ${cfgs})
add_custom_command(OUTPUT validateCFG-cmd APPEND
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng ${cfg})
get_filename_component(cfgname ${cfg} NAME_WE)
add_custom_target(validateCFG-${cfgname} ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng ${cfg})
add_dependencies(validateCFG validateCFG-${cfgname})
endforeach()
# this is a symbolic name for a build rule and not an output file
set_source_files_properties(validateCFG-cmd PROPERTIES SYMBOLIC "true")
add_custom_target(validatePlatforms ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/platforms/cppcheck-platforms.rng)
foreach(platform ${platforms})
get_filename_component(platformname ${platform} NAME_WE)
add_custom_target(validatePlatforms-${platformname} ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/platforms/cppcheck-platforms.rng ${platform})
add_dependencies(validatePlatforms validatePlatforms-${platformname})
endforeach()
add_custom_target(errorlist-xml $<TARGET_FILE:cppcheck> --errorlist > ${CMAKE_BINARY_DIR}/errorlist.xml
DEPENDS cppcheck)
add_custom_target(example-xml $<TARGET_FILE:cppcheck> --xml --enable=all --inconclusive --max-configs=1 ${CMAKE_SOURCE_DIR}/samples 2> ${CMAKE_BINARY_DIR}/example.xml
DEPENDS cppcheck)
add_custom_target(createXMLExamples DEPENDS errorlist-xml example-xml)
if(PYTHON_EXECUTABLE)
add_custom_target(checkCWEEntries ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/listErrorsWithoutCWE.py -F ${CMAKE_BINARY_DIR}/errorlist.xml
DEPENDS errorlist-xml)
endif()
add_custom_target(validateXML ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng ${CMAKE_BINARY_DIR}/errorlist.xml
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng ${CMAKE_BINARY_DIR}/example.xml
DEPENDS createXMLExamples
)
add_custom_target(validateRules ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/rules/*.xml)
endif()
if(BUILD_TESTS)
if (BUILD_TESTS)
enable_testing()
endif()
@ -80,22 +47,18 @@ add_custom_target(copy_addons ALL
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/addons"
COMMENT "Copying addons files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
add_custom_target(copy_platforms ALL
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/platforms"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/platforms"
COMMENT "Copying platforms files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
if(USE_BUNDLED_TINYXML2)
message(STATUS "Using bundled version of tinyxml2")
add_subdirectory(externals/tinyxml2)
endif()
add_subdirectory(externals/simplecpp)
add_subdirectory(lib) # CppCheck Library
add_subdirectory(lib) # CppCheck Library
add_subdirectory(cli) # Client application
add_subdirectory(test) # Tests
add_subdirectory(gui) # Graphical application
add_subdirectory(tools/triage) # Triage tool
add_subdirectory(oss-fuzz) # OSS-Fuzz clients
add_subdirectory(tools)
add_subdirectory(man)
include(cmake/printInfo.cmake)
include(cmake/clang_tidy.cmake)

708
Makefile

File diff suppressed because it is too large Load Diff

View File

@ -1,918 +0,0 @@
# This file is generated by tools/dmake, do not edit.
ifndef VERBOSE
VERBOSE=
endif
# To compile with rules, use 'make HAVE_RULES=yes'
ifndef HAVE_RULES
HAVE_RULES=no
endif
ifdef SRCDIR
$(error Usage of SRCDIR to activate match compiler has been removed. Use MATCHCOMPILER=yes instead.)
endif
ifndef MATCHCOMPILER
MATCHCOMPILER=
endif
# use match compiler
ifeq ($(MATCHCOMPILER),yes)
# Find available Python interpreter
ifeq ($(PYTHON_INTERPRETER),)
PYTHON_INTERPRETER := $(shell which python3)
endif
ifeq ($(PYTHON_INTERPRETER),)
PYTHON_INTERPRETER := $(shell which python)
endif
ifeq ($(PYTHON_INTERPRETER),)
$(error Did not find a Python interpreter)
endif
ifdef VERIFY
matchcompiler_S := $(shell $(PYTHON_INTERPRETER) tools/matchcompiler.py --verify)
else
matchcompiler_S := $(shell $(PYTHON_INTERPRETER) tools/matchcompiler.py)
endif
libcppdir:=build
else
libcppdir:=lib
endif
ifndef CPPFLAGS
CPPFLAGS=
endif
ifdef FILESDIR
CPPFLAGS+=-DFILESDIR=\"$(FILESDIR)\"
endif
RDYNAMIC=-export-dynamic
# Set the CPPCHK_GLIBCXX_DEBUG flag. This flag is not used in release Makefiles.
# The _GLIBCXX_DEBUG define doesn't work in Cygwin or other Win32 systems.
ifndef COMSPEC
ifeq ($(VERBOSE),1)
$(info COMSPEC not found)
endif
ifdef ComSpec
ifeq ($(VERBOSE),1)
$(info ComSpec found)
endif
#### ComSpec is defined on some WIN32's.
WINNT=1
ifeq ($(VERBOSE),1)
$(info PATH=$(PATH))
endif
ifneq (,$(findstring /cygdrive/,$(PATH)))
ifeq ($(VERBOSE),1)
$(info /cygdrive/ found in PATH)
endif
CYGWIN=1
endif # CYGWIN
endif # ComSpec
endif # COMSPEC
ifdef WINNT
ifeq ($(VERBOSE),1)
$(info WINNT found)
endif
#### Maybe Windows
ifndef CPPCHK_GLIBCXX_DEBUG
CPPCHK_GLIBCXX_DEBUG=
endif # !CPPCHK_GLIBCXX_DEBUG
ifeq ($(VERBOSE),1)
$(info MSYSTEM=$(MSYSTEM))
endif
ifneq ($(MSYSTEM),MINGW32 MINGW64)
RDYNAMIC=
endif
LDFLAGS+=-lshlwapi
else # !WINNT
ifeq ($(VERBOSE),1)
$(info WINNT not found)
endif
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifeq ($(VERBOSE),1)
$(info uname_S=$(uname_S))
endif
ifeq ($(uname_S),Linux)
ifndef CPPCHK_GLIBCXX_DEBUG
CPPCHK_GLIBCXX_DEBUG=-D_GLIBCXX_DEBUG
endif # !CPPCHK_GLIBCXX_DEBUG
endif # Linux
ifeq ($(uname_S),GNU/kFreeBSD)
ifndef CPPCHK_GLIBCXX_DEBUG
CPPCHK_GLIBCXX_DEBUG=-D_GLIBCXX_DEBUG
endif # !CPPCHK_GLIBCXX_DEBUG
endif # GNU/kFreeBSD
LDFLAGS+=-lpthread
endif # WINNT
ifdef CYGWIN
ifeq ($(VERBOSE),1)
$(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
ifndef CXX
CXX=g++
endif
ifeq (clang++, $(findstring clang++,$(CXX)))
CPPCHK_GLIBCXX_DEBUG=
endif
ifndef CXXFLAGS
CXXFLAGS=-std=c++0x -O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-multichar
endif
override CXXFLAGS +=-mcrt=newlib -O2 -athread=native -DNO_UNIX_SIGNAL_HANDLING -DUSE_THREADS
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
endif
ifeq ($(HAVE_RULES),yes)
PCRE_CONFIG = $(shell which pcre-config)
ifeq ($(PCRE_CONFIG),)
$(error Did not find pcre-config)
endif
override CXXFLAGS += -DHAVE_RULES $(shell $(PCRE_CONFIG) --cflags)
ifdef LIBS
LIBS += -lpcre
else
LIBS=-lpcre
endif
endif
ifndef PREFIX
PREFIX=/usr
endif
ifndef INCLUDE_FOR_LIB
INCLUDE_FOR_LIB=-Ilib -isystem externals -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml2
endif
ifndef INCLUDE_FOR_CLI
INCLUDE_FOR_CLI=-Ilib -isystem externals/simplecpp -isystem externals/tinyxml2
endif
ifndef INCLUDE_FOR_TEST
INCLUDE_FOR_TEST=-Ilib -Icli -isystem externals/simplecpp -isystem externals/tinyxml2
endif
BIN=$(DESTDIR)$(PREFIX)/bin
# For 'make man': sudo apt-get install xsltproc docbook-xsl docbook-xml on Linux
DB2MAN?=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
XP=xsltproc -''-nonet -''-param man.charmap.use.subset "0"
MAN_SOURCE=man/cppcheck.1.xml
###### Object Files
LIBOBJ = $(libcppdir)/valueflow.o \
$(libcppdir)/tokenize.o \
$(libcppdir)/symboldatabase.o \
$(libcppdir)/addoninfo.o \
$(libcppdir)/analyzerinfo.o \
$(libcppdir)/astutils.o \
$(libcppdir)/check.o \
$(libcppdir)/check64bit.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)/checkersreport.o \
$(libcppdir)/checkexceptionsafety.o \
$(libcppdir)/checkfunctions.o \
$(libcppdir)/checkinternal.o \
$(libcppdir)/checkio.o \
$(libcppdir)/checkleakautovar.o \
$(libcppdir)/checkmemoryleak.o \
$(libcppdir)/checknullpointer.o \
$(libcppdir)/checkother.o \
$(libcppdir)/checkpostfixoperator.o \
$(libcppdir)/checksizeof.o \
$(libcppdir)/checkstl.o \
$(libcppdir)/checkstring.o \
$(libcppdir)/checktype.o \
$(libcppdir)/checkuninitvar.o \
$(libcppdir)/checkunusedfunctions.o \
$(libcppdir)/checkunusedvar.o \
$(libcppdir)/checkvaarg.o \
$(libcppdir)/clangimport.o \
$(libcppdir)/color.o \
$(libcppdir)/cppcheck.o \
$(libcppdir)/ctu.o \
$(libcppdir)/errorlogger.o \
$(libcppdir)/errortypes.o \
$(libcppdir)/forwardanalyzer.o \
$(libcppdir)/fwdanalysis.o \
$(libcppdir)/importproject.o \
$(libcppdir)/infer.o \
$(libcppdir)/keywords.o \
$(libcppdir)/library.o \
$(libcppdir)/mathlib.o \
$(libcppdir)/path.o \
$(libcppdir)/pathanalysis.o \
$(libcppdir)/pathmatch.o \
$(libcppdir)/platform.o \
$(libcppdir)/preprocessor.o \
$(libcppdir)/programmemory.o \
$(libcppdir)/reverseanalyzer.o \
$(libcppdir)/settings.o \
$(libcppdir)/summaries.o \
$(libcppdir)/suppressions.o \
$(libcppdir)/templatesimplifier.o \
$(libcppdir)/timer.o \
$(libcppdir)/token.o \
$(libcppdir)/tokenlist.o \
$(libcppdir)/utils.o \
$(libcppdir)/vfvalue.o
EXTOBJ = externals/simplecpp/simplecpp.o \
externals/tinyxml2/tinyxml2.o
CLIOBJ = cli/cmdlineparser.o \
cli/cppcheckexecutor.o \
cli/cppcheckexecutorseh.o \
cli/cppcheckexecutorsig.o \
cli/executor.o \
cli/filelister.o \
cli/main.o \
cli/processexecutor.o \
cli/singleexecutor.o \
cli/stacktrace.o \
cli/threadexecutor.o
TESTOBJ = test/fixture.o \
test/helpers.o \
test/main.o \
test/options.o \
test/test64bit.o \
test/testanalyzerinformation.o \
test/testassert.o \
test/testastutils.o \
test/testautovariables.o \
test/testbool.o \
test/testboost.o \
test/testbufferoverrun.o \
test/testcharvar.o \
test/testcheck.o \
test/testclangimport.o \
test/testclass.o \
test/testcmdlineparser.o \
test/testcolor.o \
test/testcondition.o \
test/testconstructors.o \
test/testcppcheck.o \
test/testerrorlogger.o \
test/testexceptionsafety.o \
test/testfilelister.o \
test/testfunctions.o \
test/testgarbage.o \
test/testimportproject.o \
test/testincompletestatement.o \
test/testinternal.o \
test/testio.o \
test/testleakautovar.o \
test/testlibrary.o \
test/testmathlib.o \
test/testmemleak.o \
test/testnullpointer.o \
test/testoptions.o \
test/testother.o \
test/testpath.o \
test/testpathmatch.o \
test/testplatform.o \
test/testpostfixoperator.o \
test/testpreprocessor.o \
test/testprocessexecutor.o \
test/testsettings.o \
test/testsimplifytemplate.o \
test/testsimplifytokens.o \
test/testsimplifytypedef.o \
test/testsimplifyusing.o \
test/testsingleexecutor.o \
test/testsizeof.o \
test/teststl.o \
test/teststring.o \
test/testsummaries.o \
test/testsuppressions.o \
test/testsymboldatabase.o \
test/testthreadexecutor.o \
test/testtimer.o \
test/testtoken.o \
test/testtokenize.o \
test/testtokenlist.o \
test/testtokenrange.o \
test/testtype.o \
test/testuninitvar.o \
test/testunusedfunctions.o \
test/testunusedprivfunc.o \
test/testunusedvar.o \
test/testutils.o \
test/testvaarg.o \
test/testvalueflow.o \
test/testvarid.o
.PHONY: run-dmake tags
###### Targets
cppcheck: $(EXTOBJ) $(LIBOBJ) $(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/cppcheckexecutorsig.o cli/stacktrace.o cli/filelister.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS) $(RDYNAMIC)
test: all
./testrunner
check: all
./testrunner -q
checkcfg: cppcheck validateCFG
./test/cfg/runtests.sh
dmake: tools/dmake.o cli/filelister.o $(libcppdir)/pathmatch.o $(libcppdir)/path.o $(libcppdir)/utils.o externals/simplecpp/simplecpp.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
run-dmake: dmake
./dmake --release
clean:
rm -f build/*.cpp build/*.o lib/*.o cli/*.o test/*.o tools/*.o externals/*/*.o testrunner dmake cppcheck cppcheck.exe cppcheck.1
man: man/cppcheck.1
man/cppcheck.1: $(MAN_SOURCE)
$(XP) $(DB2MAN) $(MAN_SOURCE)
tags:
ctags -R --exclude=doxyoutput --exclude=test/cfg cli externals gui lib test
install: cppcheck
install -d ${BIN}
install cppcheck ${BIN}
install htmlreport/cppcheck-htmlreport ${BIN}
ifdef FILESDIR
install -d ${DESTDIR}${FILESDIR}
install -d ${DESTDIR}${FILESDIR}/addons
install -m 644 addons/*.py ${DESTDIR}${FILESDIR}/addons
install -d ${DESTDIR}${FILESDIR}/cfg
install -m 644 cfg/*.cfg ${DESTDIR}${FILESDIR}/cfg
install -d ${DESTDIR}${FILESDIR}/platforms
install -m 644 platforms/*.xml ${DESTDIR}${FILESDIR}/platforms
else
$(error FILESDIR must be set!)
endif
uninstall:
@if test -d ${BIN}; then \
files="cppcheck cppcheck-htmlreport"; \
echo '(' cd ${BIN} '&&' rm -f $$files ')'; \
( cd ${BIN} && rm -f $$files ); \
fi
ifdef FILESDIR
@if test -d ${DESTDIR}${FILESDIR}; then \
echo rm -rf ${DESTDIR}${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))
.PHONY: validateCFG
%.checked:%.cfg
xmllint --noout --relaxng cfg/cppcheck-cfg.rng $<
validateCFG: ${ConfigFilesCHECKED}
xmllint --noout cfg/cppcheck-cfg.rng
# Validation of platforms files:
PlatformFiles := $(wildcard platforms/*.xml)
PlatformFilesCHECKED := $(patsubst %.xml,%.checked,$(PlatformFiles))
.PHONY: validatePlatforms
%.checked:%.xml
xmllint --noout --relaxng platforms/cppcheck-platforms.rng $<
validatePlatforms: ${PlatformFilesCHECKED}
xmllint --noout platforms/cppcheck-platforms.rng
# Validate XML output (to detect regressions)
/tmp/errorlist.xml: cppcheck
./cppcheck --errorlist >$@
/tmp/example.xml: cppcheck
./cppcheck --xml --enable=all --inconclusive --max-configs=1 samples 2>/tmp/example.xml
createXMLExamples:/tmp/errorlist.xml /tmp/example.xml
.PHONY: validateXML
validateXML: createXMLExamples
xmllint --noout cppcheck-errors.rng
xmllint --noout --relaxng cppcheck-errors.rng /tmp/errorlist.xml
xmllint --noout --relaxng cppcheck-errors.rng /tmp/example.xml
checkCWEEntries: /tmp/errorlist.xml
$(eval PYTHON_INTERPRETER := $(if $(PYTHON_INTERPRETER),$(PYTHON_INTERPRETER),$(shell which python3)))
$(eval PYTHON_INTERPRETER := $(if $(PYTHON_INTERPRETER),$(PYTHON_INTERPRETER),$(shell which python)))
$(eval PYTHON_INTERPRETER := $(if $(PYTHON_INTERPRETER),$(PYTHON_INTERPRETER),$(error Did not find a Python interpreter)))
$(PYTHON_INTERPRETER) tools/listErrorsWithoutCWE.py -F /tmp/errorlist.xml
.PHONY: validateRules
validateRules:
xmllint --noout rules/*.xml
###### 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/path.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/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/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/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
$(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
$(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/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
$(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
$(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
$(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
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/check64bit.cpp
$(libcppdir)/checkassert.o: lib/checkassert.cpp lib/addoninfo.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/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
$(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
$(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
$(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/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
$(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/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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
$(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/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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
$(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/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/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
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkunusedfunctions.cpp
$(libcppdir)/checkunusedvar.o: lib/checkunusedvar.cpp externals/simplecpp/simplecpp.h 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/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/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
$(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
$(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
$(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/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
$(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
$(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/config.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/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/astutils.h lib/config.h lib/errortypes.h lib/fwdanalysis.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/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/tokenize.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
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/infer.cpp
$(libcppdir)/keywords.o: lib/keywords.cpp lib/config.h lib/keywords.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/keywords.cpp
$(libcppdir)/library.o: lib/library.cpp externals/tinyxml2/tinyxml2.h lib/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/valueflow.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
$(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/utils.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/path.cpp
$(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/utils.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
$(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
$(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/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
$(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
$(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
$(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/mathlib.h lib/path.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
$(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
$(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
$(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)/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
$(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/cppcheckexecutorsig.h cli/executor.h cli/processexecutor.h cli/singleexecutor.h cli/threadexecutor.h lib/addoninfo.h lib/analyzerinfo.h lib/check.h lib/checkersreport.h lib/checkunusedfunctions.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/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/platform.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/cppcheckexecutorseh.cpp
cli/cppcheckexecutorsig.o: cli/cppcheckexecutorsig.cpp cli/cppcheckexecutor.h cli/cppcheckexecutorsig.h cli/stacktrace.h lib/config.h lib/filesettings.h lib/platform.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/cppcheckexecutorsig.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
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/executor.cpp
cli/filelister.o: cli/filelister.cpp cli/filelister.h lib/config.h lib/path.h lib/pathmatch.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/platform.h lib/standards.h lib/utils.h
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/main.cpp
cli/processexecutor.o: cli/processexecutor.cpp cli/executor.h cli/processexecutor.h lib/addoninfo.h lib/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/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/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/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/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/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/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/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h test/fixture.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 lib/addoninfo.h lib/config.h lib/errortypes.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 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
$(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 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testanalyzerinformation.cpp
test/testassert.o: test/testassert.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testassert.cpp
test/testastutils.o: test/testastutils.cpp 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/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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testastutils.cpp
test/testautovariables.o: test/testautovariables.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testautovariables.cpp
test/testbool.o: test/testbool.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testbool.cpp
test/testboost.o: test/testboost.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testboost.cpp
test/testbufferoverrun.o: test/testbufferoverrun.cpp 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/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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testbufferoverrun.cpp
test/testcharvar.o: test/testcharvar.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.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
$(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
$(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
$(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 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/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
$(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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcondition.cpp
test/testconstructors.o: test/testconstructors.cpp 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/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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testconstructors.cpp
test/testcppcheck.o: test/testcppcheck.cpp 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/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testcppcheck.cpp
test/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/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testerrorlogger.cpp
test/testexceptionsafety.o: test/testexceptionsafety.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.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/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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilelister.cpp
test/testfunctions.o: test/testfunctions.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.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
$(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/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/redirect.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testimportproject.cpp
test/testincompletestatement.o: test/testincompletestatement.cpp 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/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/testincompletestatement.cpp
test/testinternal.o: test/testinternal.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testinternal.cpp
test/testio.o: test/testio.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testio.cpp
test/testleakautovar.o: test/testleakautovar.cpp 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/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/testleakautovar.cpp
test/testlibrary.o: test/testlibrary.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/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 lib/xml.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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testmathlib.cpp
test/testmemleak.o: test/testmemleak.cpp 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/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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testmemleak.cpp
test/testnullpointer.o: test/testnullpointer.cpp 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/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
$(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
$(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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testother.cpp
test/testpath.o: test/testpath.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/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/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
$(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/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h lib/xml.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testplatform.cpp
test/testpostfixoperator.o: test/testpostfixoperator.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testpreprocessor.cpp
test/testprocessexecutor.o: test/testprocessexecutor.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/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/testsettings.o: test/testsettings.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/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 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 test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytemplate.cpp
test/testsimplifytokens.o: test/testsimplifytokens.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 test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytokens.cpp
test/testsimplifytypedef.o: test/testsimplifytypedef.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 test/fixture.h test/helpers.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsimplifytypedef.cpp
test/testsimplifyusing.o: test/testsimplifyusing.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 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 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/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 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/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/testsizeof.cpp
test/teststl.o: test/teststl.cpp 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/settings.h lib/standards.h lib/suppressions.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/teststl.cpp
test/teststring.o: test/teststring.cpp 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/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/teststring.cpp
test/testsummaries.o: test/testsummaries.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/summaries.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.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 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/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 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/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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testsymboldatabase.cpp
test/testthreadexecutor.o: test/testthreadexecutor.cpp cli/executor.h cli/threadexecutor.h lib/addoninfo.h lib/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/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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtimer.cpp
test/testtoken.o: test/testtoken.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 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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenize.cpp
test/testtokenlist.o: test/testtokenlist.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/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtokenlist.cpp
test/testtokenrange.o: test/testtokenrange.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/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
$(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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtype.cpp
test/testuninitvar.o: test/testuninitvar.cpp 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/settings.h lib/standards.h lib/suppressions.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/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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedfunctions.cpp
test/testunusedprivfunc.o: test/testunusedprivfunc.cpp lib/addoninfo.h lib/check.h lib/checkclass.h lib/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/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
$(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
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testutils.cpp
test/testvaarg.o: test/testvaarg.cpp 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/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvaarg.cpp
test/testvalueflow.o: test/testvalueflow.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 test/fixture.h test/helpers.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvalueflow.cpp
test/testvarid.o: test/testvarid.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 test/fixture.h test/helpers.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testvarid.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
tools/dmake.o: tools/dmake.cpp cli/filelister.h lib/config.h lib/pathmatch.h lib/utils.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ tools/dmake.cpp
release: cppcheck
mkdir -p release/cppcheck
cp -r release_files/* release/cppcheck/
cp -r cfg release/cppcheck/
cp -r addons release/cppcheck/
cp -r platforms release/cppcheck/
cp cppcheck release/cppcheck/cppcheck
strip release/cppcheck/cppcheck
cp COPYING release/cppcheck/
cp AUTHORS release/cppcheck/
cp README-Amiga.md release/cppcheck/
lha -aeqr3 a cppcheck.lha release/
rm -rf release

View File

@ -1,37 +0,0 @@
# cppcheck
This is the port of cppcheck 2.8 to AmigaOS 4.
Cppcheck is a static analysis tool for C/C++ code. It provides unique code
analysis to detect bugs and focuses on detecting undefined behaviour and
dangerous coding constructs. The goal is to have very few false positives.
Cppcheck is designed to be able to analyze your C/C++ code even if it has
non-standard syntax (common in embedded projects).
### Installation
Extract the archive wherever you want and start using it. You might want
to add its folder at your system PATH, so that it can be accessed by
anywhere. Make sure that all the files that are contained in this archive
are available where you have the executable.
The simplest way to use it is by running it in a shell like
```bash
cppcheck Work:program/src
```
Please, read the manual on different ways to use it. There are many
different options to make it work better and faster for you.
### Support
If you like what I am doing and my ports and you would like to support me,
and my future releases please visit https://ko-fi.com/walkero where you
can find all the latest updates by me and you can donate.
### Changelog
2.8r1 (2022-09-22)
* First public release

View File

@ -10,35 +10,6 @@ Addons are scripts that analyses Cppcheck dump files to check compatibility with
Checks Linux system for [year 2038 problem](https://en.wikipedia.org/wiki/Year_2038_problem) safety. This required [modified environment](https://github.com/3adev/y2038). See complete description [here](https://github.com/danmar/cppcheck/blob/main/addons/doc/y2038.txt).
+ [threadsafety.py](https://github.com/danmar/cppcheck/blob/main/addons/threadsafety.py)
Analyse Cppcheck dump files to locate threadsafety issues like static local objects used by multiple threads.
+ [naming.py](https://github.com/danmar/cppcheck/blob/main/addons/naming.py)
Enforces naming conventions across the code.
+ [namingng.py](https://github.com/danmar/cppcheck/blob/main/addons/namingng.py)
Enforces naming conventions across the code. Enhanced version with support for type prefixes in variable and function names.
+ [findcasts.py](https://github.com/danmar/cppcheck/blob/main/addons/findcasts.py)
Locates casts in the code.
+ [misc.py](https://github.com/danmar/cppcheck/blob/main/addons/misc.py)
Performs miscellaneous checks.
### Other files
- doc
Additional files for documentation generation.
- tests
Contains various unit tests for the addons.
- cppcheck.py
Internal helper used by Cppcheck binary to run the addons.
- cppcheckdata.doxyfile
Configuration file for documentation generation.
- cppcheckdata.py
Helper class for reading Cppcheck dump files within an addon.
- misra_9.py
Implementation of the MISRA 9.x rules used by `misra` addon.
- naming.json
Example configuration for `namingng` addon.
- ROS_naming.json
Example configuration for the `namingng` addon enforcing the [ROS naming convention for C++ ](http://wiki.ros.org/CppStyleGuide#Files).
- runaddon.py
Internal helper used by Cppcheck binary to run the addons.
## Usage

View File

@ -9,27 +9,8 @@ License: No restrictions, use this as you need.
import argparse
import json
import os
import pathlib
import sys
import subprocess
try:
import pathlib
except ImportError:
message = "Failed to load pathlib. Upgrade Python to 3.x or install pathlib with 'pip install pathlib'."
error_id = 'pythonError'
if '--cli' in sys.argv:
msg = { 'file': '',
'linenr': 0,
'column': 0,
'severity': 'error',
'message': message,
'addon': 'cppcheckdata',
'errorId': error_id,
'extra': ''}
sys.stdout.write(json.dumps(msg) + '\n')
else:
sys.stderr.write('%s [%s]\n' % (message, error_id))
sys.exit(1)
from xml.etree import ElementTree
from fnmatch import fnmatch
@ -76,7 +57,6 @@ class Directive:
print(directive.str)
@endcode
"""
#preprocessor.cpp/Preprocessor::dump
str = None
file = None
@ -97,15 +77,7 @@ class Directive:
class MacroUsage:
"""
Tracks preprocessor macro usage
Attributes:
name Name of the macro
usefile
useline
usecolumn
isKnownValue
"""
#preprocessor.cpp/Preprocessor::dump
name = None # Macro name
file = None
@ -121,10 +93,9 @@ class MacroUsage:
self.usefile = element.get('usefile')
self.useline = element.get('useline')
self.usecolumn = element.get('usecolumn')
self.isKnownValue = element.get('is-known-value', 'false') == 'true'
def __repr__(self):
attrs = ["name", "file", "linenr", "column", "usefile", "useline", "usecolumn", "isKnownValue"]
attrs = ["name", "file", "linenr", "column", "usefile", "useline", "usecolumn"]
return "{}({})".format(
"MacroUsage",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -134,12 +105,7 @@ class MacroUsage:
class PreprocessorIfCondition:
"""
Information about #if/#elif conditions
Attributes:
E
result
"""
#preprocessor.cpp/Preprocessor::dump
file = None
linenr = None
@ -159,22 +125,11 @@ class PreprocessorIfCondition:
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
)
class ValueType:
"""
ValueType class. Contains (promoted) type information for each node in the AST.
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
pointer
constness
reference
typeScopeId
originalTypeName bool/const char */long/char */size_t/int/double/std::string/..
"""
#symboldatabase.cpp/ValueType::dump
type = None
sign = None
@ -189,17 +144,14 @@ class ValueType:
self.type = element.get('valueType-type')
self.sign = element.get('valueType-sign')
self.bits = int(element.get('valueType-bits', 0))
self.pointer = int(element.get('valueType-pointer', 0))
self.constness = int(element.get('valueType-constness', 0))
self.reference = element.get('valueType-reference')
self.typeScopeId = element.get('valueType-typeScope')
self.originalTypeName = element.get('valueType-originalTypeName')
#valueType-containerId TODO add
self.constness = int(element.get('valueType-constness', 0))
self.pointer = int(element.get('valueType-pointer', 0))
def __repr__(self):
attrs = ["type", "sign", "bits", "typeScopeId", "originalTypeName",
"constness", "pointer"]
"constness", "pointer"]
return "{}({})".format(
"ValueType",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -235,45 +187,35 @@ class Token:
corresponding '}', ']' and ')'. For templates, the '<' is linked to
the corresponding '>'.
scope Scope information for this token. See the Scope class.
type Type information: name/op/number/string/..
isName Is this token a symbol name
isUnsigned Is this token a unsigned type
isSigned Is this token a signed type
isNumber Is this token a number, for example 123, 12.34
isInt Is this token a int value such as 1234
isFloat Is this token a float value such as 12.34
isString Is this token a string literal such as "hello"
strlen string length for string literal
isChar Is this token a char literal such as 'x'
isBoolean Is this token a boolean
isOp Is this token a operator
isArithmeticalOp Is this token a arithmetic operator
isAssignmentOp Is this token a assignment operator
isComparisonOp Is this token a comparison operator
isLogicalOp Is this token a logical operator: && ||
isCast
externLang
isUnsigned Is this token a unsigned type
isSigned Is this token a signed type
isExpandedMacro Is this token a expanded macro token
macroName Macro name that this token is expanded from
isRemovedVoidParameter Has void parameter been removed?
isSplittedVarDeclComma Is this a comma changed to semicolon in a split variable declaration ('int a,b;' => 'int a; int b;')
isSplittedVarDeclEq Is this a '=' changed to semicolon in a split variable declaration ('int a=5;' => 'int a; a=5;')
isSplittedVarDeclComma Is this a comma changed to semicolon in a splitted variable declaration ('int a,b;' => 'int a; int b;')
isSplittedVarDeclEq Is this a '=' changed to semicolon in a splitted variable declaration ('int a=5;' => 'int a; a=5;')
isImplicitInt Is this token an implicit "int"?
isComplex
isRestrict
isAttributeExport
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.
function If this token points at a function call, this attribute has the Function
information. See the Function class.
values Possible/Known values of token
impossible_values Impossible values of token
valueType type information
typeScope type scope (token->type()->classScope)
astParent ast parent
astOperand1 ast operand1
astOperand2 ast operand2
orriginalName orriginal name of the token
valueType type information: container/..
file file name
linenr line number
column column
@ -288,7 +230,6 @@ class Token:
print(code)
@endcode
"""
#tokenize.cpp/Tokenizer::dump
Id = None
str = None
@ -305,25 +246,17 @@ class Token:
isString = False
strlen = None
isChar = False
isBoolean = False
isOp = False
isArithmeticalOp = False
isAssignmentOp = False
isComparisonOp = False
isLogicalOp = False
isCast = False
isUnsigned = False
isSigned = False
macroName = None
isExpandedMacro = False
isRemovedVoidParameter = False
isSplittedVarDeclComma = False
isSplittedVarDeclEq = False
isImplicitInt = False
isComplex = False
isRestrict = False
isAttributeExport = False
exprId = None
varId = None
variableId = None
variable = None
@ -373,8 +306,6 @@ class Token:
self.strlen = int(element.get('strlen'))
elif type == 'char':
self.isChar = True
elif type == 'boolean':
self.isBoolean = True
elif type == 'op':
self.isOp = True
if element.get('isArithmeticalOp'):
@ -385,38 +316,28 @@ class Token:
self.isComparisonOp = True
elif element.get('isLogicalOp'):
self.isLogicalOp = True
if element.get('isCast'):
self.isCast = True
self.externLang = element.get('externLang')
self.macroName = element.get('macroName')
if self.macroName or element.get('isExpandedMacro'):
if element.get('isExpandedMacro'):
self.isExpandedMacro = True
if element.get('isRemovedVoidParameter'):
self.isRemovedVoidParameter = True
if element.get('isSplittedVarDeclComma'):
self.isSplittedVarDeclComma = True
if element.get('isSplittedVarDeclEq'):
self.isSplittedVarDeclEq = True
if element.get('isImplicitInt'):
self.isImplicitInt = True
if element.get('isComplex'):
self.isComplex = True
if element.get('isRestrict'):
self.isRestrict = True
if element.get('isAttributeExport'):
self.isAttributeExport = True
self.linkId = element.get('link')
self.link = None
if element.get('varId'):
self.varId = int(element.get('varId'))
if element.get('exprId'):
self.exprId = int(element.get('exprId'))
self.variableId = element.get('variable')
self.variable = None
self.functionId = element.get('function')
self.function = None
self.valuesId = element.get('values')
self.values = None
if element.get('valueType-type'):
self.valueType = ValueType(element)
else:
self.valueType = None
self.typeScopeId = element.get('type-scope')
self.typeScope = None
self.astParentId = element.get('astParent')
@ -425,21 +346,15 @@ class Token:
self.astOperand1 = None
self.astOperand2Id = element.get('astOperand2')
self.astOperand2 = None
self.originalName = element.get('originalName')
if element.get('valueType-type'):
self.valueType = ValueType(element)
else:
self.valueType = None
_load_location(self, element)
def __repr__(self):
attrs = ["Id", "str", "scopeId", "isName", "isUnsigned", "isSigned",
"isNumber", "isInt", "isFloat", "isString", "strlen",
"isChar", "isBoolean", "isOp", "isArithmeticalOp", "isAssignmentOp",
"isComparisonOp", "isLogicalOp", "isCast", "externLang", "isExpandedMacro",
"isRemovedVoidParameter", "isSplittedVarDeclComma", "isSplittedVarDeclEq",
"isImplicitInt", "isComplex", "isRestrict", "isAttributeExport", "linkId",
"varId", "variableId", "functionId", "valuesId", "valueType",
"isChar", "isOp", "isArithmeticalOp", "isComparisonOp",
"isLogicalOp", "isExpandedMacro", "isSplittedVarDeclComma",
"isSplittedVarDeclEq", "isImplicitInt", "linkId", "varId",
"variableId", "functionId", "valuesId", "valueType",
"typeScopeId", "astParentId", "astOperand1Id", "file",
"linenr", "column"]
return "{}({})".format(
@ -499,45 +414,6 @@ class Token:
def isBinaryOp(self):
return self.astOperand1 and self.astOperand2
def forward(self, end=None):
token = self
while token and token != end:
yield token
token = token.next
def backward(self, start=None):
token = self
while token and token != start:
yield token
token = token.previous
def astParents(self):
token = self
while token and token.astParent:
token = token.astParent
yield token
def astTop(self):
top = None
for parent in self.astParents():
top = parent
return top
def tokAt(self, n):
tl = self.forward()
if n < 0:
tl = self.backward()
n = -n
for i, t in enumerate(tl):
if i == n:
return t
def linkAt(self, n):
token = self.tokAt(n)
if token:
return token.link
return None
class Scope:
"""
Scope. Information about global scope, function scopes, class scopes, inner scopes, etc.
@ -551,13 +427,8 @@ class Scope:
For a class scope, this is the class name.
function If this scope belongs at a function call, this attribute
has the Function information. See the Function class.
functions if this is a Class type, it may have functions defined
nestedIn
type Type of scope: Function, If/Else/For/While/Switch/Global/Enum/Struct/Namespace/Class/Constructor/Destructor
isExecutable True when the type is: Function/If/Else/For/While/Do/Switch/Try/Catch/Unconditional/Lambda
definedType
type Type of scope: Global, Function, Class, If, While
"""
#symboldatabase.cpp/SymbolDatabase::printXml
Id = None
bodyStartId = None
@ -569,7 +440,6 @@ class Scope:
function = None
nestedInId = None
nestedIn = None
nestedList = None
type = None
isExecutable = None
varlistId = None
@ -580,25 +450,21 @@ class Scope:
self.className = element.get('className')
self.functionId = element.get('function')
self.function = None
self.functions = []
self.bodyStartId = element.get('bodyStart')
self.bodyStart = None
self.bodyEndId = element.get('bodyEnd')
self.bodyEnd = None
self.nestedInId = element.get('nestedIn')
self.nestedIn = None
self.nestedList = list()
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()
def __repr__(self):
attrs = ["Id", "className", "functionId", "bodyStartId", "bodyEndId",
"nestedInId", "nestedIn", "type", "definedType", "isExecutable", "functions"]
"nestedInId", "nestedIn", "type", "isExecutable"]
return "{}({})".format(
"Scope",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -608,8 +474,6 @@ class Scope:
self.bodyStart = IdMap[self.bodyStartId]
self.bodyEnd = IdMap[self.bodyEndId]
self.nestedIn = IdMap[self.nestedInId]
if self.nestedIn:
self.nestedIn.nestedList.append(self)
self.function = IdMap[self.functionId]
for v in self.varlistId:
value = IdMap.get(v)
@ -624,20 +488,14 @@ class Function:
https://cppcheck.sourceforge.io/devinfo/doxyoutput/classFunction.html
Attributes
argument Argument list (dict of argument number and variable)
argument Argument list
token Token in function implementation
tokenDef Token in function definition
name
type Constructor/CopyConstructor/MoveConstructor/OperatorEqual/Destructor/Function/Lambda/Unknown
hasVirtualSpecifier Is this function is virtual
isVirtual Is this function is virtual
isImplicitlyVirtual Is this function is virtual this in the base classes
access Public/Protected/Private
isInlineKeyword Is inline keyword used
isStatic Is this function static
isAttributeNoreturn
overriddenFunction
isStatic Is this function static?
"""
#symboldatabase.cpp/SymbolDatabase::printXml
Id = None
argument = None
@ -648,13 +506,10 @@ class Function:
tokenDefId = None
name = None
type = None
access = None
isVirtual = None
isImplicitlyVirtual = None
hasVirtualSpecifier = None
isInlineKeyword = None
isStatic = None
isAttributeNoreturn = None
overriddenFunction = None
nestedIn = None
def __init__(self, element, nestedIn):
@ -663,22 +518,18 @@ class Function:
self.tokenDefId = element.get('tokenDef')
self.name = element.get('name')
self.type = element.get('type')
self.hasVirtualSpecifier = element.get('hasVirtualSpecifier', 'false') == 'true'
self.isImplicitlyVirtual = element.get('isImplicitlyVirtual', 'false') == 'true'
self.access = element.get('access')
self.isVirtual = element.get('isVirtual', 'false') == 'true'
self.isInlineKeyword = element.get('isInlineKeyword', 'false') == 'true'
self.isStatic = element.get('isStatic', 'false') == 'true'
self.isAttributeNoreturn = element.get('isAttributeNoreturn', 'false') == 'true'
self.overriddenFunction = element.get('overriddenFunction', 'false') == 'true'
self.nestedIn = nestedIn
self.argument = {}
self.argumentId = {}
def __repr__(self):
attrs = ["Id", "tokenId", "tokenDefId", "name", "type", "hasVirtualSpecifier",
"isImplicitlyVirtual", "access", "isInlineKeyword", "isStatic",
"isAttributeNoreturn", "overriddenFunction", "nestedIn", "argumentId"]
attrs = ["Id", "tokenId", "tokenDefId", "name", "type", "isVirtual",
"isImplicitlyVirtual", "isInlineKeyword", "isStatic", "argumentId"]
return "{}({})".format(
"Function",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -691,10 +542,6 @@ class Function:
self.tokenDef = IdMap[self.tokenDefId]
#todo add class Types:
#symboldatabase.cpp/SymbolDatabase::printXml
class Variable:
"""
Information about a variable
@ -705,22 +552,20 @@ class Variable:
nameToken Name token in variable declaration
typeStartToken Start token of variable declaration
typeEndToken End token of variable declaration
access Global/Local/Namespace/Public/Protected/Public/Throw/Argument/Unknown
access Global/Local/Namespace/Public/Protected/Public/Throw/Argument
scope Variable scope
constness Variable constness (same encoding as ValueType::constness)
isArgument Is this variable a function argument?
isGlobal Is this variable a global variable?
isLocal Is this variable a local variable?
isArray Is this variable an array?
isClass Is this variable a class or struct?
isConst Is this variable a const variable?
isGlobal Is this variable a global variable?
isExtern Is this variable an extern variable?
isLocal Is this variable a local variable?
isPointer Is this variable a pointer
isReference Is this variable a reference
isStatic Is this variable static?
isVolatile Is this variable volatile?
constness Variable constness (same encoding as ValueType::constness)
"""
#symboldatabase.cpp/SymbolDatabase::printXml
Id = None
nameTokenId = None
@ -742,7 +587,6 @@ class Variable:
isPointer = False
isReference = False
isStatic = False
isVolatile = False
constness = 0
def __init__(self, element):
@ -754,26 +598,25 @@ class Variable:
self.typeEndTokenId = element.get('typeEndToken')
self.typeEndToken = None
self.access = element.get('access')
self.isArgument = (self.access and self.access == 'Argument')
self.isGlobal = (self.access and self.access == 'Global')
self.isLocal = (self.access and self.access == 'Local')
self.scopeId = element.get('scope')
self.scope = None
self.constness = int(element.get('constness',0))
self.isArgument = (self.access and self.access == 'Argument')
self.isArray = element.get('isArray') == 'true'
self.isClass = element.get('isClass') == 'true'
self.isConst = element.get('isConst') == 'true'
self.isGlobal = (self.access and self.access == 'Global')
self.isExtern = element.get('isExtern') == 'true'
self.isLocal = (self.access and self.access == 'Local')
self.isPointer = element.get('isPointer') == 'true'
self.isReference = element.get('isReference') == 'true'
self.isStatic = element.get('isStatic') == 'true'
self.isVolatile = element.get('isVolatile') == 'true'
self.constness = int(element.get('constness',0))
def __repr__(self):
attrs = ["Id", "nameTokenId", "typeStartTokenId", "typeEndTokenId",
"access", "scopeId", "isArgument", "isArray", "isClass",
"isConst", "isGlobal", "isExtern", "isLocal", "isPointer",
"isReference", "isStatic", "isVolatile", "constness"]
"isReference", "isStatic", "constness", ]
return "{}({})".format(
"Variable",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -785,32 +628,11 @@ class Variable:
self.typeEndToken = IdMap[self.typeEndTokenId]
self.scope = IdMap[self.scopeId]
class Container:
"""
Container class -- information about containers
Attributes:
array-like-index-op true/false
stdStringLike true/false
"""
#tokenizer.cpp/tokenizer::dump
Id = None
def __init__(self, element):
self.Id = element.get('id')
self.arrayLikeIndexOp = element.get('array-like-index-op') == 'true'
self.stdStringLike = element.get('std-string-like') == 'true'
class TypedefInfo:
"""
TypedefInfo class -- information about typedefs
Attributes:
name name of the typedef
used 0/1
"""
#tokenizer.cpp/tokenizer::dump
name = None
used = None
file = None
@ -830,19 +652,11 @@ class Value:
intvalue integer value
tokvalue token value
floatvalue float value
movedvalue
uninit
containerSize container size
bufferSize buffer size
lifetimeScope Local/Argument/SubFunction/ThisPointer/ThisValue
lifetimeKind Object/SubObject/Lambda/Iterator/Address
symbolicDelta
condition condition where this Value comes from
bound Upper/Lower/Point
valueKind known/possible/impossible/inconclusive
path 0/1/2/3/..
valueKind 'known' or 'possible'
inconclusive Is value inconclusive?
"""
#token.cpp/token::printValueFlow
intvalue = None
tokvalue = None
@ -850,6 +664,7 @@ class Value:
containerSize = None
condition = None
valueKind = None
inconclusive = False
def isKnown(self):
return self.valueKind and self.valueKind == 'known'
@ -860,18 +675,12 @@ class Value:
def isImpossible(self):
return self.valueKind and self.valueKind == 'impossible'
def isInconclusive(self):
return self.valueKind and self.valueKind == 'inconclusive'
def __init__(self, element):
self.intvalue = element.get('intvalue')
if self.intvalue:
self.intvalue = int(self.intvalue)
self._tokvalueId = element.get('tokvalue')
self.floatvalue = element.get('floatvalue')
self.movedvalue = element.get('movedvalue')
self.uninit = element.get('uninit')
self.bufferSize = element.get('buffer-size')
self.containerSize = element.get('container-size')
self.iteratorStart = element.get('iterator-start')
self.iteratorEnd = element.get('iterator-end')
@ -880,8 +689,9 @@ class Value:
self.lifetimeKind = element.get('lifetime-kind')
self._symbolicId = element.get('symbolic')
self.symbolicDelta = element.get('symbolic-delta')
self.bound = element.get('bound')
self.condition = element.get('condition-line')
self.bound = element.get('bound')
self.path = element.get('path')
if self.condition:
self.condition = int(self.condition)
if element.get('known'):
@ -890,9 +700,8 @@ class Value:
self.valueKind = 'possible'
elif element.get('impossible'):
self.valueKind = 'impossible'
elif element.get('inconclusive'):
self.valueKind = 'inconclusive'
self.path = element.get('path')
if element.get('inconclusive'):
self.inconclusive = True
def setId(self, IdMap):
self.tokvalue = IdMap.get(self._tokvalueId)
@ -900,8 +709,8 @@ class Value:
self.symbolic = IdMap.get(self._symbolicId)
def __repr__(self):
attrs = ["intvalue", "tokvalue", "floatvalue", "movedvalue", "uninit",
"bufferSize", "containerSize", "condition", "valueKind"]
attrs = ["intvalue", "tokvalue", "floatvalue", "containerSize",
"condition", "valueKind", "inconclusive"]
return "{}({})".format(
"Value",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -987,7 +796,6 @@ class Configuration:
preprocessor_if_conditions List of preprocessor if conditions that was evaluated during preprocessing
tokenlist List of Token items
scopes List of Scope items
containers List of Container items
functions List of Function items
variables List of Variable items
valueflow List of ValueFlow values
@ -1000,7 +808,6 @@ class Configuration:
preprocessor_if_conditions = []
tokenlist = []
scopes = []
containers = []
functions = []
variables = []
typedefInfo = []
@ -1015,7 +822,6 @@ class Configuration:
self.preprocessor_if_conditions = []
self.tokenlist = []
self.scopes = []
self.containers = []
self.functions = []
self.variables = []
self.typedefInfo = []
@ -1038,8 +844,6 @@ class Configuration:
IdMap[token.Id] = token
for scope in self.scopes:
IdMap[scope.Id] = scope
for container in self.containers:
IdMap[container.Id] = container
for function in self.functions:
IdMap[function.Id] = function
for variable in self.variables:
@ -1052,8 +856,6 @@ class Configuration:
token.setId(IdMap)
for scope in self.scopes:
scope.setId(IdMap)
#for container in self.containers:
# container.setId(IdMap)
for function in self.functions:
function.setId(IdMap)
for variable in self.variables:
@ -1075,7 +877,7 @@ class Platform:
This class contains type sizes
Attributes:
name Name of the platform: unspecified/native/win32A/win32W/win64/unix32/unix64/platformFile
name Name of the platform
char_bit CHAR_BIT value
short_bit SHORT_BIT value
int_bit INT_BIT value
@ -1189,7 +991,7 @@ class CppcheckData:
self.rawTokens = []
self.platform = None
self.suppressions = []
self.files = [] # source files for elements occurred in this configuration
self.files = []
platform_done = False
rawtokens_done = False
@ -1269,6 +1071,7 @@ class CppcheckData:
'line': int(node.get('line')),
'column': int(node.get('column')),
'message': node.get('message')})
# Parse standards
elif node.tag == "standards" and event == 'start':
continue
@ -1282,6 +1085,7 @@ class CppcheckData:
# Parse directives list
elif node.tag == 'directive' and event == 'start':
cfg.directives.append(Directive(node))
# Parse macro usage
elif node.tag == 'macro' and event == 'start':
cfg.macro_usage.append(MacroUsage(node))
@ -1335,22 +1139,12 @@ class CppcheckData:
else:
cfg_arguments.append(var)
# Parse containers
elif node.tag == 'containers' and event == 'start':
continue
elif node.tag == 'container' and event == 'start':
cfg.containers.append(Container(node))
# Parse typedef info
elif node.tag == 'typedef-info':
iter_typedef_info = (event == 'start')
elif iter_typedef_info and node.tag == 'info' and event == 'start':
cfg.typedefInfo.append(TypedefInfo(node))
# Parse template-token
#elif node.tag == 'TokenAndName' and event == 'start': #todo add processing of containers
# cfg.containers.append(Container(node))
# Parse valueflows (list of values)
elif node.tag == 'valueflow' and event == 'start':
continue
@ -1486,6 +1280,7 @@ def get_files(args):
dump_files.append(f)
return dump_files, ctu_info_files
def simpleMatch(token, pattern):
for p in pattern.split(' '):
if not token or token.str != p:
@ -1493,93 +1288,6 @@ def simpleMatch(token, pattern):
token = token.next
return True
patterns = {
'%any%': lambda tok: tok,
'%assign%': lambda tok: tok if tok.isAssignmentOp else None,
'%comp%': lambda tok: tok if tok.isComparisonOp else None,
'%name%': lambda tok: tok if tok.isName else None,
'%op%': lambda tok: tok if tok.isOp else None,
'%or%': lambda tok: tok if tok.str == '|' else None,
'%oror%': lambda tok: tok if tok.str == '||' else None,
'%var%': lambda tok: tok if tok.variable else None,
'(*)': lambda tok: tok.link if tok.str == '(' else None,
'[*]': lambda tok: tok.link if tok.str == '[' else None,
'{*}': lambda tok: tok.link if tok.str == '{' else None,
'<*>': lambda tok: tok.link if tok.str == '<' and tok.link else None,
}
def match_atom(token, p):
if not token:
return None
if not p:
return None
if token.str == p:
return token
if p in ['!', '|', '||', '%', '!=', '*']:
return None
if p in patterns:
return patterns[p](token)
if '|' in p:
for x in p.split('|'):
t = match_atom(token, x)
if t:
return t
elif p.startswith('!!'):
t = match_atom(token, p[2:])
if not t:
return token
elif p.startswith('**'):
a = p[2:]
t = token
while t:
if match_atom(t, a):
return t
if t.link and t.str in ['(', '[', '<', '{']:
t = t.link
t = t.next
return None
class MatchResult:
def __init__(self, matches, bindings=None, keys=None):
self.__dict__.update(bindings or {})
self._matches = matches
self._keys = keys or []
def __bool__(self):
return self._matches
def __nonzero__(self):
return self._matches
def __getattr__(self, k):
if k in self._keys:
return None
else:
raise AttributeError
def bind_split(s):
if '@' in s:
p = s.partition('@')
return (p[0], p[2])
return (s, None)
def match(token, pattern):
if not pattern:
return MatchResult(False)
end = None
bindings = {}
words = [bind_split(word) for word in pattern.split()]
for p, b in words:
t = match_atom(token, p)
if b:
bindings[b] = token
if not t:
return MatchResult(False, keys=[xx for pp, xx in words]+['end'])
end = t
token = t.next
bindings['end'] = end
return MatchResult(True, bindings=bindings)
def get_function_call_name_args(token):
"""Get function name and arguments for function call
name, args = get_function_call_name_args(tok)
@ -1657,12 +1365,3 @@ def get_path_premium_addon():
if os.path.isfile(p1) and os.path.isfile(p2):
return p1
return None
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')

View File

@ -4,6 +4,7 @@
#
import cppcheck
import sys
@cppcheck.checker
def cast(cfg, data):

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3
#
# MISRA C 2012 checkers
# Partially reused for "MISRA C++ 2008" checking
#
# Example usage of this addon (scan a sourcefile main.cpp)
# cppcheck --dump main.cpp
@ -26,6 +25,7 @@ import argparse
import codecs
import string
import copy
import subprocess
try:
from itertools import izip as zip
@ -466,15 +466,9 @@ def getEssentialTypeCategory(expr):
return expr.valueType.sign
if expr.valueType and expr.valueType.typeScope and expr.valueType.typeScope.className:
return "enum<" + expr.valueType.typeScope.className + ">"
# Unwrap membership, dereferences and array indexing
vartok = expr
while True:
if simpleMatch(vartok, '[') or (vartok and vartok.str == '*' and vartok.astOperand2 is None):
vartok = vartok.astOperand1
elif simpleMatch(vartok, '.'):
vartok = vartok.astOperand2
else:
break
while simpleMatch(vartok, '[') or (vartok and vartok.str == '*' and vartok.astOperand2 is None):
vartok = vartok.astOperand1
if vartok and vartok.variable:
typeToken = vartok.variable.typeStartToken
while typeToken and typeToken.isName:
@ -495,13 +489,6 @@ def getEssentialTypeCategory(expr):
return 'char'
return expr.valueType.sign
if (expr.isCast and expr.str == "("):
castTok = expr.next
while castTok.isName or castTok.str == "*":
if castTok.str == 'char' and not castTok.isSigned and not castTok.isUnsigned:
return 'char'
castTok = castTok.next
if expr.valueType:
return expr.valueType.sign
return None
@ -647,8 +634,7 @@ def get_function_pointer_type(tok):
ret += '('
tok = tok.next.next
while tok and (tok.str not in '()'):
if tok.varId is None:
ret += ' ' + tok.str
ret += ' ' + tok.str
tok = tok.next
if (tok is None) or tok.str != ')':
return None
@ -714,28 +700,7 @@ def getForLoopExpressions(forToken):
lpar.astOperand2.astOperand2.astOperand2]
def get_function_scope(cfg, func):
if func:
for scope in cfg.scopes:
if scope.function == func:
return scope
return None
def is_variable_changed(start_token, end_token, var):
"""Check if variable is updated between body_start and body_end"""
tok = start_token
while tok != end_token:
if tok.isAssignmentOp:
vartok = tok.astOperand1
while vartok.astOperand1:
vartok = vartok.astOperand1
if vartok and vartok.variable == var:
return True
tok = tok.next
return False
def getForLoopCounterVariables(forToken, cfg):
def getForLoopCounterVariables(forToken):
""" Return a set of Variable objects defined in ``for`` statement and
satisfy requirements to loop counter term from section 8.14 of MISRA
document.
@ -746,7 +711,6 @@ def getForLoopCounterVariables(forToken, cfg):
if not tn or tn.str != '(':
return None
vars_defined = set()
vars_initialized = set()
vars_exit = set()
vars_modified = set()
cur_clause = 1
@ -758,50 +722,14 @@ def getForLoopCounterVariables(forToken, cfg):
elif cur_clause == 2:
vars_exit.add(tn.variable)
elif cur_clause == 3:
if tn.next and countSideEffectsRecursive(tn.next) > 0:
if tn.next and hasSideEffectsRecursive(tn.next):
vars_modified.add(tn.variable)
elif tn.previous and tn.previous.str in ('++', '--'):
tn_ast = tn.astParent
if tn_ast and tn_ast == tn.previous:
vars_modified.add(tn.variable)
elif tn_ast and tn_ast.str == '.' and tn_ast.astOperand2 and tn_ast.astOperand2.variable:
vars_modified.add(tn_ast.astOperand2.variable)
if cur_clause == 1 and tn.isAssignmentOp:
var_token = tn.astOperand1
while var_token and var_token.str == '.':
var_token = var_token.astOperand2
if var_token and var_token.variable:
vars_initialized.add(var_token.variable)
if cur_clause == 1 and tn.isName and tn.next.str == '(':
function_args_in_init = getArguments(tn.next)
function_scope = get_function_scope(cfg, tn.function)
for arg_nr in range(len(function_args_in_init)):
init_arg = function_args_in_init[arg_nr]
if init_arg is None or not init_arg.isUnaryOp('&'):
continue
var_token = init_arg.astOperand1
while var_token and var_token.str == '.':
var_token = var_token.astOperand2
if var_token is None or var_token.variable is None:
continue
changed = False
if function_scope is None:
changed = True
elif tn.function is None:
changed = True
else:
function_body_start = function_scope.bodyStart
function_body_end = function_scope.bodyEnd
args = tn.function.argument[arg_nr + 1]
if function_scope is None or is_variable_changed(function_body_start, function_body_end, args):
changed = True
if changed:
vars_initialized.add(var_token.variable)
vars_modified.add(tn.variable)
if tn.str == ';':
cur_clause += 1
tn = tn.next
return vars_defined | vars_initialized, vars_exit & vars_modified
return vars_defined & vars_exit & vars_modified
def findCounterTokens(cond):
@ -851,23 +779,23 @@ def isFloatCounterInWhileLoop(whileToken):
return False
def countSideEffectsRecursive(expr):
def hasSideEffectsRecursive(expr):
if not expr or expr.str == ';':
return 0
return False
if expr.str == '=' and expr.astOperand1 and expr.astOperand1.str == '[':
prev = expr.astOperand1.previous
if prev and (prev.str == '{' or prev.str == '{'):
return countSideEffectsRecursive(expr.astOperand2)
return hasSideEffectsRecursive(expr.astOperand2)
if expr.str == '=' and expr.astOperand1 and expr.astOperand1.str == '.':
e = expr.astOperand1
while e and e.str == '.' and e.astOperand2:
e = e.astOperand1
if e and e.str == '.':
return 0
return False
if expr.isAssignmentOp or expr.str in {'++', '--'}:
return 1
return True
# Todo: Check function calls
return countSideEffectsRecursive(expr.astOperand1) + countSideEffectsRecursive(expr.astOperand2)
return hasSideEffectsRecursive(expr.astOperand1) or hasSideEffectsRecursive(expr.astOperand2)
def isBoolExpression(expr):
@ -898,14 +826,6 @@ def isConstantExpression(expr):
return False
return True
def isUnknownConstantExpression(expr):
if expr.isName and not isEnumConstant(expr) and expr.variable is None:
return True
if expr.astOperand1 and isUnknownConstantExpression(expr.astOperand1):
return True
if expr.astOperand2 and isUnknownConstantExpression(expr.astOperand2):
return True
return False
def isUnsignedInt(expr):
return expr and expr.valueType and expr.valueType.type in ('short', 'int') and expr.valueType.sign == 'unsigned'
@ -1177,12 +1097,11 @@ def getAddonRules():
"""Returns dict of MISRA rules handled by this addon."""
addon_rules = []
compiled = re.compile(r'.*def[ ]+misra_([0-9]+)_([0-9]+)[(].*')
with open(__file__) as f:
for line in f:
res = compiled.match(line)
if res is None:
continue
addon_rules.append(res.group(1) + '.' + res.group(2))
for line in open(__file__):
res = compiled.match(line)
if res is None:
continue
addon_rules.append(res.group(1) + '.' + res.group(2))
return addon_rules
@ -1371,7 +1290,6 @@ class MisraChecker:
# by rule number (in hundreds).
# ie rule 1.2 becomes 102
self.ruleTexts = dict()
self.ruleText_filename = None
# Dictionary of dictionaries for rules to suppress
# Dict1 is keyed by rule number in the hundreds format of
@ -1440,8 +1358,6 @@ class MisraChecker:
for scope in cfg.scopes:
if scope.className is None:
continue
if scope.className.startswith('Anonymous'):
continue
if scope.type not in ('Struct', 'Enum'):
continue
used = False
@ -1529,15 +1445,6 @@ class MisraChecker:
cppcheckdata.reportSummary(dumpfile, 'MisraUsage', names)
def misra_1_2(self, cfg):
# gcc language extensions: https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
for token in cfg.tokenlist:
if simpleMatch(token, '? :'):
self.reportError(token, 1, 2)
elif simpleMatch(token, '( {') and simpleMatch(token.next.link.previous, '; } )'):
self.reportError(token, 1, 2)
def misra_1_4(self, cfg):
for token in cfg.tokenlist:
if token.str in ('_Atomic', '_Noreturn', '_Generic', '_Thread_local', '_Alignas', '_Alignof'):
@ -1632,19 +1539,10 @@ class MisraChecker:
def misra_3_1(self, rawTokens):
for token in rawTokens:
starts_with_double_slash = token.str.startswith('//')
starts_with_block_comment = token.str.startswith("/*")
s = token.str.lstrip('/')
if (starts_with_double_slash or starts_with_block_comment) and "/*" in s:
# Block comment inside of regular comment, violation
self.reportError(token, 3, 1)
elif starts_with_block_comment and "//" in s:
# "//" in block comment, check if it's a uri
while "//" in s:
possible_uri, s = s.split("//", 1)
if not re.search(r"\w+:$", possible_uri):
# Violation if no uri was found
self.reportError(token, 3, 1)
break
if token.str.startswith('/*') or starts_with_double_slash:
s = token.str.lstrip('/')
if ((not starts_with_double_slash) and '//' in s) or '/*' in s:
self.reportError(token, 3, 1)
def misra_3_2(self, rawTokens):
for token in rawTokens:
@ -1939,12 +1837,12 @@ class MisraChecker:
usedParameter = parametersUsed[i]
parameterDefinition = functionDeclaration.argument.get(i+1)
if usedParameter.isString and parameterDefinition and parameterDefinition.nameToken:
if usedParameter.isString and parameterDefinition.nameToken:
reportErrorIfVariableIsNotConst(parameterDefinition.nameToken, usedParameter)
def misra_8_1(self, cfg):
for token in cfg.tokenlist:
if token.isImplicitInt and not token.isUnsigned and not token.isSigned:
if token.isImplicitInt:
self.reportError(token, 8, 1)
def misra_8_2(self, data, rawTokens):
@ -1966,11 +1864,17 @@ class MisraChecker:
# Zero arguments should be in form ( void )
def checkZeroArguments(func, startCall, endCall):
if not startCall.isRemovedVoidParameter and len(func.argument) == 0:
if func.tokenDef.next:
self.reportError(func.tokenDef.next, 8, 2)
else:
self.reportError(func.tokenDef, 8, 2)
if (len(func.argument) == 0):
voidArg = startCall.next
while voidArg is not endCall:
if voidArg.str == 'void':
break
voidArg = voidArg.next
if not voidArg.str == 'void':
if func.tokenDef.next:
self.reportError(func.tokenDef.next, 8, 2)
else:
self.reportError(func.tokenDef, 8, 2)
def checkDeclarationArgumentsViolations(func, startCall, endCall):
# Collect the tokens for the arguments in function definition
@ -2305,7 +2209,7 @@ class MisraChecker:
if not token.astOperand1.valueType or not token.astOperand2.valueType:
continue
if ((token.astOperand1.str in op or token.astOperand1.isComparisonOp) and
(token.astOperand2.str in op or token.astOperand2.isComparisonOp)):
(token.astOperand2.str in op or token.astOperand1.isComparisonOp)):
e1, e2 = getEssentialCategorylist(token.astOperand1.astOperand2, token.astOperand2.astOperand1)
elif token.astOperand1.str in op or token.astOperand1.isComparisonOp:
e1, e2 = getEssentialCategorylist(token.astOperand1.astOperand2, token.astOperand2)
@ -2388,9 +2292,6 @@ class MisraChecker:
e = getEssentialType(token.astOperand2)
if not e:
continue
if e == "char" and vt1.type == "int":
# When arithmetic operations are performed on char values, they are usually promoted to int
continue
lhsbits = vt1.bits if vt1.bits else bitsOfEssentialType(vt1.type)
if lhsbits > bitsOfEssentialType(e):
self.reportError(token, 10, 6)
@ -2403,8 +2304,6 @@ class MisraChecker:
continue
if not token.isArithmeticalOp:
continue
if not is_composite_expr(token):
continue
parent = token.astParent
if parent is None:
continue
@ -2520,20 +2419,6 @@ class MisraChecker:
self.reportError(token, 11, 3)
def misra_11_4(self, data):
# Get list of macro definitions
macros = {}
for directive in data.directives:
#define X ((peripheral_t *)0x40000U)
res = re.match(r'#define ([A-Za-z0-9_]+).*', directive.str)
if res:
if res.group(1) in macros:
macros[res.group(1)].append(directive)
else:
macros[res.group(1)] = [directive]
# If macro definition is non-compliant then warn about the macro definition instead of
# the macro usages. To reduce diagnostics for a non-compliant macro.
bad_macros = []
for token in data.tokenlist:
if not isCast(token):
continue
@ -2544,17 +2429,6 @@ class MisraChecker:
if vt2.pointer > 0 and vt1.pointer == 0 and (vt1.isIntegral() or vt1.isEnum()) and vt2.type != 'void':
self.reportError(token, 11, 4)
elif vt1.pointer > 0 and vt2.pointer == 0 and (vt2.isIntegral() or vt2.isEnum()) and vt1.type != 'void':
if token.macroName is not None and \
token.macroName == token.astOperand1.macroName and \
token.astOperand1.isInt and \
token.link.previous.str == '*' and \
token.macroName == token.link.previous.macroName and \
token.macroName in macros and \
len(macros[token.macroName]) == 1:
if token.macroName not in bad_macros:
bad_macros.append(token.macroName)
self.reportError(macros[token.macroName][0], 11, 4)
continue
self.reportError(token, 11, 4)
def misra_11_5(self, data):
@ -2588,7 +2462,7 @@ class MisraChecker:
vt2 = token.astOperand1.valueType
if not vt1 or not vt2:
continue
if vt1.pointer == 1 and vt1.type == 'void' and vt2.pointer == 0 and token.astOperand1.getKnownIntValue() != 0:
if vt1.pointer == 1 and vt1.type == 'void' and vt2.pointer == 0 and token.astOperand1.str != "0":
self.reportError(token, 11, 6)
elif vt1.pointer == 0 and vt1.type != 'void' and vt2.pointer == 1 and vt2.type == 'void':
self.reportError(token, 11, 6)
@ -2819,8 +2693,6 @@ class MisraChecker:
continue
if not token.astParent:
continue
if (token.astOperand1 is None) or (token.astOperand2 is None):
continue
if token.astOperand1.str == '[' and token.astOperand1.previous.str in ('{', ','):
continue
if not (token.astParent.str in [',', ';', '{']):
@ -2828,12 +2700,12 @@ class MisraChecker:
def misra_13_5(self, data):
for token in data.tokenlist:
if token.isLogicalOp and countSideEffectsRecursive(token.astOperand2) > 0:
if token.isLogicalOp and hasSideEffectsRecursive(token.astOperand2):
self.reportError(token, 13, 5)
def misra_13_6(self, data):
for token in data.tokenlist:
if token.str == 'sizeof' and countSideEffectsRecursive(token.next) > 0:
if token.str == 'sizeof' and hasSideEffectsRecursive(token.next):
self.reportError(token, 13, 6)
def misra_14_1(self, data):
@ -2851,46 +2723,34 @@ class MisraChecker:
def misra_14_2(self, data):
for token in data.tokenlist:
if token.str == 'for':
expressions = getForLoopExpressions(token)
if not expressions:
continue
if expressions[0] and not expressions[0].isAssignmentOp:
if expressions[0].str != "(" or not expressions[0].previous.isName:
self.reportError(token, 14, 2)
if countSideEffectsRecursive(expressions[1]) > 0:
self.reportError(token, 14, 2)
if countSideEffectsRecursive(expressions[2]) > 1:
self.reportError(token, 14, 2)
expressions = getForLoopExpressions(token)
if not expressions:
continue
if expressions[0] and not expressions[0].isAssignmentOp:
self.reportError(token, 14, 2)
elif hasSideEffectsRecursive(expressions[1]):
self.reportError(token, 14, 2)
counter_vars_first_clause, counter_vars_exit_modified = getForLoopCounterVariables(token, data)
if len(counter_vars_exit_modified) == 0:
# if it's not possible to identify a loop counter, all 3 clauses must be empty
for idx in range(len(expressions)):
if expressions[idx]:
self.reportError(token, 14, 2)
break
elif len(counter_vars_exit_modified) > 1:
# there shall be a single loop counter
self.reportError(token, 14, 2)
else: # len(counter_vars_exit_modified) == 1:
loop_counter = counter_vars_exit_modified.pop()
# if the first clause is not empty, then it shall (declare and) initialize the loop counter
if expressions[0] is not None and loop_counter not in counter_vars_first_clause:
self.reportError(token, 14, 2)
# Inspect modification of loop counter in loop body
body_scope = token.next.link.next.scope
if not body_scope:
continue
tn = body_scope.bodyStart
while tn and tn != body_scope.bodyEnd:
if tn.variable == loop_counter:
if tn.next:
# TODO: Check modifications in function calls
if countSideEffectsRecursive(tn.next) > 0:
self.reportError(tn, 14, 2)
tn = tn.next
# Inspect modification of loop counter in loop body
counter_vars = getForLoopCounterVariables(token)
outer_scope = token.scope
body_scope = None
tn = token.next
while tn and tn.next != outer_scope.bodyEnd:
if tn.scope and tn.scope.nestedIn == outer_scope:
body_scope = tn.scope
break
tn = tn.next
if not body_scope:
continue
tn = body_scope.bodyStart
while tn and tn != body_scope.bodyEnd:
if tn.variable and tn.variable in counter_vars:
if tn.next:
# TODO: Check modifications in function calls
if hasSideEffectsRecursive(tn.next):
self.reportError(tn, 14, 2)
tn = tn.next
def misra_14_4(self, data):
for token in data.tokenlist:
@ -2898,9 +2758,7 @@ class MisraChecker:
continue
if not token.astOperand1 or not (token.astOperand1.str in ['if', 'while']):
continue
if isBoolExpression(token.astOperand2):
continue
if token.astOperand2.valueType:
if not isBoolExpression(token.astOperand2):
self.reportError(token, 14, 4)
def misra_15_1(self, data):
@ -3280,72 +3138,6 @@ class MisraChecker:
for w in cfg.clang_warnings:
if w['message'].endswith('[-Wimplicit-function-declaration]'):
self.reportError(cppcheckdata.Location(w), 17, 3)
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
def misra_config(self, data):
for var in data.variables:
if not var.isArray or var.nameToken is None or not cppcheckdata.simpleMatch(var.nameToken.next, '['):
continue
tok = var.nameToken.next
while tok.str == '[':
sz = tok.astOperand2
if sz and sz.getKnownIntValue() is None:
has_var = False
unknown_constant = False
tokens = [sz]
while len(tokens) > 0:
t = tokens[-1]
tokens = tokens[:-1]
if t:
if t.isName and t.getKnownIntValue() is None:
if t.varId or t.variable:
has_var = True
continue
unknown_constant = True
self.report_config_error(tok, 'Unknown constant {}, please review configuration'.format(t.str))
if t.isArithmeticalOp:
tokens += [t.astOperand1, t.astOperand2]
if not unknown_constant and not has_var:
self.report_config_error(tok, 'Unknown array size, please review configuration')
tok = tok.link.next
for token in data.tokenlist:
if token.str not in ("while", "if"):
continue
tok = token.next
if token is None or tok.str != "(":
continue
end_token = tok.link
while tok != end_token:
tok = tok.next
if tok.str == "(" and tok.isCast:
tok = tok.link
continue
if not tok.isName:
continue
if tok.function or tok.variable or tok.varId or tok.valueType:
continue
if tok.next.str == "(" or tok.str in ["EOF"]:
continue
if isKeyword(tok.str) or isStdLibId(tok.str):
continue
if tok.astParent is None:
continue
if tok.astParent.str == "." and tok.astParent.valueType:
continue
self.report_config_error(tok, "Variable '%s' is unknown" % tok.str)
def misra_17_6(self, rawTokens):
for token in rawTokens:
@ -3358,9 +3150,7 @@ class MisraChecker:
continue
if token.str != '(' or token.astParent:
continue
if token.astOperand1 is None or not token.astOperand1.isName:
continue
if token.astOperand1.varId and (token.astOperand1.variable is None or get_function_pointer_type(token.astOperand1.variable.typeStartToken) is None):
if not token.previous.isName or token.previous.varId:
continue
if token.valueType is None:
continue
@ -3417,10 +3207,7 @@ class MisraChecker:
if token.str == '{':
token = token.link
# skip function pointer parameter types
if token.astOperand1 is None:
pass
elif cppcheckdata.simpleMatch(token, "[ ]"):
if cppcheckdata.simpleMatch(token, "[ ]"):
self.reportError(token, 18, 7)
break
token = token.next
@ -3436,7 +3223,7 @@ class MisraChecker:
# Unknown define or syntax error
if not typetok.astOperand2:
continue
if not isConstantExpression(typetok.astOperand2) and not isUnknownConstantExpression(typetok.astOperand2):
if not isConstantExpression(typetok.astOperand2):
self.reportError(var.nameToken, 18, 8)
def misra_19_2(self, data):
@ -4019,8 +3806,8 @@ class MisraChecker:
def misra_22_10(self, cfg):
last_function_call = None
for token in cfg.tokenlist:
if token.isName and token.next.str == '(' and not simpleMatch(token.next.link, ') {'):
name, args = cppcheckdata.get_function_call_name_args(token)
if token.str == '(' and not simpleMatch(token.link, ') {'):
name, args = cppcheckdata.get_function_call_name_args(token.previous)
last_function_call = name
if token.str == '}':
last_function_call = None
@ -4256,14 +4043,6 @@ class MisraChecker:
self.addSuppressedRule(ruleNum)
def report_config_error(self, location, errmsg):
cppcheck_severity = 'error'
error_id = 'config'
if self.settings.verify:
self.verify_actual.append('%s:%d %s' % (location.file, location.linenr, error_id))
else:
cppcheckdata.reportError(location, cppcheck_severity, errmsg, 'misra', error_id)
def reportError(self, location, num1, num2):
ruleNum = num1 * 100 + num2
@ -4287,15 +4066,13 @@ class MisraChecker:
misra_severity = self.ruleTexts[ruleNum].misra_severity
cppcheck_severity = self.ruleTexts[ruleNum].cppcheck_severity
elif len(self.ruleTexts) == 0:
if self.ruleText_filename is None:
errmsg = 'misra violation (use --rule-texts=<file> to get proper output)'
else:
errmsg = 'misra violation (rule-texts-file not found: ' + self.ruleText_filename + ')'
if self.path_premium_addon:
for line in cppcheckdata.cmd_output([self.path_premium_addon, '--cli', '--get-rule-text=' + errorId]).split('\n'):
if len(line) > 1 and not line.startswith('{'):
errmsg = line.strip()
break
errmsg = ''
for line in subprocess.check_output([self.path_premium_addon, '--cli', '--get-rule-text=' + errorId]).strip().decode('ascii').split('\n'):
if not line.startswith('{'):
errmsg = line
else:
errmsg = 'misra violation (use --rule-texts=<file> to get proper output)'
else:
errmsg = 'misra violation %s with no text in the supplied rule-texts-file' % (ruleNum)
@ -4306,7 +4083,7 @@ class MisraChecker:
# If this is new violation then record it and show it. If not then
# skip it since it has already been displayed.
if this_violation not in self.existing_violations:
if not this_violation in self.existing_violations:
self.existing_violations.add(this_violation)
cppcheckdata.reportError(location, cppcheck_severity, errmsg, 'misra', errorId, misra_severity)
@ -4334,7 +4111,6 @@ class MisraChecker:
file_stream.readlines()
file_stream.seek(0)
except UnicodeDecodeError:
file_stream.close()
file_stream = None
else:
break
@ -4414,8 +4190,6 @@ class MisraChecker:
self.ruleTexts[rule.num] = rule
expect_more = True
file_stream.close()
def verifyRuleTexts(self):
"""Prints rule numbers without rule text."""
rule_texts_rules = []
@ -4443,31 +4217,19 @@ class MisraChecker:
:param args: Check function arguments
"""
if not self.isRuleGloballySuppressed(rule_num):
misra_cpp = (
202, # misra-c2012-2.3 : misra c++2008 0-1-9
203, # misra-c2012-2.3 : misra c++2008 0-1-5
402, # misra-c2012-4.2 : misra c++2008 2-3-1
701, # misra-c2012-7.1 : misra c++2008 2-3-1
702, # misra-c2012-7.2 : misra c++2008 2-13-2
1203, # misra-c2012-12.3 : misra c++2008 5-14-1
1204, # misra-c2012-12.4 : misra c++2008 5-18-1
1305, # misra-c2012-13.5 : misra c++2008 5-19-1
1702, # misra-c2012-17.2 : misra c++2008 7-5-4
1901) # misra-c2012-19.1 : misra c++2008 2-13-3
check_function(*args)
if (not self.is_cpp) or rule_num in misra_cpp:
check_function(*args)
def parseDump(self, dumpfile, path_premium_addon=None):
def parseDump(self, dumpfile):
def fillVerifyExpected(verify_expected, tok):
"""Add expected suppressions to verify_expected list."""
rule_re = re.compile(r'[0-9]+\.[0-9]+')
if tok.str.startswith('//') and 'TODO' not in tok.str:
for word in tok.str[2:].split(' '):
if rule_re.match(word) or word == "config":
if rule_re.match(word):
verify_expected.append('%s:%d %s' % (tok.file, tok.linenr, word))
data = cppcheckdata.parsedump(dumpfile)
typeBits['CHAR'] = data.platform.char_bit
typeBits['SHORT'] = data.platform.short_bit
typeBits['INT'] = data.platform.int_bit
@ -4496,15 +4258,11 @@ class MisraChecker:
else:
self.printStatus('Checking ' + dumpfile + '...')
self.is_cpp = data.files and data.files[0].endswith('.cpp')
for cfgNumber, cfg in enumerate(data.iterconfigurations()):
if not self.settings.quiet:
self.printStatus('Checking %s, config %s...' % (dumpfile, cfg.name))
self.executeCheck(102, self.misra_1_2, cfg)
if not path_premium_addon:
self.executeCheck(104, self.misra_1_4, cfg)
self.executeCheck(104, self.misra_1_4, cfg)
self.executeCheck(202, self.misra_2_2, cfg)
self.executeCheck(203, self.misra_2_3, dumpfile, cfg.typedefInfo)
self.executeCheck(204, self.misra_2_4, dumpfile, cfg)
@ -4551,15 +4309,14 @@ class MisraChecker:
self.executeCheck(904, self.misra_9_4, cfg)
if cfgNumber == 0:
self.executeCheck(905, self.misra_9_5, cfg, data.rawTokens)
if not path_premium_addon:
self.executeCheck(1001, self.misra_10_1, cfg)
self.executeCheck(1002, self.misra_10_2, cfg)
self.executeCheck(1003, self.misra_10_3, cfg)
self.executeCheck(1004, self.misra_10_4, cfg)
self.executeCheck(1005, self.misra_10_5, cfg)
self.executeCheck(1006, self.misra_10_6, cfg)
self.executeCheck(1007, self.misra_10_7, cfg)
self.executeCheck(1008, self.misra_10_8, cfg)
self.executeCheck(1001, self.misra_10_1, cfg)
self.executeCheck(1002, self.misra_10_2, cfg)
self.executeCheck(1003, self.misra_10_3, cfg)
self.executeCheck(1004, self.misra_10_4, cfg)
self.executeCheck(1005, self.misra_10_5, cfg)
self.executeCheck(1006, self.misra_10_6, cfg)
self.executeCheck(1007, self.misra_10_7, cfg)
self.executeCheck(1008, self.misra_10_8, cfg)
self.executeCheck(1101, self.misra_11_1, cfg)
self.executeCheck(1102, self.misra_11_2, cfg)
self.executeCheck(1103, self.misra_11_3, cfg)
@ -4602,7 +4359,6 @@ class MisraChecker:
self.executeCheck(1701, self.misra_17_1, cfg)
self.executeCheck(1702, self.misra_17_2, cfg)
self.executeCheck(1703, self.misra_17_3, cfg)
self.misra_config(cfg)
if cfgNumber == 0:
self.executeCheck(1706, self.misra_17_6, data.rawTokens)
self.executeCheck(1707, self.misra_17_7, cfg)
@ -4650,23 +4406,14 @@ class MisraChecker:
self.executeCheck(2209, self.misra_22_9, cfg)
self.executeCheck(2210, self.misra_22_10, cfg)
def read_ctu_info_line(self, line):
if not line.startswith('{'):
return None
try:
ctu_info = json.loads(line)
except json.decoder.JSONDecodeError:
return None
if 'summary' not in ctu_info:
return None
if 'data' not in ctu_info:
return None
return ctu_info
# Premium MISRA checking, deep analysis
if cfgNumber == 0 and self.path_premium_addon:
subprocess.check_output([self.path_premium_addon, '--cli', '--misra', dumpfile])
def analyse_ctu_info(self, ctu_info_files):
all_typedef_info = {}
all_tagname_info = {}
all_macro_info = {}
all_typedef_info = []
all_tagname_info = []
all_macro_info = []
all_external_identifiers_decl = {}
all_external_identifiers_def = {}
all_internal_identifiers = {}
@ -4678,104 +4425,104 @@ class MisraChecker:
def is_different_location(loc1, loc2):
return loc1['file'] != loc2['file'] or loc1['line'] != loc2['line']
def is_different_file(loc1, loc2):
return loc1['file'] != loc2['file']
for filename in ctu_info_files:
for line in open(filename, 'rt'):
if not line.startswith('{'):
continue
try:
for filename in ctu_info_files:
for line in open(filename, 'rt'):
s = self.read_ctu_info_line(line)
if s is None:
continue
summary_type = s.get('summary', '')
summary_data = s.get('data', None)
s = json.loads(line)
summary_type = s['summary']
summary_data = s['data']
if summary_type == 'MisraTypedefInfo':
for new_typedef_info in summary_data:
key = new_typedef_info['name']
existing_typedef_info = all_typedef_info.get(key, None)
if existing_typedef_info:
if is_different_location(existing_typedef_info, new_typedef_info):
self.reportError(Location(existing_typedef_info), 5, 6)
if summary_type == 'MisraTypedefInfo':
for new_typedef_info in summary_data:
found = False
for old_typedef_info in all_typedef_info:
if old_typedef_info['name'] == new_typedef_info['name']:
found = True
if is_different_location(old_typedef_info, new_typedef_info):
self.reportError(Location(old_typedef_info), 5, 6)
self.reportError(Location(new_typedef_info), 5, 6)
else:
existing_typedef_info['used'] = existing_typedef_info['used'] or new_typedef_info['used']
else:
all_typedef_info[key] = new_typedef_info
if new_typedef_info['used']:
old_typedef_info['used'] = True
break
if not found:
all_typedef_info.append(new_typedef_info)
if summary_type == 'MisraTagName':
for new_tagname_info in summary_data:
key = new_tagname_info['name']
existing_tagname_info = all_tagname_info.get(key, None)
if existing_tagname_info:
if is_different_location(existing_tagname_info, new_tagname_info):
self.reportError(Location(existing_tagname_info), 5, 7)
if summary_type == 'MisraTagName':
for new_tagname_info in summary_data:
found = False
for old_tagname_info in all_tagname_info:
if old_tagname_info['name'] == new_tagname_info['name']:
found = True
if is_different_location(old_tagname_info, new_tagname_info):
self.reportError(Location(old_tagname_info), 5, 7)
self.reportError(Location(new_tagname_info), 5, 7)
else:
existing_tagname_info['used'] = existing_tagname_info['used'] or new_tagname_info['used']
else:
all_tagname_info[key] = new_tagname_info
if new_tagname_info['used']:
old_tagname_info['used'] = True
break
if not found:
all_tagname_info.append(new_tagname_info)
if summary_type == 'MisraMacro':
for new_macro in summary_data:
key = new_macro['name']
existing_macro = all_macro_info.get(key, None)
if existing_macro:
existing_macro['used'] = existing_macro['used'] or new_macro['used']
else:
all_macro_info[key] = new_macro
if summary_type == 'MisraMacro':
for new_macro in summary_data:
found = False
for old_macro in all_macro_info:
if old_macro['name'] == new_macro['name']:
found = True
if new_macro['used']:
old_macro['used'] = True
break
if not found:
all_macro_info.append(new_macro)
if summary_type == 'MisraExternalIdentifiers':
for s in sorted(summary_data, key=lambda d: "%s %s %s" %(d['file'],d['line'], d['column'] )):
is_declaration = s['decl']
if is_declaration:
all_external_identifiers = all_external_identifiers_decl
else:
all_external_identifiers = all_external_identifiers_def
if summary_type == 'MisraExternalIdentifiers':
for s in summary_data:
is_declaration = s['decl']
if is_declaration:
all_external_identifiers = all_external_identifiers_decl
else:
all_external_identifiers = all_external_identifiers_def
name = s['name']
if name in all_external_identifiers:
if is_declaration and is_different_location(s, all_external_identifiers[name]):
self.reportError(Location(s), 8, 5)
self.reportError(Location(all_external_identifiers[name]), 8, 5)
elif is_different_file(s, all_external_identifiers[name]):
self.reportError(Location(s), 8, 6)
self.reportError(Location(all_external_identifiers[name]), 8, 6)
all_external_identifiers[name] = s
name = s['name']
if name in all_external_identifiers and is_different_location(s, all_external_identifiers[name]):
num = 5 if is_declaration else 6
self.reportError(Location(s), 8, num)
self.reportError(Location(all_external_identifiers[name]), 8, num)
all_external_identifiers[name] = s
if summary_type == 'MisraInternalIdentifiers':
for s in summary_data:
if s['name'] in all_internal_identifiers:
if not s['inlinefunc'] or s['file'] != all_internal_identifiers[s['name']]['file']:
self.reportError(Location(s), 5, 9)
self.reportError(Location(all_internal_identifiers[s['name']]), 5, 9)
all_internal_identifiers[s['name']] = s
if summary_type == 'MisraInternalIdentifiers':
for s in summary_data:
if s['name'] in all_internal_identifiers:
if not s['inlinefunc'] or s['file'] != all_internal_identifiers[s['name']]['file']:
self.reportError(Location(s), 5, 9)
self.reportError(Location(all_internal_identifiers[s['name']]), 5, 9)
all_internal_identifiers[s['name']] = s
if summary_type == 'MisraLocalIdentifiers':
for s in summary_data:
all_local_identifiers[s['name']] = s
if summary_type == 'MisraLocalIdentifiers':
for s in summary_data:
all_local_identifiers[s['name']] = s
if summary_type == 'MisraUsage':
for s in summary_data:
if s['name'] in all_usage_files:
all_usage_files[s['name']].append(s['file'])
else:
all_usage_files[s['name']] = [s['file']]
if summary_type == 'MisraUsage':
for s in summary_data:
if s['name'] in all_usage_files:
all_usage_files[s['name']].append(s['file'])
else:
all_usage_files[s['name']] = [s['file']]
except FileNotFoundError:
return
for ti in all_typedef_info:
if not ti['used']:
self.reportError(Location(ti), 2, 3)
unused_typedefs = [tdi for tdi in all_typedef_info.values() if not tdi['used']]
for tdi in unused_typedefs:
self.reportError(Location(tdi), 2, 3)
for ti in all_tagname_info:
if not ti['used']:
self.reportError(Location(ti), 2, 4)
unused_tags = [tag for tag in all_tagname_info.values() if not tag['used']]
for tag in unused_tags:
self.reportError(Location(tag), 2, 4)
unused_macros = [m for m in all_macro_info.values() if not m['used']]
for m in unused_macros:
self.reportError(Location(m), 2, 5)
for m in all_macro_info:
if not m['used']:
self.reportError(Location(m), 2, 5)
all_external_identifiers = all_external_identifiers_decl
all_external_identifiers.update(all_external_identifiers_def)
@ -4868,17 +4615,13 @@ def main():
if args.rule_texts:
filename = os.path.expanduser(args.rule_texts)
filename = os.path.normpath(filename)
checker.ruleText_filename = filename
if os.path.isfile(filename):
checker.loadRuleTexts(filename)
if args.verify_rule_texts:
checker.verifyRuleTexts()
sys.exit(0)
else:
if args.verify_rule_texts:
print('Fatal error: file is not found: ' + filename)
sys.exit(1)
if not os.path.isfile(filename):
print('Fatal error: file is not found: ' + filename)
sys.exit(1)
checker.loadRuleTexts(filename)
if args.verify_rule_texts:
checker.verifyRuleTexts()
sys.exit(0)
if args.verify_rule_texts and not args.rule_texts:
print("Error: Please specify rule texts file with --rule-texts=<file>")
@ -4901,7 +4644,7 @@ def main():
checker.setSeverity(args.severity)
for item in dump_files:
checker.parseDump(item,checker.path_premium_addon)
checker.parseDump(item)
if settings.verify:
verify_expected = checker.get_verify_expected()
@ -4926,6 +4669,14 @@ def main():
checker.analyse_ctu_info(ctu_info_files)
if args.file_list and checker.path_premium_addon:
premium_command = [checker.path_premium_addon, '--misra', '--file-list', args.file_list]
if args.cli:
premium_command.append('--cli')
for line in subprocess.check_output(premium_command).decode('ascii').split('\n'):
if re.search(r'"errorId".*:.*"misra-', line) is not None:
print(line.strip())
if settings.verify:
sys.exit(exitCode)
@ -4941,7 +4692,7 @@ def main():
for misra_id in ids:
rules_violated[misra_id] = rules_violated.get(misra_id, 0) + 1
print("MISRA rules violated:")
convert = lambda text: int(text) if text.isdigit() else 0
convert = lambda text: int(text) if text.isdigit() else text
misra_sort = lambda key: [convert(c) for c in re.split(r'[\.-]([0-9]*)', key)]
for misra_id in sorted(rules_violated.keys(), key=misra_sort):
res = re.match(r'misra-c2012-([0-9]+)\\.([0-9]+)', misra_id)

View File

@ -1,5 +1,3 @@
import cppcheckdata
# Holds information about an array, struct or union's element definition.
class ElementDef:
def __init__(self, elementType, name, valueType, dimensions = None):
@ -32,7 +30,7 @@ class ElementDef:
attrs = ["childIndex", "elementType", "valueType"]
return "{}({}, {}, {})".format(
"ElementDef",
"ED",
self.getLongName(),
inits,
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -88,7 +86,7 @@ class ElementDef:
def getChildByIndex(self, index):
if self.isFlexible:
while len(self.children) <= index:
createChild(self, self.flexibleToken, len(self.children), None)
createChild(self, self.flexibleToken, len(self.children))
return self.children[index] if 0 <= index < len(self.children) else None
def getChildByName(self, name):
@ -255,16 +253,6 @@ class InitializerParser:
isFirstElement = False
isDesignated = True
elif self.token.isString and self.ed and self.ed.isArray:
self.ed.setInitialized(isDesignated)
if self.token == self.token.astParent.astOperand1 and self.token.astParent.astOperand2:
self.token = self.token.astParent.astOperand2
self.ed.markAsCurrent()
self.ed = self.root.getNextChild()
else:
self.unwindAndContinue()
continue
elif self.token.str == '{':
nextChild = self.root.getNextChild() if self.root is not None else None
@ -293,7 +281,7 @@ class InitializerParser:
# Fake dummy as nextChild (of current root)
nextChild = dummyRoot
if nextChild and self.token.astOperand1:
if self.token.astOperand1:
self.root = nextChild
self.token = self.token.astOperand1
isFirstElement = True
@ -326,9 +314,8 @@ class InitializerParser:
else:
self.ed.parent.setInitialized(isDesignated)
self.ed.parent.initializeChildren()
else:
if self.root is not None and self.ed.parent != self.root:
if self.ed.parent != self.root:
# Check if token is correct value type for self.root.children[?]
child = self.root.getChildByValueElement(self.ed)
if self.token.valueType:
@ -346,8 +333,6 @@ class InitializerParser:
parent = parent.parent
isDesignated = False
if self.token.isString and self.ed.parent.isArray:
self.ed = self.ed.parent
self.unwindAndContinue()
def pushToRootStackAndMarkAsDesignated(self):
@ -396,11 +381,10 @@ class InitializerParser:
break
def misra_9_x(self, data, rule, rawTokens = None):
parser = InitializerParser()
for variable in data.variables:
if variable.nameToken is None:
if not variable.nameToken:
continue
nameToken = variable.nameToken
@ -426,18 +410,12 @@ def misra_9_x(self, data, rule, rawTokens = None):
# without it.
if ed.valueType is None and not variable.isArray:
continue
parser.parseInitializer(ed, eq.astOperand2)
# print(rule, nameToken.str + '=', ed.getInitDump())
if rule == 902 and not ed.isMisra92Compliant():
self.reportError(nameToken, 9, 2)
if rule == 903 and not ed.isMisra93Compliant():
# Do not check when variable is pointer type
type_token = variable.nameToken
while type_token and type_token.isName:
type_token = type_token.previous
if type_token and type_token.str == '*':
continue
self.reportError(nameToken, 9, 3)
if rule == 904 and not ed.isMisra94Compliant():
self.reportError(nameToken, 9, 4)
@ -447,16 +425,16 @@ def misra_9_x(self, data, rule, rawTokens = None):
def getElementDef(nameToken, rawTokens = None):
if nameToken.variable.isArray:
ed = ElementDef("array", nameToken.str, nameToken.valueType)
createArrayChildrenDefs(ed, nameToken.astParent, nameToken.variable, rawTokens)
createArrayChildrenDefs(ed, nameToken.astParent, rawTokens)
elif nameToken.variable.isClass:
ed = ElementDef("record", nameToken.str, nameToken.valueType)
createRecordChildrenDefs(ed, nameToken.variable)
createRecordChildrenDefs(ed)
else:
ed = ElementDef("value", nameToken.str, nameToken.valueType)
return ed
def createArrayChildrenDefs(ed, token, var, rawTokens = None):
if token and token.str == '[':
def createArrayChildrenDefs(ed, token, rawTokens = None):
if token.str == '[':
if rawTokens is not None:
foundToken = next((rawToken for rawToken in rawTokens
if rawToken.file == token.file
@ -469,60 +447,32 @@ def createArrayChildrenDefs(ed, token, var, rawTokens = None):
if (token.astOperand2 is not None) and (token.astOperand2.getKnownIntValue() is not None):
for i in range(token.astOperand2.getKnownIntValue()):
createChild(ed, token, i, var)
createChild(ed, token, i)
else:
ed.markAsFlexibleArray(token)
def createChild(ed, token, name, var):
def createChild(ed, token, name):
if token.astParent and token.astParent.str == '[':
child = ElementDef("array", name, ed.valueType)
createArrayChildrenDefs(child, token.astParent, var)
createArrayChildrenDefs(child, token.astParent)
else:
if ed.valueType and ed.valueType.type == "record":
child = ElementDef("record", name, ed.valueType)
createRecordChildrenDefs(child, var)
createRecordChildrenDefs(child)
else:
child = ElementDef("value", name, ed.valueType)
ed.addChild(child)
def createRecordChildrenDefs(ed, var):
def createRecordChildrenDefs(ed):
valueType = ed.valueType
if not valueType or not valueType.typeScope:
return
if var is None:
return
typeToken = var.typeEndToken
while typeToken and typeToken.isName:
typeToken = typeToken.previous
if typeToken and typeToken.str == '*':
child = ElementDef("pointer", var.nameToken, var.nameToken.valueType)
ed.addChild(child)
return
child_dict = {}
for variable in valueType.typeScope.varlist:
if variable is var:
continue
child = getElementDef(variable.nameToken)
child_dict[variable.nameToken] = child
for scopes in valueType.typeScope.nestedList:
varscope = False
if scopes.nestedIn == valueType.typeScope:
for variable in valueType.typeScope.varlist:
if variable.nameToken and variable.nameToken.valueType and variable.nameToken.valueType.typeScope == scopes:
varscope = True
break
if not varscope:
ed1 = ElementDef("record", scopes.Id, valueType)
for variable in scopes.varlist:
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))
for _key in sorted_keys:
ed.addChild(child_dict[_key])
for variable in valueType.typeScope.varlist:
child = getElementDef(variable.nameToken)
ed.addChild(child)
def getElementByDesignator(ed, token):
if not token.str in [ '.', '[' ]:

View File

@ -81,7 +81,7 @@ for arg in sys.argv[1:]:
for scope in cfg.scopes:
if scope.type == 'Function':
function = scope.function
if function is not None and function.type in ('Constructor', 'Destructor', 'CopyConstructor', 'MoveConstructor'):
if function is not None and function.type in ('Constructor', 'Destructor'):
continue
res = re.match(RE_FUNCTIONNAME, scope.className)
if not res:

View File

@ -182,7 +182,7 @@ def process(dumpfiles, configfile, debugprint=False):
if "RE_FUNCTIONNAME" in conf and conf["RE_FUNCTIONNAME"]:
for token in cfg.tokenlist:
if token.function:
if token.function.type in ('Constructor', 'Destructor', 'CopyConstructor', 'MoveConstructor'):
if token.function.type == 'Constructor' or token.function.type == 'Destructor':
continue
retval = token.previous.str
prev = token.previous

View File

@ -1,10 +0,0 @@
struct S {
uint32_t some[100];
};
void foo( void )
{
if (((S *)0x8000)->some[0] != 0U) { }
}

View File

@ -1,8 +0,0 @@
struct expression {
int nargs;
struct expression *args[3];
};
struct expression plvar = {0};

View File

@ -1,12 +0,0 @@
//#12267
extern uint32_t end;
//#define KEEP // if uncomment this then wont crash
KEEP static const int32_t ptr_to_end = &end;
void foo(void)
{
(void)ptr_to_end;
}

View File

@ -1,9 +0,0 @@
// #11793
typedef struct pfmlib_pmu {
int flags ;
int (*get_event_encoding[10])(void* this, pfmlib_event_desc_t* e);
} pfmlib_pmu_t ;
pfmlib_pmu_t sparc_ultra3_support = { .flags = 0 };

View File

@ -1,30 +0,0 @@
/* This is the representation of the expressions to determine the
plural form. */
struct expression
{
int nargs; /* Number of arguments. */
union
{
unsigned long int num; /* Number value for `num'. */
struct expression *args[3]; /* Up to three arguments. */
} val;
};
struct expression GERMANIC_PLURAL =
{
.nargs = 2,
.val =
{
.args =
{
[0] = (struct expression *) &plvar,
[1] = (struct expression *) &plone
}
}
};

View File

@ -1,11 +0,0 @@
struct ConDesDesc {
unsigned Order;
unsigned Import;
};
// cppcheck-suppress misra-config
static ConDesDesc ConDes[CD_TYPE_COUNT] = {
{ 0, 0 },
{ 0, 0 },
};

View File

@ -1,23 +0,0 @@
struct _boardcnf_ch {
// cppcheck-suppress misra-config
uint8_t ddr_density[CS_CNT];
uint64_t ca_swap;
};
struct _boardcnf {
uint16_t dqdm_dly_r;
// cppcheck-suppress misra-config
struct _boardcnf_ch ch[DRAM_CH_CNT];
};
static const struct _boardcnf boardcnfs[1] = {
{
0x0a0,
{
{ {0x02, 0x02}, 0x00345201 },
{ {0x02, 0x02}, 0x00302154 }
}
},
};

View File

@ -1,17 +0,0 @@
typedef struct _tGames
{
char magicdirname[10];
unsigned int expectedmask;
unsigned char pictureorder[3];
} tGames;
static const tGames games[1]={
{"Pawn", 1, {0,1,2}}
};

View File

@ -1,8 +0,0 @@
static const struct id3_frametype wordlist[] =
{
{0, "Encryption method registration"},
{1, "Popularimeter"},
};

View File

@ -1,10 +0,0 @@
struct three_d_filter_t {
char name[16];
double elem[2];
};
static three_d_filter_t base_filters[] = {
{"Identity", { 1.0, 0.0 } },
{"Echo", { 0.4, 0.0 } }
};

View File

@ -1,3 +0,0 @@
#line 3 "<stdout>"
typedef int8_t flex_int8_t;

View File

@ -1,18 +0,0 @@
union {
struct {
uint8_t a;
uint8_t b;
} a;
} bar;
struct foo {
uint8_t a;
union bar w;
uint8_t b;
};
struct foo asdf = {
0,
{{0,0}},
1
};

View File

@ -1,5 +1,5 @@
// Test with command:
// ./cppcheck --enable=information --enable=style --addon=misra --inline-suppr addons/test/misra/misra-ctu-*-test.c
// ./cppcheck --enable=information --addon=misra --inline-suppr addons/test/misra/misra-ctu-*-test.c
#include "misra-ctu-test.h"
@ -13,16 +13,10 @@ typedef int MISRA_5_6_VIOLATION;
// cppcheck-suppress misra-c2012-5.7
struct misra_5_7_violation_t {
int x; // cppcheck-suppress unusedStructMember
int x;
};
static misra_5_7_violation_t misra_5_7_use_type_1;
// #11443 - FP
static struct
{ // no warning
uint16_t x; // cppcheck-suppress unusedStructMember
} misra_5_7_false_positive_1;
// cppcheck-suppress misra-c2012-8.4
// cppcheck-suppress misra-c2012-5.8
int misra_5_8_var1;

View File

@ -1,5 +1,5 @@
// Test with command:
// ./cppcheck --enable=information --enable=style --addon=misra --inline-suppr addons/test/misra/misra-ctu-*-test.c
// ./cppcheck --enable=information --addon=misra --inline-suppr addons/test/misra/misra-ctu-*-test.c
#include "misra-ctu-test.h"
@ -13,22 +13,16 @@ static MISRA_5_6_VIOLATION misra_5_6_x;
// cppcheck-suppress misra-c2012-5.7
struct misra_5_7_violation_t {
int x; // cppcheck-suppress unusedStructMember
int x;
};
static misra_5_7_violation_t misra_5_7_use_type_2;
// #11443 - FP
static struct
{ // no warning
uint16_t x; // cppcheck-suppress unusedStructMember
} misra_5_7_false_positive_2;
// cppcheck-suppress misra-c2012-5.8
static int misra_5_8_var1;
// cppcheck-suppress misra-c2012-8.4
// cppcheck-suppress misra-c2012-5.8
void misra_5_8_f(void) {
// cppcheck-suppress [misra-c2012-5.8, unusedVariable]
// cppcheck-suppress misra-c2012-5.8
char misra_5_8_var2;
}
@ -43,11 +37,7 @@ extern int misra_8_5;
// cppcheck-suppress misra-c2012-8.4
// cppcheck-suppress misra-c2012-8.6
int32_t misra_8_6 = 2;
// cppcheck-suppress misra-c2012-8.4
int32_t misra_8_6_1;
// cppcheck-suppress misra-c2012-8.7
// cppcheck-suppress misra-c2012-8.4
int32_t misra_8_6_1 = 2;
// cppcheck-suppress misra-c2012-8.4
// cppcheck-suppress misra-c2012-8.7
void misra_8_7(void) {}

View File

@ -21,13 +21,13 @@ static void foo(void)
{
for(i = 0; i < 10; i++)
{
if(misra_5_2_func3()) //17.3
if(misra_5_2_func3()) //14.4
{
int misra_5_2_var_hides_var_1____31x;
int misra_5_2_var_hides_var_1____31y;//5.2
}
}
} while(misra_5_2_func2()); //17.3
} while(misra_5_2_func2()); //14.4
}
}
}

View File

@ -1,26 +1,12 @@
// To test:
// ~/cppcheck/cppcheck--dump -DDUMMY --suppress=uninitvar misra/misra-test-avr8.c --std=c89 --platform=avr8 && python3 ../misra.py -verify misra/misra-test-avr8.c.dump
// ~/cppcheck/cppcheck --addon=misra --platform=avr8 misra-test-avr8.c
static void misra_10_4(void)
{
// #10480
const char buf1[1] = {a};
char buf[1] = {'f'};
const char c = '0';
x = buf1[0] - c;
const char buf2[2] = {x,y};
x = 'a' == buf2[0]; // no-warning
typedef struct {
int t;
char buf[2];
} foo_t;
const foo_t cmd = {0};
x = 'b' == cmd.buf[0]; // no-warning
const foo_t * pcmd = &cmd;
x='c' == pcmd->buf[0]; // no-warning
(void)cmd.t;
signed int x = buf[0] - c;
}
static void misra_12_2(void) {

View File

@ -45,7 +45,7 @@
typedef struct {
union { // 19.2
struct {
unsigned a : 2;
unsigned a : 2; // 8.1
unsigned : 14;
};
uint16_t value;
@ -58,16 +58,10 @@ typedef unsigned int u32;
typedef signed int s32;
typedef unsigned long long u64;
static void misra_1_2(bool expr)
{
(void)(condition ? : 0); // 1.2
a = 1 + ({if (!expr) {code;} 1;}); // 1.2
}
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
if (0 != _Generic(misra_1_4_var)) {} // 1.4
printf_s("hello"); // 1.4
}
@ -88,7 +82,6 @@ static void misra_2_2(int x) {
/* // */ // 3.1
/* /* */ // 3.1
////
/* https://cppcheck.net */
// http://example.com // no warning
@ -160,13 +153,13 @@ static void foo(void)
{
for(i = 0; i < 10; i++)
{
if(misra_5_2_func3()) //17.3
if(misra_5_2_func3()) //14.4
{
int misra_5_2_var_hides_var_1____31x;
int misra_5_2_var_hides_var_1____31y;//5.2
}
}
} while(misra_5_2_func2()); //17.3
} while(misra_5_2_func2()); //14.4
}
break;
}
@ -252,11 +245,11 @@ static void misra_5_5_func1(void)
{
do
{
if(misra_5_5_func3()) //17.3
if(misra_5_5_func3()) //14.4
{
int misra_5_5_hides_macro________31y; //5.5
}
} while(misra_5_5_func2()); //17.3
} while(misra_5_5_func2()); //14.4
}
break;
}
@ -322,7 +315,6 @@ static const char *misra_7_4_return_const (void) { return 1 + "return_const"; }
static void misra_7_4_const_call(int a, const char* b) { } // 2.7
static void misra_7_4_const_ptr_call(int a, const char const* b) { } // 2.7
static void misra_7_4_call(int a, char* b) { } // 2.7
static void misra_7_4_call_2(int a, ...) { } // 2.7
static void misra_7_4(void)
{
@ -338,7 +330,6 @@ static void misra_7_4(void)
misra_7_4_const_call(1, ("text_const_call"));
misra_7_4_const_ptr_call(1, ("text_const_call"));
misra_7_4_call(1, "text_call"); // 7.4 11.8
misra_7_4_call_2(1, "a", "b");
}
const misra_8_1_a; // 8.1 8.4
@ -414,25 +405,6 @@ enum misra_8_12_e { misra_e1 = sizeof(int), misra_e2}; // no-crash
static void misra_8_14(char * restrict str) {(void)str;} // 8.14
// #11707 -- false positive
struct S_9_3 { struct S_9_3* p; int x; };
struct S_9_3* s_9_3_array[] = { x, NULL }; // 8.4
// #10854
struct Entry_9_2{
union{ // 19.2
const int *p;
int x;
};
int y;
};
static void misra_9_2_10854(void){
struct Entry_9_2 e1[] =
{
{{ .x = 1 }, .y = 2 }
};
}
static void misra_9_empty_or_zero_initializers(void) {
int a[2] = {}; // 9.2
int b[2][2] = {}; // 9.2
@ -593,13 +565,13 @@ static void misra_9_struct_initializers(void) {
// Struct with fields of unknown type
struct_with_unknown_fields ufa = { 1, { 1, 2 }, { 1, 2 } };
struct_with_unknown_fields ufb = { 1, 1, 2 }; // 9.2
struct_with_unknown_fields ufc[2] = { {1, { 1, 2 }, { 1, 2 } },
struct_with_unknown_fields[2] ufc = { {1, { 1, 2 }, { 1, 2 } },
{ 2, { 1, 2 }, { 1, 2 } } };
struct_with_unknown_fields ufd[2][2] = { {1, { 1, 2 }, { 1, 2 } }, // 9.2 9.3
struct_with_unknown_fields[2][2] ufd = { {1, { 1, 2 }, { 1, 2 } },
{ 2, { 1, 2 }, { 1, 2 } } };
struct_with_unknown_fields ufe[2] = { 1, { 1, 2 }, { 1, 2 }, // 9.2 9.3
struct_with_unknown_fields[2] ufe = { 1, { 1, 2 }, { 1, 2 }, // TODO: 9.2
2, { 1, 2 }, { 1, 2 } };
struct_with_unknown_fields uff[3] = { { 1, { 1, 2 }, { 1, 2 }}, // 9.3 9.4
struct_with_unknown_fields[3] uff = { { 1, { 1, 2 }, { 1, 2 }}, // TODO: 9.3 9.4
{2, { 1, 2 }, { 1, 2 }},
[1] = { 2, { 1, 2 }, { 1, 2 }} };
@ -607,6 +579,10 @@ static void misra_9_struct_initializers(void) {
struct1 os1 = { i1: 1, i2: 2 }; // 10.4 13.4
}
static void misra_9_broken_initializers(void) {
char a[UNKNOWN_MACRO] = { 19, 23, 0 }; // 18.8
}
static void misra_9_2(void) {
union misra_9_2_union { // 19.2
char c;
@ -666,11 +642,11 @@ static void misra_10_1_ternary(void)
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) ? ui16 : (get_bool(34) ? ui16 : ui16)); // 10.4
a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : ui16) : ui16); // 10.4
a = ui16 << (get_bool(42) ? i16 : (get_bool(34) ? ui16 : ui16)); // 10.1
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 : ui16) : i16); // 10.1
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
@ -711,7 +687,6 @@ static void misra_10_3(uint32_t u32a, uint32_t u32b) {
res = 2U + 3U; // no warning, utlr=unsigned char
res = 0.1f; // 10.3
const char c = '0'; // no-warning
uint32_t u = UINT32_C(10); // no-warning
}
static void misra_10_4(u32 x, s32 y) {
@ -731,20 +706,6 @@ static void misra_10_4(u32 x, s32 y) {
if ('0' == buf[x]) // no-warning
{
}
const struct foo_s{
int t;
char buf[2];
} cmd = {0};
if ('\0' == cmd.buf[0]) //no-warning
{
}
// #10652
char c;
if ((char)'1' == c) {} // no warning
if ((unsigned char)'1' == c) {} //10.4
if ((signed char)'1' == c) {} //10.4
}
static void misra_10_5(uint16_t x) {
@ -764,7 +725,7 @@ static void misra_10_6(u8 x, char c1, char c2) {
u16 y1 = x+x; // 10.6
u16 y2 = (0x100u - 0x80u); // rhs is not a composite expression because it's a constant expression
u16 z = ~u8 x ;//10.6
s32 i = c1 - c2; // 10.3
s32 i = c1 - c2; // 10.3 FIXME: False positive for 10.6 (this is compliant). Trac #9488
struct misra_10_6_s s;
s.a = x & 1U; // no-warning (#10487)
}
@ -773,7 +734,6 @@ static void misra_10_6_1(uint32_t *a, uint16_t b, uint16_t c)
*a = b + c ; // 10.6
}
static void misra_10_7_f1(struct Timer *pSelf, uint32_t interval_ms);
static void misra_10_7(uint16_t u16a, uint16_t u16b) {
uint32_t u32a = 100u;
res = u32a * u16a + u16b; // 12.1 no-warning
@ -782,7 +742,6 @@ 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
}
static void misra_10_8(u8 x, s32 a, s32 b) {
@ -794,13 +753,6 @@ static void misra_10_8(u8 x, s32 a, s32 b) {
int (*misra_11_1_p)(void); // 8.4
void *misra_11_1_bad1 = (void*)misra_11_1_p; // 11.1 8.4
// #12172
typedef void (*pfFunc_11_1)(uint32_t some);
extern pfFunc_11_1 data_11_1[10];
void func_11_1(pfFunc_11_1 ptr){ //8.4
data_11_1[index] = ptr; // no-warning
}
struct misra_11_2_s;
struct misra_11_2_t;
@ -813,15 +765,12 @@ static void misra_11_3(u8* p, struct Fred *fred) {
struct Wilma *wilma = (struct Wilma *)fred; // 11.3
}
typedef struct { uint32_t something; } struct_11_4;
#define A_11_4 ((struct_11_4 *)0x40000U) // 11.4
static void misra_11_4(u8*p) {
u64 y = (u64)p; // 11.4
u8 *misra_11_4_A = ( u8 * ) 0x0005;// 11.4
s32 misra_11_4_B;
u8 *q = ( u8 * ) misra_11_4_B; // 11.4
dummy = A_11_4->something; // no-warning
}
static void misra_11_5(void *p) {
@ -836,8 +785,6 @@ static void misra_11_6(void) {
x = (u64)p; // 11.6
p = ( void * )0; // no-warning
(void)p; // no-warning
// # 12184
p = (void*)0U; // no-warning
}
@ -945,8 +892,7 @@ void misra_12_3(int a, int b, int c) {
f((1,2),3); // TODO
// third clause: 2 persistent side effects instead of 1 (14.2)
for (i=0; i<10; i++, j++){} // 12.3 14.2
for (i=0; i<10; i++, j++){} // 12.3
for (int i = 0, p = &a1; // 12.3 14.2
i < 42;
++i, ++p ) // 12.3
@ -1170,15 +1116,12 @@ static s13_4_t s13_4 =
.string = STRING_DEF_13_4 // no-warning
};
static void misra_13_4(int x, int z) {
int y;
static void misra_13_4(void) {
if (x != (y = z)) {} // 13.4
else {}
}
static void misra_13_5(void) {
int x = 0;
int y = 0;
if (x && (y++ < 123)){} // 13.5
if (x || ((y += 19) > 33)){} // 13.5
if (x || ((y = 25) > 33)){} // 13.5 13.4
@ -1210,11 +1153,9 @@ static void misra_14_1(void) {
static void misra_14_2_init_value(int32_t *var) {
*var = 0;
}
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()) {} // TODO
int32_t g = 0;
int g_arr[42];
g += 2; // no-warning
@ -1224,23 +1165,15 @@ static void misra_14_2_fn1(bool b) {
g += 2;
i2 ^= 2; // 14.2
if (i2 == 2) {
g += g_arr[i2]; // cppcheck-suppress legacyUninitvar
g += g_arr[i2];
}
misra_14_2_init_value(&i2); // TODO: Fix false negative in function call
}
int i1;
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(&i); i < 10; ++i) {} // no-warning FIXME: False positive for 14.2 Trac #9491
bool abort = false;
for (i = 0; (i < 10) && !abort; ++i) { // 14.2 as 'i' is not a variable
if (b) {
abort = true;
}
}
for (int i = 0; (i < 10) && !abort; ++i) { // no warning
for (i = 0; (i < 10) && !abort; ++i) { // no-warning
if (b) {
abort = true;
}
@ -1251,18 +1184,6 @@ static void misra_14_2_fn1(bool b) {
for (int i = x; i < 42; i++) {
x++; // no warning
}
// 1st clause item 2 + loop counter modification
for(x = 0; x < 10; x++) {
x++; // 14.2
}
// third clause: 2 persistent side effects instead of 1 (14.2)
for (int i = 0; i < 10; i++, x++) { // 12.3 14.2
}
// 2 loop counters, there shall be only 1
for(int i=0, j=0; (i<10) && (j<10); i++, j++) { // 12.3 14.2
}
for (int i = (x - 3); i < 42; i++) {
x ^= 3; // no warning
}
@ -1282,17 +1203,6 @@ static void misra_14_2_fn1(bool b) {
}
}
}
static struct
{
uint16_t block;
bool readSuccessful;
int32_t i;
}
opState;
for (opState.block = 0U; opState.block < 10U; opState.block++) {;} //no-warning
for (misra_14_2_init_value(&opState.i); opState.i < 10; ++opState.i) {} //no-warning
}
static void misra_14_2_fn2(void)
{
@ -1306,18 +1216,16 @@ static void misra_14_2_fn2(void)
for (int i = 0, j = 19; y < 10, --j > 10; y++, j--) { // 14.2 12.3
i++; // no warning
}
// 1st clause is not empty, but is not used in 2nd and 3rd clause
for (int i = 0; y < 10; y++) { // 14.2
for (int i = 0; y < 10; y++) { // TODO: 14.2
i++; // no warning
}
for (; y < 10; y++) {} // without 1st clause, no error
for (int i = 0; i < 10; y++) { // 14.2
for (int i = 0; i < 10; y++) { // TODO: 14.2
i++; // no warning
}
for (int i = 0; y < 10; i++) { // 14.2
for (int i = 0; y < 10; i++) { // TODO: 14.2
i++; // no warning
}
for (int i = 0; i < 10; (y+=i)) { // 14.2
for (int i = 0; i < 10; (y+=i)) {
i++; // no warning
}
@ -1343,16 +1251,13 @@ struct {
unsigned int y:1;
} r14_4_struct; // 8.4
static void misra_14_4(bool b) {
if (x+4){} //config
if (x+4){} // 14.4
else {}
if (b) {}
else {}
if (r14_4_struct.x) {}
// #12079
if (z) {} //config
}
static void misra_15_1(void) {
@ -1365,9 +1270,7 @@ label:
goto label; // 15.2 15.1
}
static void misra_15_3(int a) {
int x = 0;
int y;
static void misra_15_3(void) {
if (x!=0) {
goto L1; // 15.3 15.1
if (y!=0) {
@ -1418,7 +1321,7 @@ static void misra_15_4(void) {
if (y==2) {
break;
}
for (z = 0; y < 42; ++z) { // 14.2
for (z = 0; y < 42; ++z) {
if (z==1) {
break;
}
@ -1482,14 +1385,14 @@ static void misra_15_4(void) {
}
}
static int misra_15_5(int x) {
static int misra_15_5(void) {
if (x!=0) {
return 1; // 15.5
} else {}
return 2;
}
static void misra_15_6(int x) {
static void misra_15_6(void) {
if (x!=0); // 15.6
else{}
@ -1521,7 +1424,7 @@ static void misra_15_6_fp(void)
#if defined(M_20_9) && M_20_9 > 1 // no-warning (#10380)
#endif
static void misra_15_7(int x, int a, int b) {
static void misra_15_7(void) {
uint32_t var = 0;
uint32_t var2 = 0;
@ -1557,7 +1460,7 @@ static void misra_16_1(int32_t i) {
}
}
static void misra_16_2(int y) {
static void misra_16_2(void) {
switch (x) {
default:
break;
@ -1569,8 +1472,7 @@ static void misra_16_2(int y) {
}
}
static void misra_16_3(int b) {
int a;
static void misra_16_3(void) {
switch (x) {
case 1:
case 2:
@ -1708,7 +1610,7 @@ static void misra_16_7(void) {
}
static void misra_17_1(void) {
va_list(); // 17.1 17.7
va_list(); // 17.1
va_arg(); // 17.1
va_start(); // 17.1
va_end(); // 17.1
@ -1742,24 +1644,11 @@ static void misra_17_2_5(void) {
misra_17_2_1(); // no-warning
}
bool (*dostuff)(); //8.2 8.4
static void misra_17_3(void) {
if (dostuff()) {}
}
static void misra_config(const char* str) {
if (strlen(str) > 3){} //10.4
if (sizeof(int) > 1){} //10.4
}
static void misra_17_6(int x[static 20]) {(void)x;} // 17.6
static int calculation(int x) { return x + 1; }
static void misra_17_7(void) {
calculation(123); // 17.7
int (*calc_ptr)(int) = &calculation;
calc_ptr(123); // 17.7
int y = calc_ptr(123);
}
static void misra_17_8(int x) {
@ -1799,7 +1688,6 @@ struct {
} r18_7_struct; // 8.4
struct {
uint16_t len;
int (*array_param_func_ptr)(char const *argv[], int argc); // no-warning
uint8_t data_1[ 19 ];
uint8_t data_2[ ]; // 18.7
} r18_7_struct; // 8.4
@ -1813,8 +1701,6 @@ static void misra_18_8(int x) {
int buf1[10];
int buf2[sizeof(int)];
int vla[x]; // 18.8
// #9498
int vlb[y]; // config
static const unsigned char arr18_8_1[] = UNDEFINED_ID;
static uint32_t enum_test_0[R18_8_ENUM_CONSTANT_0] = {0};
}
@ -2002,13 +1888,4 @@ static void misra_22_10(void)
errno = 0;
f = strtod ( "A.12", NULL );
if ( 0 == errno ) {}
// #10855
f = strtol(numbuf, 0, (formatHex == 0U) ? 0 : 16);
if (errno != 0) {}
// #11752
#define NULL_PTR ((void*)0)
f = strtod(inStr, NULL_PTR);
if(errno != 0) {}
}

View File

@ -7,7 +7,7 @@ class C {
class misra_21_1_C {
public:
misra_21_1_C operator=(const misra_21_1_C &);
misra_21_1_C operator=(const misra_21_1_C &); // 8.2
};
class C2 {

View File

@ -1,5 +1,5 @@
misra-c2012-21.6:*/misra-suppressions1-test.c:7
misra-c2012-17.3
misra-c2012-14.4
misra-c2012-5.2
misra-c2012-8.4:*/misra-suppressions1-test.c
misra-c2012-16.4:*/misra-suppressions1-test.c

View File

@ -1,5 +1,5 @@
// To test:
// ~/cppcheck/cppcheck --dump naming_test.c && python ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
// Should not crash when there is no name
void func(int number, int);
// To test:
// ~/cppcheck/cppcheck --dump naming_test.c && python ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
// Should not crash when there is no name
void func(int number, int);

View File

@ -1,11 +1,9 @@
// To test:
// ~/cppcheck/cppcheck --dump naming_test.cpp && python ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
// No error for mismatching Constructor/Destructor names should be issued, they can not be changed.
class TestClass1
{
TestClass1() {}
~TestClass1() {}
TestClass1(const TestClass1 &) {}
TestClass1(TestClass1 &&) {}
};
// To test:
// ~/cppcheck/cppcheck --dump naming_test.cpp && python ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
// No error for mismatching Constructor/Destructor names should be issued, they can not be changed.
class TestClass1
{
TestClass1() {}
~TestClass1() {}
};

View File

@ -7,11 +7,9 @@
# Command in cppcheck directory:
# PYTHONPATH=./addons python3 -m pytest addons/test/test-misra.py
import os
import pytest
import re
import sys
import tempfile
from .util import dump_create, dump_remove, convert_json_output
@ -19,12 +17,14 @@ from .util import dump_create, dump_remove, convert_json_output
TEST_SOURCE_FILES = ['./addons/test/misra/misra-test.c']
def remove_misra_config(s:str):
ret = ''
for line in s.splitlines():
if '[misra-config]' not in line:
ret += line + '\n'
return ret
def setup_module(module):
for f in TEST_SOURCE_FILES:
dump_create(f)
def teardown_module(module):
for f in TEST_SOURCE_FILES:
dump_remove(f)
@pytest.fixture(scope="function")
@ -36,15 +36,6 @@ def checker():
return MisraChecker(settings)
@pytest.fixture
def test_files():
for f in TEST_SOURCE_FILES:
dump_create(f)
yield
for f in TEST_SOURCE_FILES:
dump_remove(f)
def test_loadRuleTexts_structure(checker):
checker.loadRuleTexts("./addons/test/misra/misra_rules_structure.txt")
assert(checker.ruleTexts.get(101, None) is None)
@ -84,7 +75,7 @@ def test_rules_misra_severity(checker):
assert(checker.ruleTexts[2104].misra_severity == '')
def test_json_out(checker, capsys, test_files):
def test_json_out(checker, capsys):
sys.argv.append("--cli")
checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
checker.parseDump("./addons/test/misra/misra-test.c.dump")
@ -97,20 +88,20 @@ def test_json_out(checker, capsys, test_files):
assert("Advisory" in json_output['c2012-20.1'][0]['extra'])
def test_rules_cppcheck_severity(checker, capsys, test_files):
def test_rules_cppcheck_severity(checker, capsys):
checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
checker.parseDump("./addons/test/misra/misra-test.c.dump")
captured = capsys.readouterr().err
assert("(error)" not in remove_misra_config(captured))
assert("(error)" not in captured)
assert("(warning)" not in captured)
assert("(style)" in captured)
def test_rules_cppcheck_severity_custom(checker, capsys, test_files):
def test_rules_cppcheck_severity_custom(checker, capsys):
checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
checker.setSeverity("custom-severity")
checker.parseDump("./addons/test/misra/misra-test.c.dump")
captured = capsys.readouterr().err
assert("(error)" not in remove_misra_config(captured))
assert("(error)" not in captured)
assert("(warning)" not in captured)
assert("(style)" not in captured)
assert("(custom-severity)" in captured)
@ -129,6 +120,7 @@ def test_rules_suppression(checker, capsys):
assert found is None, 'Unexptected output:\n' + captured
dump_remove(src)
def test_arguments_regression():
args_ok = ["-generate-table",
"--rule-texts=./addons/test/assets/misra_rules_multiple_lines.txt",
@ -146,32 +138,18 @@ def test_arguments_regression():
from addons.misra import get_args_parser
# sys.argv contains all pytest arguments - so clear all existing arguments first and restore afterwards
sys_argv_old = sys.argv
sys.argv = [sys.argv[0]]
for arg in args_exit:
sys.argv.append(arg)
with pytest.raises(SystemExit):
parser = get_args_parser()
parser.parse_args()
sys.argv.remove(arg)
try:
for arg in args_exit:
sys.argv.append(arg)
with pytest.raises(SystemExit):
parser = get_args_parser()
parser.parse_args()
sys.argv.remove(arg)
for arg in args_ok:
sys.argv.append(arg)
try:
parser = get_args_parser()
parser.parse_args()
except SystemExit:
pytest.fail("Unexpected SystemExit with '%s'" % arg)
sys.argv.remove(arg)
finally:
sys.argv = sys_argv_old
def test_read_ctu_info_line(checker):
assert checker.read_ctu_info_line('{') is None
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
for arg in args_ok:
sys.argv.append(arg)
try:
parser = get_args_parser()
parser.parse_args()
except SystemExit:
pytest.fail("Unexpected SystemExit with '%s'" % arg)
sys.argv.remove(arg)

View File

@ -115,25 +115,18 @@ def test_arguments_regression():
from addons.y2038 import get_args_parser
# sys.argv contains all pytest arguments - so clear all existing arguments first and restore afterwards
sys_argv_old = sys.argv
sys.argv = [sys.argv[0]]
for arg in args_exit:
sys.argv.append(arg)
with pytest.raises(SystemExit):
parser = get_args_parser()
parser.parse_args()
sys.argv.remove(arg)
try:
for arg in args_exit:
sys.argv.append(arg)
with pytest.raises(SystemExit):
parser = get_args_parser()
parser.parse_args()
sys.argv.remove(arg)
for arg in args_ok:
sys.argv.append(arg)
try:
parser = get_args_parser()
parser.parse_args()
except SystemExit:
pytest.fail("Unexpected SystemExit with '%s'" % arg)
sys.argv.remove(arg)
finally:
sys.argv = sys_argv_old
for arg in args_ok:
sys.argv.append(arg)
try:
parser = get_args_parser()
parser.parse_args()
except SystemExit:
pytest.fail("Unexpected SystemExit with '%s'" % arg)
sys.argv.remove(arg)

View File

@ -1,67 +0,0 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2023 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This does not match the standard cppchek test code,
* because I haven't figured that out yet.
* This code does compile and run, and does demonstrate
* the issues that the threadsafety.py addon is supposed to find.
* It does not use threads !
*/
#include <stdio.h>
#include <time.h>
#include <string.h>
void threadsafety_static()
{
// cppcheck-suppress threadsafety-threadsafety
static unsigned int nCount = 0;
nCount++;
printf("%d\n", nCount);
}
void threadsafety_call()
{
time_t now = time(nullptr);
// cppcheck-suppress threadsafety-unsafe-call
printf("%s\n", ctime(&now));
}
// cppcheck --addon=threadsafety
// should *not* find any problems with this function.
void threadsafety_safecall()
{
char haystack[] = "alphabet";
char needle[] = "Alph";
char* found = strcasestr(haystack, needle);
printf("%s %sin %s\n", needle, found ? "" : "not ", haystack);
}
int main() {
threadsafety_static();
threadsafety_call();
threadsafety_safecall();
threadsafety_static();
return 0;
}

View File

@ -2,6 +2,5 @@ struct Dummy {
int x;
};
void func() {
// cppcheck-suppress threadsafety-threadsafety
static Dummy dummy;
static Dummy dummy;
}

View File

@ -2,6 +2,5 @@ struct Dummy {
int x;
};
void func() {
// cppcheck-suppress threadsafety-threadsafety-const
static const Dummy dummy;
}

View File

@ -25,13 +25,11 @@ def dump_create(fpath, *argv):
p.communicate()
if p.returncode != 0:
raise OSError("cppcheck returns error code: %d" % p.returncode)
p = subprocess.Popen(["sync"])
p.communicate()
subprocess.Popen(["sync"])
def dump_remove(fpath):
p = subprocess.Popen(["rm", "-f", fpath + ".dump"])
p.communicate()
subprocess.Popen(["rm", "-f", fpath + ".dump"])
def convert_json_output(raw_json_strings):

View File

@ -1,350 +1,39 @@
#!/usr/bin/env python3
"""
cppcheck addon for threadsafety detection.
This script analyses Cppcheck dump files to locate threadsafety issues.
It warns about
- static local objects
- MT-Unsafe symbols listed in the "Attributes" sections of man pages.
"""
import re
import sys
#
# This script analyses Cppcheck dump files to locate threadsafety issues
# - warn about static local objects
#
import cppcheckdata
import sys
# --------------------------------
# List of MT-Unsafe identifiers
# --------------------------------
# This is Work In Progress.
# Eventually it should contain all identifiers (types
# and functions) which are MT-Unsafe.
# The script tools/MT-Unsafe.py can help to re-generate this list.
# It reads a man-page tree and report identifiers marked as "MT-Unsafe"
# (see man 7 attributes for what this means), eg
# MT-Unsafe.py /usr/share/man/man3
id_MTunsafe_full = {
# MT-Unsafe types by definition
# 'pthread_t',
# Types marked MT-Unsafe
'const:env',
'const:hostid',
'const:mallopt',
'const:sigintr',
'race:LogMask',
'race:asctime',
'race:crypt',
'race:crypt_gensalt',
'race:cuserid/!string',
'race:dirstream',
'race:drand48',
'race:ecvt',
'race:exit',
'race:fcvt',
'race:fgetgrent',
'race:fgetpwent',
'race:fgetspent',
'race:fsent',
'race:getdate',
'race:getlogin',
'race:getopt',
'race:getspent',
'race:getspnam',
'race:grent',
'race:grgid',
'race:grnam',
'race:hostbyaddr',
'race:hostbyname',
'race:hostbyname2',
'race:hostent',
'race:hsearch',
'race:l64a',
'race:localeconv',
'race:mbrlen/!ps',
'race:mbrtowc/!ps',
'race:mbsnrtowcs/!ps',
'race:mbsrtowcs/!ps',
'race:mcheck',
'race:mntentbuf',
'race:netbyaddr',
'race:netbyname',
'race:netent',
'race:netgrent',
'race:protobyname',
'race:protobynumber',
'race:protoent',
'race:ptsname',
'race:pwent',
'race:pwnam',
'race:pwuid',
'race:qecvt',
'race:qfcvt',
'race:servbyname',
'race:servbyport',
'race:servent',
'race:sgetspent',
'race:signgam',
'race:stdin',
'race:stdout',
'race:streams',
'race:strerror',
'race:strsignal',
'race:strtok',
'race:tmbuf',
'race:tmpnam/!s',
'race:ttyent',
'race:ttyname',
'race:utent',
'race:wcrtomb/!ps',
'race:wcsnrtombs/!ps',
'race:wcsrtombs/!ps',
'sig:ALRM',
'sig:SIGCHLD/linux',
# APIs marked MT-Unsafe
'asctime',
'clearenv',
'ctime',
'cuserid',
'drand48',
'ecvt',
'encrypt',
'endfsent',
'endgrent',
'endhostent',
'endnetent',
'endnetgrent',
'endprotoent',
'endpwent',
'endservent',
'endspent',
'endttyent',
'endusershell',
'endutent',
'erand48',
'error_at_line',
'ether_aton',
'ether_ntoa',
'exit',
'fcloseall',
'fcvt',
'fgetgrent',
'fgetpwent',
'fgetspent',
'fts_children',
'fts_read',
'gamma',
'gammaf',
'gammal',
'getaliasbyname',
'getaliasent',
'getchar_unlocked',
'getdate',
'getfsent',
'getfsfile',
'getfsspec',
'getgrent',
'getgrent_r',
'getgrgid',
'getgrnam',
'gethostbyaddr',
'gethostbyname',
'gethostbyname2',
'gethostent',
'gethostent_r',
'getlogin',
'getlogin_r',
'getmntent',
'getnetbyaddr',
'getnetbyname',
'getnetent',
'getnetgrent',
'getnetgrent_r',
'getopt',
'getopt_long',
'getopt_long_only',
'getpass',
'getprotobyname',
'getprotobynumber',
'getprotoent',
'getpwent',
'getpwent_r',
'getpwnam',
'getpwuid',
'getrpcbyname',
'getrpcbynumber',
'getrpcent',
'getservbyname',
'getservbyport',
'getservent',
'getspent',
'getspent_r',
'getspnam',
'getttyent',
'getttynam',
'getusershell',
'getutent',
'getutid',
'getutline',
'getwchar_unlocked',
'glob',
'gmtime',
'hcreate',
'hdestroy',
'hsearch',
'innetgr',
'jrand48',
'l64a',
'lcong48',
'localeconv',
'localtime',
'login',
'login_tty',
'logout',
'logwtmp',
'lrand48',
'mallinfo',
'mallinfo2',
'mblen',
'mbrlen',
'mbrtowc',
'mbsnrtowcs',
'mbsrtowcs',
'mbtowc',
'mcheck',
'mcheck_check_all',
'mcheck_pedantic',
'mprobe',
'mrand48',
'mtrace',
'muntrace',
'nrand48',
'profil',
'ptsname',
'putchar_unlocked',
'putenv',
'pututline',
'putwchar_unlocked',
'pvalloc',
'qecvt',
'qfcvt',
'rcmd',
'rcmd_af',
're_comp',
're_exec',
'readdir',
'rexec',
'rexec_af',
'seed48',
'setenv',
'setfsent',
'setgrent',
'sethostent',
'sethostid',
'setkey',
'setlogmask',
'setnetent',
'setnetgrent',
'setprotoent',
'setpwent',
'setservent',
'setspent',
'setttyent',
'setusershell',
'setutent',
'sgetspent',
'siginterrupt',
'sleep',
'srand48',
'strerror',
'strsignal',
'strtok',
'tmpnam',
'ttyname',
'ttyslot',
'unsetenv',
'updwtmp',
'utmpname',
'valloc',
'wcrtomb',
'wcsnrtombs',
'wcsrtombs',
'wctomb',
'wordexp'
}
# From man 7 attributes
# the full token could be feature:function/condition - we just want function.
id_MTunsafe = [re.sub('^.*:', '', re.sub('/.*$', '', x))
for x in id_MTunsafe_full
]
def reportError(token, severity, msg, id):
cppcheckdata.reportError(token, severity, msg, 'threadsafety', id)
def reportError(token, severity, msg, errid): # noqa: D103
cppcheckdata.reportError(token, severity, msg, 'threadsafety', errid)
def checkstatic(data): # noqa: D103
def checkstatic(data):
for var in data.variables:
if var.isStatic and var.isLocal:
vartype = None
type = None
if var.isClass:
vartype = 'object'
type = 'object'
else:
vartype = 'variable'
type = 'variable'
if var.isConst:
if data.standards.cpp == 'c++03':
reportError(
var.typeStartToken,
'warning',
'Local constant static '
+ vartype + "'" + var.nameToken.str
+ "', dangerous if it is initialized"
+ ' in parallel threads',
'threadsafety-const')
reportError(var.typeStartToken, 'warning', 'Local constant static ' + type + ' \'' + var.nameToken.str + '\', dangerous if it is initialized in parallel threads', 'threadsafety-const')
else:
reportError(var.typeStartToken, 'warning',
'Local static ' + vartype + ': '
+ var.nameToken.str,
'threadsafety')
reportError(var.typeStartToken, 'warning', 'Local static ' + type + ': ' + var.nameToken.str, 'threadsafety')
for arg in sys.argv[1:]:
if arg.startswith('-'):
continue
def check_MTunsafe(cfg):
"""
Look for functions marked MT-unsafe in their man pages.
print('Checking %s...' % arg)
data = cppcheckdata.CppcheckData(arg)
The MT-unsafe functions are listed in id_MTunsafe (and id_MTunsafe_full).
That section of code can be regenerated by the external script MT-Unsafe.py
"""
for token in cfg.tokenlist:
if token.str in id_MTunsafe:
reportError(token, 'warning', token.str + ' is MT-unsafe',
'unsafe-call')
if __name__ == '__main__':
parser = cppcheckdata.ArgumentParser()
args = parser.parse_args()
quiet = args.quiet or args.cli
if not args.dumpfile:
if not args.quiet:
print('no input files.')
sys.exit(0)
for dumpfile in args.dumpfile:
# load XML from .dump file
data = cppcheckdata.CppcheckData(dumpfile)
for cfg in data.iterconfigurations():
if not args.quiet:
srcfile = data.files[0]
print('Checking %s, config %s...' % (srcfile, cfg.name))
check_MTunsafe(cfg)
checkstatic(cfg)
for cfg in data.iterconfigurations():
print('Checking %s, config %s...' % (arg, cfg.name))
checkstatic(cfg)
sys.exit(cppcheckdata.EXIT_CODE)

View File

@ -9,13 +9,15 @@
# 3. Any Y2038-unsafe symbol when _USE_TIME_BITS64 is not defined.
#
# Example usage:
# $ cppcheck --addon=y2038 path-to-src/test.c
# $ cppcheck --dump path-to-src/test.c
# $ y2038.py path-to-src/test.c.dump
#
# y2038.py will walk the source tree for .dump files.
from __future__ import print_function
import cppcheckdata
import sys
import os
import re
@ -154,14 +156,22 @@ def check_y2038_safe(dumpfile, quiet=False):
# load XML from .dump file
data = cppcheckdata.CppcheckData(dumpfile)
srcfile = data.files[0]
# Convert dump file path to source file in format generated by cppcheck.
# For example after the following call:
# cppcheck ./src/my-src.c --dump
# We got 'src/my-src.c' value for 'file' field in cppcheckdata.
srcfile = dumpfile.rstrip('.dump')
srcfile = os.path.expanduser(srcfile)
srcfile = os.path.normpath(srcfile)
# go through each configuration
for cfg in data.iterconfigurations():
if not quiet:
print('Checking %s, config %s...' % (srcfile, cfg.name))
safe_ranges = []
safe = -1
time_bits_defined = False
srclinenr = 0
srclinenr = '0'
for directive in cfg.directives:
# track source line number
@ -226,7 +236,7 @@ if __name__ == '__main__':
args = parser.parse_args()
exit_code = 0
quiet = args.quiet or args.cli
quiet = not any((args.quiet, args.cli))
if not args.dumpfile:
if not args.quiet:
@ -234,7 +244,7 @@ if __name__ == '__main__':
sys.exit(0)
for dumpfile in args.dumpfile:
if not quiet:
if not args.quiet:
print('Checking ' + dumpfile + '...')
check_y2038_safe(dumpfile, quiet)

22
benchmarks.txt Normal file
View File

@ -0,0 +1,22 @@
==========
Benchmarks
==========
In this file we can document some good code repos / code samples to use when working on optimisations.
Trac tickets
------------
http://trac.cppcheck.net/ticket/2435 -- Tokenizer::simplifyTypedef
http://trac.cppcheck.net/ticket/8355 -- TokenList::createAst
http://trac.cppcheck.net/ticket/9007 -- Unused types
Repos
-----
Small C++ library with lots of templates:
https://framagit.org/dtschump/CImg
Just check the file examples/use_tinymatwriter.cpp

View File

@ -1,76 +1,76 @@
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
------------------
Windows
-------
Visual Studio
To build PCRE, download the source code from www.pcre.org and
CMake (https://cmake.org/download/). We assume you use Visual Studio 2015 -
otherwise adapt the commands for your version.
VS Solution file
cmake . -G "Visual Studio 14 2015"
Open PCRE.sln with VS IDE or via cmd:
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
MSBuild PCRE.sln /target:Build /property:Configuration="Release"
For 64-bit target: cmake . -G "Visual Studio 14 2015 Win64"
or using NMake
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
cmake . -G "NMake Makefiles"
nmake
or using MSYS
cmake . -G "MSYS Makefiles"
make
Linux
-----
The normal Makefile should work.
Install PCRE on Ubuntu might be needed:
sudo apt-get install libpcre3 libpcre3-dev
Mac OSX
-------
Install PCRE:
homebre
brew install pcre
or macport
sudo port install pcre
Ensure /path/to/pcre.h is in CXXFLAGS, e.g:
for homebrew
export CXXFLAGS=${CXXFLAGS}:/usr/local/include
or macport
export CXXFLAGS=${CXXFLAGS}:/opt/local/include
Or for MSVC copy pcre.lib and pcre.h in /externals directory.
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
------------------
Windows
-------
Visual Studio
To build PCRE, download the source code from www.pcre.org and
CMake (https://cmake.org/download/). We assume you use Visual Studio 2015 -
otherwise adapt the commands for your version.
VS Solution file
cmake . -G "Visual Studio 14 2015"
Open PCRE.sln with VS IDE or via cmd:
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
MSBuild PCRE.sln /target:Build /property:Configuration="Release"
For 64-bit target: cmake . -G "Visual Studio 14 2015 Win64"
or using NMake
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
cmake . -G "NMake Makefiles"
nmake
or using MSYS
cmake . -G "MSYS Makefiles"
make
Linux
-----
The normal Makefile should work.
Install PCRE on Ubuntu might be needed:
sudo apt-get install libpcre3 libpcre3-dev
Mac OSX
-------
Install PCRE:
homebre
brew install pcre
or macport
sudo port install pcre
Ensure /path/to/pcre.h is in CXXFLAGS, e.g:
for homebrew
export CXXFLAGS=${CXXFLAGS}:/usr/local/include
or macport
export CXXFLAGS=${CXXFLAGS}:/opt/local/include
Or for MSVC copy pcre.lib and pcre.h in /externals directory.

View File

@ -3,6 +3,8 @@
<def format="2">
<!-- stdint.h -->
<define name="__USING_MINT8" value="0"/>
<define name="__CONCATenate(left, right)" value="left ## right"/>
<define name="__CONCAT(left, right)" value="__CONCATenate(left, right)"/>
<!-- Integer types capable of holding object pointers -->
<podtype name="intptr_t" sign="s" size="2"/>
<podtype name="uintptr_t" sign="u" size="2"/>
@ -84,8 +86,32 @@
<define name="SIG_ATOMIC_MAX" value="INT8_MAX"/>
<define name="SIG_ATOMIC_MIN" value="INT8_MIN"/>
<define name="SIZE_MAX" value="(__CONCAT(INT16_MAX, U))"/>
<!-- Macros for integer constants -->
<define name="INT8_C(value)" value="((int8_t) value)"/>
<define name="UINT8_C(value)" value="((uint8_t) __CONCAT(value, U))"/>
<define name="INT16_C(value)" value="value"/>
<define name="UINT16_C(value)" value="__CONCAT(value, U)"/>
<define name="INT32_C(value)" value="__CONCAT(value, L)"/>
<define name="UINT32_C(value)" value="__CONCAT(value, UL)"/>
<define name="INT64_C(value)" value="__CONCAT(value, LL)"/>
<define name="UINT64_C(value)" value="__CONCAT(value, ULL)"/>
<define name="INTMAX_C(value)" value="__CONCAT(value, LL)"/>
<define name="UINTMAX_C(value)" value="__CONCAT(value, ULL)"/>
<!-- FIXME: add macros for printf and scanf format specifiers,e.g. PRId8 -->
<!-- math.h -->
<define name="M_E" value="2.7182818284590452354"/>
<define name="M_LOG2E" value="1.4426950408889634074"/>
<define name="M_LOG10E" value="0.43429448190325182765"/>
<define name="M_LN2" value="0.69314718055994530942"/>
<define name="M_LN10" value="2.30258509299404568402"/>
<define name="M_PI" value="3.14159265358979323846"/>
<define name="M_PI_2" value="1.57079632679489661923"/>
<define name="M_PI_4" value="0.78539816339744830962"/>
<define name="M_1_PI" value="0.31830988618379067154"/>
<define name="M_2_PI" value="0.63661977236758134308"/>
<define name="M_2_SQRTPI" value="1.12837916709551257390"/>
<define name="M_SQRT2" value="1.41421356237309504880"/>
<define name="M_SQRT1_2" value="0.70710678118654752440"/>
<define name="powf" value="pow"/>
<define name="roundf" value="round"/>
<define name="signbitf" value="signbit"/>
@ -111,6 +137,9 @@
<define name="putchar(__c)" value="fputc(__c, stdout)"/>
<define name="getc(__stream)" value="fgetc(__stream)"/>
<define name="getchar()" value="fgetc(stdin)"/>
<define name="SEEK_SET" value="0"/>
<define name="SEEK_CUR" value="1"/>
<define name="SEEK_END" value="2"/>
<function name="vfprintf_P">
<noreturn>false</noreturn>
<leak-ignore/>

View File

@ -16,7 +16,6 @@
<define name="BOOST_PP_SEQ_TRANSFORM(macro, data, list)" value=""/>
<define name="BOOST_PP_CAT(a, b)" value=""/>
<define name="BOOST_PP_REPEAT(a,b,c)" value=""/>
<define name="BOOST_PP_STRINGIZE(t)" value=""/>
<!-- https://www.boost.org/doc/libs/master/doc/html/foreach.html -->
<define name="BOOST_FOREACH(A,B)" value="for (A: B)"/>
<!-- https://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html -->
@ -93,9 +92,6 @@
<define name="BOOST_SCOPED_ENUM_DECLARE_BEGIN(x)" value=""/>
<define name="BOOST_SCOPED_ENUM_DECLARE_END(x)" value=""/>
<define name="BOOST_TTI_HAS_TYPE(x)" value=""/>
<define name="BOOST_TTI_HAS_TYPE(x)" value=""/>
<define name="BOOST_TTI_MEMBER_TYPE(x)" value=""/>
<define name="BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(x)" value=""/>
<!-- ########## Boost containers ########## -->
<!-- boost containers that are similar to std containers -->
<container id="boostArray" startPattern="boost :: array|scoped_array &lt;" inherits="stdArray"/>

View File

@ -218,176 +218,6 @@
<valid>0:</valid>
</arg>
</function>
<!-- https://linux.die.net/man/3/setbuffer -->
<!-- void setbuffer(FILE *stream, char *buf, size_t size); -->
<function name="setbuffer">
<returnValue type="void"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="inout">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
</function>
<!-- https://linux.die.net/man/3/setbuffer -->
<!-- void setlinebuf(FILE *stream); -->
<function name="setlinebuf">
<returnValue type="void"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="inout">
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- https://linux.die.net/man/2/writev -->
<!-- ssize_t readv(int fd, const struct iovec *iov, int iovcnt); -->
<function name="readv">
<leak-ignore/>
<returnValue type="ssize_t"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="out">
<not-null/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<!-- https://linux.die.net/man/2/writev -->
<!-- ssize_t writev(int fd, const struct iovec *iov, int iovcnt); -->
<function name="writev">
<leak-ignore/>
<returnValue type="ssize_t"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="in">
<not-null/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<!-- https://linux.die.net/man/2/writev -->
<!-- ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset); -->
<function name="preadv">
<leak-ignore/>
<returnValue type="ssize_t"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="out">
<not-null/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<!-- https://linux.die.net/man/2/writev -->
<!-- ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags); -->
<function name="preadv2">
<leak-ignore/>
<returnValue type="ssize_t"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="out">
<not-null/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="5" direction="in">
<not-uninit/>
</arg>
</function>
<!-- https://linux.die.net/man/2/writev -->
<!-- ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset); -->
<function name="pwritev">
<leak-ignore/>
<returnValue type="ssize_t"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="in">
<not-null/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<!-- https://linux.die.net/man/2/writev -->
<!-- ssize_t pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags); -->
<function name="pwritev2">
<leak-ignore/>
<returnValue type="ssize_t"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="in">
<not-null/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="5" direction="in">
<not-uninit/>
</arg>
</function>
<!-- https://www.freebsd.org/cgi/man.cgi?query=arc4random -->
<!-- uint32_t arc4random(void); -->
<function name="arc4random">

File diff suppressed because it is too large Load Diff

31
cfg/daca.cfg Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0"?>
<def format="2">
<!-- This configuration is used in daca@home and contains some common practice macros and functions which are helpful for daca analysis. -->
<!-- see gnu.cfg -->
<define name="ASSERT(expr)" value="assert (expr)"/>
<define name="BE(expr, val)" value="__builtin_expect (expr, val)"/>
<function name="MIN">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue>arg1&lt;arg2?arg1:arg2</returnValue>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
</function>
<function name="MAX">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue>arg1&gt;arg2?arg1:arg2</returnValue>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
</function>
</def>

View File

@ -92,34 +92,6 @@
<valid>0:</valid>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man2/semop.2.html -->
<!-- int semtimedop(int semid, struct sembuf *sops, size_t nsops, const struct timespec *timeout); -->
<function name="semtimedop">
<noreturn>false</noreturn>
<returnValue type="int"/>
<use-retval/>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="out">
<not-null/>
<not-uninit/>
<not-bool/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<!-- If the timeout argument is NULL, then semtimedop() behaves exactly like semop() -->
<not-uninit/>
<not-bool/>
</arg>
</function>
<!-- void * __builtin_assume_aligned (const void *exp, size_t align, ...) -->
<!-- This function can have either two or three arguments, if it has three, the third argument should have integer type. -->
<function name="__builtin_assume_aligned">
@ -276,50 +248,6 @@
<not-bool/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/mempcpy.3.html-->
<!-- wchar_t *wmempcpy(wchar_t *restrict dest, const wchar_t *restrict src, size_t n);-->
<function name="wmempcpy">
<returnValue type="wchar_t *"/>
<noreturn>false</noreturn>
<leak-ignore/>
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
<arg nr="1" direction="out">
<not-null/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/mempcpy.3.html-->
<!-- void *mempcpy(void *restrict dest, const void *restrict src, size_t n);-->
<function name="mempcpy">
<returnValue type="void *"/>
<noreturn>false</noreturn>
<leak-ignore/>
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
<arg nr="1" direction="out">
<not-null/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<!-- void xexit(int status); -->
<function name="xexit">
<noreturn>true</noreturn>
@ -346,7 +274,6 @@
<not-null/>
<not-uninit/>
<not-bool/>
<strz/>
</arg>
</function>
<!-- void xfree(void *block); -->
@ -414,7 +341,7 @@
<arg nr="1" direction="out">
<not-null/>
<not-bool/>
<minsize type="value" value="2" baseType="int"/>
<minsize type="value" value="2"/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
@ -471,7 +398,6 @@
<arg nr="2" direction="in">
<formatstr/>
<not-uninit/>
<strz/>
</arg>
</function>
<!-- int isascii_l(int c, locale_t locale); -->
@ -501,7 +427,6 @@
<arg nr="2" direction="in">
<formatstr/>
<not-uninit/>
<strz/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
@ -530,114 +455,6 @@
</arg>
<leak-ignore/>
</function>
<!-- https://man7.org/linux/man-pages/man3/gethostbyaddr_r.3.html -->
<!-- int gethostbyaddr_r(const void *addr, socklen_t len, int type, struct hostent *restrict ret, char *restrict buf, size_t buflen, struct hostent **restrict result, int *restrict h_errnop); -->
<function name="gethostbyaddr_r">
<returnValue type="int"/>
<noreturn>false</noreturn>
<use-retval/>
<pure/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
<arg nr="4" direction="out">
<not-null/>
</arg>
<arg nr="5" direction="in">
<not-uninit/>
<not-null/>
<minsize type="argvalue" arg="6"/>
</arg>
<arg nr="6" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="7" direction="in">
<not-null/>
<not-uninit/>
</arg>
<arg nr="8" direction="in">
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/gethostbyname2_r.3.html -->
<!-- int gethostbyname2_r(const char *name, int af, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -->
<function name="gethostbyname2_r">
<returnValue type="int"/>
<noreturn>false</noreturn>
<use-retval/>
<pure/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<arg nr="3" direction="out">
<not-null/>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<not-null/>
<minsize type="argvalue" arg="5"/>
</arg>
<arg nr="5" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="6" direction="in">
<not-null/>
<not-uninit/>
</arg>
<arg nr="7" direction="in">
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/gethostbyname_r.3.html -->
<!-- int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -->
<function name="gethostbyname_r">
<returnValue type="int"/>
<noreturn>false</noreturn>
<use-retval/>
<pure/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="2" direction="out">
<not-null/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-null/>
<minsize type="argvalue" arg="4"/>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="5" direction="in">
<not-null/>
<not-uninit/>
</arg>
<arg nr="6" direction="in">
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- https://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html#Getopt-Long-Options -->
<!-- int getopt_long(int argc, char * const argv[],
const char *optstring,
@ -678,7 +495,6 @@
<not-null/>
<not-uninit/>
<not-bool/>
<strz/>
</arg>
</function>
<!-- char *strndupa(const char *s, size_t n); -->
@ -689,7 +505,6 @@
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
@ -729,7 +544,6 @@
<not-uninit/>
<not-null/>
<not-bool/>
<strz/>
</arg>
</function>
<!-- char *strdupa(const char *s); -->
@ -741,7 +555,6 @@
<not-null/>
<not-uninit/>
<not-bool/>
<strz/>
</arg>
</function>
<!-- http://www.gnu.org/software/libc/manual/html_node/Backtraces.html -->
@ -842,30 +655,6 @@
<not-bool/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/getservent_r.3.html -->
<!-- int getservent_r(struct servent *restrict result_buf, char *restrict buf, size_t buflen, struct servent **restrict result); -->
<function name="getservent_r">
<returnValue type="int"/>
<noreturn>false</noreturn>
<use-retval/>
<pure/>
<arg nr="1" direction="out">
<not-null/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- https://linux.die.net/man/3/ecvt_r -->
<!-- int ecvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="ecvt_r">
@ -980,23 +769,21 @@
<warn severity="style" reason="Obsolescent" alternatives="sprintf"/>
</function>
<!-- https://www.gnu.org/software/gnulib/manual/html_node/c_002dstrcasestr.html -->
<!-- char* strcasestr(const char *s1, const char *s2); -->
<!-- size_t strcasestr(const char *s1, const char *s2); -->
<function name="strcasestr">
<use-retval/>
<returnValue type="char *"/>
<returnValue type="size_t"/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<not-bool/>
<strz/>
</arg>
</function>
<!-- http://linux.die.net/man/2/getresuid -->
@ -1076,7 +863,6 @@
<arg nr="1">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="2">
<not-null/>
@ -1091,7 +877,6 @@
<not-uninit/>
<not-null/>
<not-bool/>
<strz/>
</arg>
<leak-ignore/>
</function>
@ -1143,7 +928,6 @@
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="3" direction="out">
<not-null/>
@ -1182,7 +966,6 @@
<arg nr="1" direction="in">
<not-null/>
<not-bool/>
<strz/>
</arg>
</function>
<!-- https://linux.die.net/man/3/execvpe -->
@ -1194,7 +977,6 @@
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
@ -1273,7 +1055,6 @@
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
@ -1303,37 +1084,12 @@
<valid>0:</valid>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/qsort.3.html -->
<!-- void qsort_r(void *base, size_t n, size_t size, int (*cmp)(const void *, const void *, void *), void *arg); -->
<function name="qsort_r">
<noreturn>false</noreturn>
<returnValue type="void"/>
<leak-ignore/>
<arg nr="1" direction="inout">
<not-null/>
<not-uninit/>
<minsize type="argvalue" arg="2"/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="out">
<not-null/>
<not-bool/>
</arg>
</function>
<!-- http://man7.org/linux/man-pages/man3/ffs.3.html -->
<!-- int ffsl(long int i);
int ffsll(long long int i); -->
<function name="ffsl,ffsll">
<use-retval/>
<!-- It returns the position of the first bit set, or 0 if no bits are set in i. -->
<returnValue type="int">arg1==0 &amp;0</returnValue>
<returnValue type="int"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
@ -1488,7 +1244,6 @@
<not-null/>
<not-uninit/>
<minsize type="argvalue" arg="2"/>
<strz/>
</arg>
<arg nr="2">
<not-uninit/>
@ -1553,7 +1308,6 @@
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
@ -1656,7 +1410,6 @@
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="3" direction="out">
<not-null/>
@ -1682,7 +1435,6 @@
<arg nr="3" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="4" direction="out">
<not-null/>
@ -1693,17 +1445,6 @@
<not-uninit/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/error.3.html -->
<!-- void error(int status, int errnum, const char *format, ...); -->
<!-- void error_at_line(int status, int errnum, const char *filename, unsigned int linenum, const char *format, ...); -->
<function name="error,error_at_line">
<noreturn>true</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="any" direction="in">
<not-uninit/>
</arg>
</function>
<!-- ########## Resource allocation ########## -->
<resource>
<alloc init="true">mkostemp</alloc>
@ -1731,6 +1472,4 @@
<define name="STDIN_FILENO" value="0"/>
<define name="STDOUT_FILENO" value="1"/>
<define name="STDERR_FILENO" value="2"/>
<entrypoint name="_init"/>
<entrypoint name="_fini"/>
</def>

View File

@ -36,22 +36,13 @@
<define name="G_STRINGIFY_ARG(contents)" value="#contents"/>
<define name="G_STRLOC" value="__FILE__ &quot;:&quot; G_STRINGIFY (__LINE__)"/>
<define name="G_STRFUNC" value="((const char*) (__FUNCTION__))"/>
<define name="G_DEFINE_TYPE(TN, t_n, T_P)" value=""/>
<define name="G_DEFINE_TYPE_WITH_PRIVATE(TN, t_n, T_P)" value=""/>
<define name="G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)" value=""/>
<define name="G_DEFINE_FINAL_TYPE(TN, t_n, T_P)" value=""/>
<define name="G_DEFINE_FINAL_TYPE_WITH_PRIVATE(TN, t_n, T_P)" value=""/>
<define name="G_DEFINE_FINAL_TYPE_WITH_CODE(TN, t_n, T_P, _C_)" value=""/>
<define name="G_DEFINE_ABSTRACT_TYPE(TN, t_n, T_P)" value=""/>
<define name="G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(TN, t_n, T_P)" value=""/>
<define name="G_DEFINE_ABSTRACT_TYPE_WITH_CODE(TN, t_n, T_P, _C_)" value=""/>
<define name="G_DEFINE_DYNAMIC_TYPE(TN, t_n, T_P)" value=""/>
<define name="G_DEFINE_DYNAMIC_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_)" value=""/>
<define name="G_DEFINE_BOXED_TYPE(TypeName,type_name,copy_func,free_func)" value=""/>
<define name="G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName,type_name,copy_func,free_func,_C_)" value=""/>
<define name="G_DEFINE_QUARK(QN,q_n)" value=""/>
<define name="G_BEGIN_DECLS" value=""/>
<define name="G_END_DECLS" value=""/>
<define name="G_ADD_PRIVATE(TypeName)" value=""/>
<define name="G_PRIVATE_OFFSET(TypeName, field)" value=""/>
<define name="G_PRIVATE_FIELD(TypeName, inst, field_type, field_name)" value=""/>
@ -60,9 +51,6 @@
<define name="G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, _C_)" value=""/>
<define name="G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_)" value=""/>
<define name="G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)" value=""/>
<define name="G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func)" value=""/>
<define name="G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none)" value=""/>
<define name="G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)" value=""/>
<define name="MAX(a, b)" value="(((a) &gt; (b)) ? (a) : (b))"/>
<define name="MIN(a, b)" value="(((a) &lt; (b)) ? (a) : (b))"/>
<define name="ABS(a)" value="(((a) &lt; 0) ? -(a) : (a))"/>
@ -2889,18 +2877,6 @@
<leak-ignore/>
<noreturn>false</noreturn>
</function>
<function name="g_file_info_get_attribute_object">
<leak-ignore/>
<noreturn>false</noreturn>
</function>
<function name="g_file_info_get_icon">
<leak-ignore/>
<noreturn>false</noreturn>
</function>
<function name="g_file_info_get_symbolic_icon">
<leak-ignore/>
<noreturn>false</noreturn>
</function>
<!-- gint g_fprintf (FILE *file, gchar const *format, ...); -->
<function name="g_fprintf">
<leak-ignore/>

View File

@ -253,19 +253,4 @@
<define name="ON_THREAD_MESSAGE(x,y)" value=""/>
<define name="ON_REGISTERED_THREAD_MESSAGE(x,y)" value=""/>
<define name="END_MESSAGE_MAP()" value=""/>
<define name="DECLARE_DYNAMIC(x)" value=""/>
<define name="IMPLEMENT_DYNAMIC(x,y)" value=""/>
<define name="DECLARE_DYNCREATE(x)" value=""/>
<define name="IMPLEMENT_DYNCREATE(x,y)" value=""/>
<define name="DECLARE_SERIAL(x)" value=""/>
<define name="IMPLEMENT_SERIAL(x,y,z)" value=""/>
<define name="DECLARE_EVENTSINK_MAP()" value=""/>
<define name="END_EVENTSINK_MAP()" value=""/>
<define name="BEGIN_EVENTSINK_MAP(x,y)" value=""/>
<define name="ON_EVENT(a,b,c,d,e)" value=""/>
<define name="ON_EVENT_RANGE(a,b,c,d,e,f)" value=""/>
<define name="ON_EVENT_REFLECT(a,b,c,d)" value=""/>
<define name="ON_PROPNOTIFY(a,b,c,d,e)" value=""/>
<define name="ON_PROPNOTIFY_RANGE(a,b,c,d,e,f)" value=""/>
<define name="ON_PROPNOTIFY_REFLECT(a,b,c,d)" value=""/>
</def>

View File

@ -3,11 +3,6 @@
<!-- Microsoft Windows ATL (Active Template Library) https://docs.microsoft.com/en-us/cpp/atl/atl-com-desktop-components -->
<define name="BEGIN_COM_MAP(x)" value=""/>
<define name="END_COM_MAP()" value=""/>
<define name="BEGIN_MSG_MAP(x)" value=""/>
<define name="MESSAGE_HANDLER(msg, func)" value=""/>
<define name="COMMAND_HANDLER(id, code, func)" value=""/>
<define name="CHAIN_MSG_MAP(theChainClass)" value=""/>
<define name="END_MSG_MAP()" value=""/>
<define name="COM_INTERFACE_ENTRY(x)" value=""/>
<define name="COM_INTERFACE_ENTRY2(x, x2)" value=""/>
<define name="COM_INTERFACE_ENTRY_IID(iid, x)" value=""/>
@ -25,16 +20,8 @@
<define name="COM_INTERFACE_ENTRY_NOINTERFACE(x)" value=""/>
<define name="DECLARE_LIBID(libid)" value=""/>
<define name="DECLARE_NO_REGISTRY()" value=""/>
<define name="DECLARE_NOT_AGGREGATABLE(x)" value=""/>
<define name="DECLARE_OBJECT_DESCRIPTION(x)" value=""/>
<define name="DECLARE_PROTECT_FINAL_CONSTRUCT()" value=""/>
<define name="DECLARE_REGISTRY(class,pid,vpid,nid,flags)" value=""/>
<define name="DECLARE_REGISTRY_APPID_RESOURCEID(resid,appid)" value=""/>
<define name="DECLARE_REGISTRY_RESOURCE(x)" value=""/>
<define name="DECLARE_REGISTRY_RESOURCEID(x)" value=""/>
<define name="STDMETHOD(method)" value="HRESULT STDMETHODCALLTYPE method"/>
<define name="STDMETHOD_(type,method)" value="type STDMETHODCALLTYPE method"/>
<define name="IFACEMETHOD(method)" value="STDMETHOD(method)"/>
<define name="IFACEMETHOD_(type,method)" value="STDMETHOD_(type,method)"/>
<define name="OBJECT_ENTRY_AUTO(clsid, class)" value=""/>
</def>

File diff suppressed because it is too large Load Diff

View File

@ -383,7 +383,6 @@
<!-- QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection) // static -->
<function name="connect,QObject::connect">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
@ -415,7 +414,6 @@
<!-- bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) // static -->
<function name="disconnect,QObject::disconnect">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
@ -444,12 +442,10 @@
<!-- QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = ...) -->
<!-- QAction *QMenu::addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut = ...) -->
<!-- QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0) -->
<!-- void QWidget::addAction(QAction *action) -->
<function name="QMenu::addAction">
<noreturn>false</noreturn>
<returnValue type="QAction *"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
@ -886,6 +882,21 @@
<use-retval/>
<const/>
</function>
<!-- iterator QList::..() -->
<function name="QList::begin,QList::end,QList::cbegin,QList::cend,QList::constBegin,QList::constEnd,QList::rbegin,QList::rend,QList::crbegin,QList::crend">
<noreturn>false</noreturn>
<use-retval/>
</function>
<!-- iterator QString::..() -->
<function name="QString::begin,QString::end,QString::cbegin,QString::cend,QString::constBegin,QString::constEnd,QString::rbegin,QString::rend,QString::crbegin,QString::crend">
<noreturn>false</noreturn>
<use-retval/>
</function>
<!-- iterator QStringList::..() -->
<function name="QStringList::begin,QStringList::end,QStringList::cbegin,QStringList::cend,QStringList::constBegin,QStringList::constEnd,QStringList::rbegin,QStringList::rend,QStringList::crbegin,QStringList::crend">
<noreturn>false</noreturn>
<use-retval/>
</function>
<!-- QStandardItem *QStandardItem::child(int row, int column = 0) const -->
<function name="QStandardItem::child">
<noreturn>false</noreturn>
@ -920,6 +931,10 @@
<valid>0:</valid>
</arg>
</function>
<!-- void QString::clear() -->
<function name="QList::clear,QString::clear">
<noreturn>false</noreturn>
</function>
<!-- int QString::compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive) //static -->
<!-- int QString::compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::compare(const QString &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
@ -1012,6 +1027,14 @@
<not-uninit/>
</arg>
</function>
<!-- bool QMap::isEmpty() const -->
<function name="QMap::isEmpty">
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
<leak-ignore/>
<const/>
</function>
<!-- const Key QMap::key(const T &value, const Key &defaultKey = Key()) const -->
<function name="QMap::key">
<noreturn>false</noreturn>
@ -1097,6 +1120,33 @@
<not-uninit/>
</arg>
</function>
<!-- int QList::count() const -->
<!-- int QList::length() const -->
<!-- int QList::size() const -->
<!-- int QString::count() const -->
<!-- int QString::length() const -->
<!-- int QString::size() const -->
<!-- int QStringList::count() const -->
<!-- int QStringList::length() const -->
<!-- int QStringList::size() const -->
<function name="QList::count,QList::length,QList::size,QString::count,QString::length,QString::size,QStringList::count,QStringList::length,QStringList::size">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="signed int"/>
<const/>
</function>
<!-- bool QList::empty() const -->
<!-- bool QList::isEmpty() const -->
<!-- bool QString::isEmpty() const -->
<!-- bool QString::isNull() const -->
<!-- bool QStringList::empty() const -->
<!-- bool QStringList::isEmpty() const -->
<function name="QList::empty,QList::isEmpty,QString::isEmpty,QString::isNull,QStringList::empty,QStringList::isEmpty">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="bool"/>
<const/>
</function>
<!-- void QList::insert(int i, const T &value) -->
<!-- iterator QList::insert(iterator before, const T &value) -->
<!-- QStringList inherits from QList -->
@ -3992,6 +4042,11 @@
<valid>0:</valid>
</arg>
</function>
<!-- void QVector::clear() -->
<function name="QVector::clear,QStack::clear">
<noreturn>false</noreturn>
<returnValue type="void"/>
</function>
<!-- bool QVector::contains(const T &value) const -->
<function name="QVector::contains,QStack::contains">
<noreturn>false</noreturn>
@ -4015,6 +4070,19 @@
<not-uninit/>
</arg>
</function>
<!-- T *QVector::data() -->
<!-- const T *QVector::data() const -->
<function name="QVector::data,QStack::data">
<noreturn>false</noreturn>
<use-retval/>
</function>
<!-- bool QVector::empty() const -->
<function name="QVector::empty,QStack::empty">
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
<const/>
</function>
<!-- bool QVector::endsWith(const T &value) const -->
<function name="QVector::endsWith,QStack::endsWith">
<noreturn>false</noreturn>
@ -4066,6 +4134,13 @@
<not-uninit/>
</arg>
</function>
<!-- bool QVector::isEmpty() const -->
<function name="QVector::isEmpty,QStack::isEmpty">
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
<const/>
</function>
<!-- int QVector::lastIndexOf(const T &value, int from = ...) const -->
<function name="QVector::lastIndexOf,QStack::lastIndexOf">
<noreturn>false</noreturn>
@ -4081,6 +4156,13 @@
<not-bool/>
</arg>
</function>
<!-- int QVector::length() const -->
<function name="QVector::length,QStack::length">
<noreturn>false</noreturn>
<returnValue type="int"/>
<use-retval/>
<const/>
</function>
<!-- void QVector::push_back(const T &value) -->
<!-- void QVector::push_back(T &&value) -->
<function name="QVector::push_back,QStack::push_back">
@ -4962,7 +5044,6 @@
<function name="back" yields="item"/>
<function name="last" yields="item"/>
<function name="data" yields="buffer"/>
<function name="constData" yields="buffer-nt"/>
<function name="rbegin" yields="start-iterator"/>
<function name="crbegin" yields="start-iterator"/>
<function name="rend" yields="end-iterator"/>
@ -5017,8 +5098,6 @@
<function name="at" yields="at_index"/>
<function name="front" yields="item"/>
<function name="back" yields="item"/>
<function name="data" yields="buffer"/>
<function name="constData" yields="buffer-nt"/>
<function name="rbegin" yields="start-iterator"/>
<function name="crbegin" yields="start-iterator"/>
<function name="rend" yields="end-iterator"/>
@ -5069,7 +5148,6 @@
<define name="Q_DECLARE_PUBLIC(Class)" value="inline Class##Public* d_func() { return reinterpret_cast&lt;Class##Public*&gt;(qGetPtrHelper(d_ptr)); } inline const Class##Public d_func() const { return reinterpret_cast&lt;const Class##Public *&gt;(qGetPtrHelper(d_ptr)); } friend class Class##Public;"/>
<define name="Q_DECLARE_TR_FUNCTIONS(context)" value="public: static inline QString tr(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) { return QCoreApplication::translate(#context, sourceText, disambiguation, n); } QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) private:"/>
<define name="Q_DISABLE_COPY(C)" value="C(C&amp;);C&amp; operator=(const C&amp;);"/>
<define name="Q_EMIT" value=""/>
<define name="Q_ENUM(X)" value=""/>
<define name="Q_ENUMS(X)" value=""/>
<define name="Q_ENUM_NS(X)" value=""/>
@ -5081,15 +5159,13 @@
<define name="Q_LIKELY(expr)" value="expr"/>
<define name="Q_NAMESPACE" value=""/>
<define name="Q_NULLPTR" value="NULL"/>
<define name="Q_OBJECT" value="static void qt_static_metacall(QObject*,QMetaObject::Call,int,void**);const MetaObject* metaObject() const;void* qt_metacast(const char*);int qt_metacall(QMetaObject::Call,int,void**);"/>
<define name="Q_OBJECT" value=""/>
<define name="Q_PRIVATE_SLOT(d, signature)" value=""/>
<define name="Q_SLOTS" value=""/>
<!-- Treat as variadic macro to avoid preprocessorErrorDirective -->
<define name="Q_PROPERTY(...)" value=""/>
<define name="Q_PROPERTY(X)" value=""/>
<define name="Q_Q(Class)" value="Class * const q = q_func()"/>
<define name="Q_RETURN_ARG(type, data)" value="QReturnArgument&lt;type &gt;(#type, data)"/>
<define name="Q_UNLIKELY(expr)" value="expr"/>
<define name="Q_UNUSED(X)" value="(void)(X);"/>
<define name="Q_UNUSED(X)" value="(void)(X)"/>
<define name="QT_BEGIN_NAMESPACE" value=""/>
<define name="QT_END_NAMESPACE" value=""/>
<define name="QT_TR_NOOP(x)" value="x"/>
@ -5098,20 +5174,17 @@
<define name="QT_TRANSLATE_NOOP_UTF8(scope, x)" value="x"/>
<define name="QT_TRANSLATE_NOOP3(scope, x, comment)" value="{x, comment}"/>
<define name="QT_TRANSLATE_NOOP3_UTF8(scope, x, comment)" value="{x, comment}"/>
<define name="QT_WARNING_PUSH" value=""/>
<define name="QT_WARNING_POP" value=""/>
<define name="QT_STRINGIFY(x)" value="#x"/>
<define name="QCOMPARE(actual, expected)" value="(void)((actual)==(expected))"/>
<define name="QVERIFY(condition)" value="(void)(condition)"/>
<define name="QVERIFY2(condition, message)" value="(void)(condition),(void)(message)"/>
<define name="QVERIFY2(condition, message)" value="(void)(condition)"/>
<define name="QBENCHMARK_ONCE" value=""/>
<define name="QBENCHMARK" value=""/>
<define name="QTRY_COMPARE(actual, expected)" value="(void)((actual)==(expected))"/>
<define name="QTRY_COMPARE_WITH_TIMEOUT(actual, expected, timeout)" value="(void)((actual)==(expected))"/>
<define name="QTRY_VERIFY2(condition, message)" value="(void)(condition),(void)(message)"/>
<define name="QTRY_VERIFY2(condition, message)" value="(void)(condition)"/>
<define name="QTRY_VERIFY(condition)" value="(void)(condition)"/>
<define name="QTRY_VERIFY2_WITH_TIMEOUT(condition, message, timeout)" value="(void)(condition),(void)(message),(void)(timeout)"/>
<define name="QTRY_VERIFY_WITH_TIMEOUT(condition, timeout)" value="(void)(condition),(void)(timeout)"/>
<define name="QTRY_VERIFY2_WITH_TIMEOUT(condition, message, timeout)" value="(void)(condition)"/>
<define name="QTRY_VERIFY_WITH_TIMEOUT(condition, timeout)" value="(void)(condition)"/>
<define name="QTEST_GUILESS_MAIN(testclass)" value=""/>
<define name="QTEST_APPLESS_MAIN(testclass)" value=""/>
<define name="QTEST_MAIN(testclass)" value=""/>
@ -5120,10 +5193,7 @@
<define name="Q_FOREACH(A,B)" value="for(A:B)"/>
<define name="foreach(A,B)" value="for(A:B)"/>
<define name="forever" value="for (;;)"/>
<define name="emit" value=""/>
<define name="slots" value=""/>
<define name="signals" value="protected"/>
<define name="Q_SIGNALS" value="protected"/>
<define name="emit(X)" value="(X)"/>
<define name="Q_OVERRIDE(x)" value=""/>
<define name="Q_PLUGIN_METADATA(x)" value=""/>
<define name="Q_ASSERT(condition)" value="assert(condition)"/>
@ -5142,7 +5212,6 @@
<define name="QT_FORWARD_DECLARE_STRUCT(name)" value="struct name;"/>
<!-- https://doc.qt.io/qt-5/qstring.html#QStringLiteral -->
<define name="QStringLiteral(str)" value="QString::fromUtf8(str, sizeof(str) - 1)"/>
<define name="QByteArrayLiteral(str)" value="QByteArray(str)"/>
<!-- https://doc.qt.io/qt-5/qtglobal.html#qreal-typedef -->
<define name="qreal" value="double"/>
<podtype name="qint8" sign="s" size="1"/>

File diff suppressed because it is too large Load Diff

View File

@ -1366,7 +1366,6 @@
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
@ -1507,7 +1506,6 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- int fprintf_s(FILE *stream, const char *format [, argument ]...); -->
@ -1520,7 +1518,6 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- int fwprintf_s(FILE *stream, const wchar_t *format [, argument ]...); -->
@ -1533,7 +1530,6 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- int _snprintf_s(char *buffer, size_t sizeOfBuffer, size_t count, const char *format [, argument] ...); -->
@ -1649,7 +1645,6 @@
<arg nr="3" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
</function>
<!-- ULONG vDbgPrintExWithPrefix(PCCH Prefix, ULONG ComponentId, ULONG Level, PCCH Format, va_list arglist); -->
@ -1676,7 +1671,6 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- int wscanf_s(const wchar_t *format [, argument]...); -->
@ -1688,7 +1682,6 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- int sscanf_s(const char *buffer, const char *format [, argument ] ...); -->
@ -1703,7 +1696,6 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- int fscanf_s(FILE *stream, const char *format [, argument ]...); -->
@ -1715,7 +1707,6 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- int fwscanf_s(FILE *stream, const wchar_t *format [, argument ]...); -->
@ -1727,7 +1718,6 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- int swscanf_s(const wchar_t *buffer, const wchar_t *format [, argument ] ...); -->
@ -1742,14 +1732,13 @@
<formatstr/>
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- BOOL WINAPI CloseHandle(_In_ HANDLE hObject); -->
<function name="CloseHandle">
<noreturn>false</noreturn>
<returnValue type="BOOL"/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
</arg>
</function>
@ -2122,7 +2111,6 @@
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="3" direction="inout">
<not-null/>
@ -2145,7 +2133,6 @@
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="3" direction="inout">
<not-null/>
@ -2176,7 +2163,7 @@
<noreturn>false</noreturn>
<returnValue type="HRESULT"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
@ -2236,12 +2223,10 @@
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
@ -2260,12 +2245,10 @@
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
</function>
<!-- DWORD WINAPI GetFileAttributes(_In_ LPCTSTR lpFileName);-->
@ -2346,7 +2329,6 @@
<formatstr/>
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
@ -2451,7 +2433,6 @@ HFONT CreateFont(
<arg nr="3" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="4"/>
</function>
@ -2473,7 +2454,6 @@ HFONT CreateFont(
<arg nr="3" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
@ -2502,7 +2482,6 @@ HFONT CreateFont(
<arg nr="4" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="5"/>
</function>
@ -2610,7 +2589,7 @@ HFONT CreateFont(
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<returnValue type="int">strcmp(arg1,arg2)</returnValue>
<returnValue type="int"/>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
@ -2623,25 +2602,6 @@ HFONT CreateFont(
<strz/>
</arg>
</function>
<!-- int _mbscmp_l(const unsigned char *string1, const unsigned char *string2, _locale_t locale); -->
<function name="_mbscmp_l,_tscmp_l">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<returnValue type="int">strcmp(arg1,arg2)</returnValue>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="3" direction="in"/>
</function>
<!-- int _snprintf(char *s, size_t n, const char *format, ...);
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format, ...);-->
<function name="_snprintf,_snwprintf,_sntprintf">
@ -2960,7 +2920,7 @@ HFONT CreateFont(
<arg nr="1" direction="out">
<not-null/>
</arg>
<arg nr="2">
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<arg nr="3" direction="in">
@ -2985,7 +2945,7 @@ HFONT CreateFont(
<arg nr="1" direction="out">
<not-null/>
</arg>
<arg nr="2">
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<arg nr="3" direction="in">
@ -3023,7 +2983,7 @@ HFONT CreateFont(
_In_ LPARAM lParam); -->
<function name="SendMessage,SendMessageA,SendMessageW">
<noreturn>false</noreturn>
<arg nr="1">
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
@ -3044,7 +3004,7 @@ HFONT CreateFont(
_In_ LPARAM lParam); -->
<function name="PostMessage,PostMessageA,PostMessageW">
<noreturn>false</noreturn>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
@ -3306,7 +3266,7 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<returnValue type="LPVOID"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-null/>
</arg>
</function>
@ -3315,10 +3275,10 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<returnValue type="HGLOBAL"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2">
<arg nr="2" direction="in">
<not-uninit/>
</arg>
</function>
@ -3327,7 +3287,7 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<returnValue type="BOOL"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
@ -3339,7 +3299,7 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<returnValue type="BOOL"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
@ -3432,7 +3392,7 @@ HFONT CreateFont(
<arg nr="9" direction="in">
<not-uninit/>
</arg>
<arg nr="10">
<arg nr="10" direction="in">
<not-uninit/>
</arg>
<arg nr="11" direction="in">
@ -3487,7 +3447,7 @@ HFONT CreateFont(
<arg nr="10" direction="in">
<not-uninit/>
</arg>
<arg nr="11">
<arg nr="11" direction="in">
<not-uninit/>
</arg>
<arg nr="12" direction="in">
@ -3501,7 +3461,7 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<returnValue type="BOOL"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
@ -3699,7 +3659,7 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<returnValue type="DWORD"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
@ -3746,7 +3706,7 @@ HFONT CreateFont(
<use-retval/>
<noreturn>false</noreturn>
<returnValue type="HRSRC"/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
@ -3901,7 +3861,7 @@ HFONT CreateFont(
<not-uninit/>
<not-null/>
</arg>
<arg nr="4">
<arg nr="4" direction="in">
<not-uninit/>
</arg>
<arg nr="5" direction="in">
@ -4568,18 +4528,6 @@ HFONT CreateFont(
<not-bool/>
</arg>
</function>
<!-- struct tm *_localtime32( const __time32_t *sourceTime );
struct tm *_localtime64( const __time64_t *sourceTime ); -->
<function name="_localtime32,_localtime64">
<returnValue type="struct tm *"/>
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- errno_t _localtime32_s( struct tm* _tm, const __time32_t *time);
errno_t _localtime64_s( struct tm* _tm, const __time64_t *time); -->
<function name="_localtime32_s,_localtime64_s">
@ -4726,7 +4674,7 @@ HFONT CreateFont(
<returnValue type="HMODULE"/>
<use-retval/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
<strz/>
</arg>
@ -4772,7 +4720,7 @@ HFONT CreateFont(
<function name="FreeLibrary">
<noreturn>false</noreturn>
<returnValue type="BOOL"/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
@ -4791,7 +4739,7 @@ HFONT CreateFont(
</function>
<!--BOOL WINAPI FlushConsoleInputBuffer(_In_ HANDLE hConsoleInput);-->
<function name="FlushConsoleInputBuffer">
<noreturn>false</noreturn>
<noreturn>true</noreturn>
<returnValue type="BOOL"/>
<leak-ignore/>
<arg nr="1" direction="in">
@ -4800,33 +4748,13 @@ HFONT CreateFont(
<not-bool/>
</arg>
</function>
<!-- HANDLE OpenProcess([in] DWORD dwDesiredAccess,
[in] BOOL bInheritHandle,
[in] DWORD dwProcessId); -->
<!-- HANDLE OpenThread ([in] DWORD dwDesiredAccess,
[in] BOOL bInheritHandle,
[in] DWORD dwThreadId); -->
<function name="OpenProcess,OpenThread">
<use-retval/>
<noreturn>false</noreturn>
<returnValue type="HANDLE"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
</function>
<!--VOID WINAPI FreeLibraryAndExitThread(
_In_ HMODULE hModule,
_In_ DWORD dwExitCode);-->
<function name="FreeLibraryAndExitThread">
<noreturn>true</noreturn>
<returnValue type="VOID"/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
@ -4841,11 +4769,11 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="DWORD"/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
<arg nr="2" direction="out">
<arg nr="2" direction="in">
<not-uninit/>
<strz/>
<minsize type="argvalue" arg="3"/>
@ -4904,7 +4832,7 @@ HFONT CreateFont(
<returnValue type="FARPROC"/>
<use-retval/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<not-null/>
@ -4991,7 +4919,7 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<returnValue type="BOOL"/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
@ -5384,12 +5312,13 @@ HFONT CreateFont(
<returnValue type="BOOL"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<!--void *_malloca(size_t size);-->
<!--void *_malloca(
size_t size);-->
<function name="_malloca">
<returnValue type="void *"/>
<use-retval/>
@ -5399,7 +5328,8 @@ HFONT CreateFont(
<valid>0:</valid>
</arg>
</function>
<!--void *_alloca(size_t size);-->
<!--void *_alloca(
size_t size);-->
<function name="_alloca">
<returnValue type="void *"/>
<noreturn>false</noreturn>
@ -5408,9 +5338,9 @@ HFONT CreateFont(
<not-uninit/>
<valid>0:</valid>
</arg>
<warn severity="style" alternatives="_malloca">This function is deprecated because a more secure version is available '_malloca'.</warn>
</function>
<!--void _freea(void *memblock);-->
<!--void _freea(
void *memblock);-->
<function name="_freea">
<noreturn>false</noreturn>
<returnValue type="void"/>
@ -5666,7 +5596,7 @@ HFONT CreateFont(
<returnValue type="int"/>
<leak-ignore/>
<!-- The function does nothing (useful) if arg1 is nullptr or arg2 is nullptr or arg3 is 0 -->
<arg nr="1">
<arg nr="1" direction="in">
<not-null/>
</arg>
<arg nr="2" direction="out">
@ -6344,7 +6274,7 @@ HFONT CreateFont(
<function name="LocalFree">
<noreturn>false</noreturn>
<returnValue type="HLOCAL"/>
<arg nr="1">
<arg nr="1" direction="in">
<not-bool/>
</arg>
</function>
@ -6811,7 +6741,7 @@ HFONT CreateFont(
<returnValue type="HWND"/>
<use-retval/>
<leak-ignore/>
<arg nr="1">
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
@ -7024,8 +6954,6 @@ HFONT CreateFont(
<define name="STDMETHODCALLTYPE" value="__stdcall"/>
<define name="STDMETHODIMP" value="HRESULT STDMETHODCALLTYPE"/>
<define name="STDMETHODIMP_(type)" value="type STDMETHODCALLTYPE"/>
<define name="IFACEMETHODIMP" value="STDMETHODIMP"/>
<define name="IFACEMETHODIMP_(type)" value="STDMETHODIMP_(type)"/>
<!-- Text conversion macros like 'TEXT()', '_TEXT()' and '_T()' are handled internally by Cppcheck. There is no need to added them here. -->
<define name="__pragma(x)" value=""/>
<define name="_countof(_Array)" value="(sizeof(_Array) / sizeof(_Array[0]))"/>
@ -17958,17 +17886,4 @@ HFONT CreateFont(
<define name="UNREFERENCED_PARAMETER(P)" value="((void)(P))"/>
<define name="DBG_UNREFERENCED_PARAMETER(P)" value="((void)(P))"/>
<define name="DBG_UNREFERENCED_LOCAL_VARIABLE(P)" value="((void)(P))"/>
<!-- https://learn.microsoft.com/en-us/cpp/build/reference/entry-entry-point-symbol -->
<entrypoint name="mainCRTStartup"/>
<entrypoint name="WinMain"/>
<entrypoint name="WinMainCRTStartup"/>
<entrypoint name="DllMain"/>
<entrypoint name="_DllMainCRTStartup"/>
<!-- TODO: these are UNICODE-specific -->
<entrypoint name="wmain"/>
<entrypoint name="wmainCRTStartup"/>
<entrypoint name="wWinMain"/>
<entrypoint name="wWinMainCRTStartup"/>
<!-- TODO: this is actually a define -->
<entrypoint name="_tmain"/>
</def>

View File

@ -276,7 +276,6 @@
<define name="EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_LABEL_LEFT_CLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_LABEL_RIGHT_CLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_LEFT_DCLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_RIGHT_DCLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_CHANGE(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_CHANGED(id,func)" value=""/>
@ -5256,10 +5255,10 @@
<function name="clear" action="clear"/>
<function name="Clear" action="clear"/>
<function name="Empty" action="clear"/>
<function name="size" yields="size" returnType="std::size_t"/>
<function name="length" yields="size" returnType="std::size_t"/>
<function name="Length" yields="size" returnType="std::size_t"/>
<function name="Len" yields="size" returnType="std::size_t"/>
<function name="size" yields="size"/>
<function name="length" yields="size"/>
<function name="Length" yields="size"/>
<function name="Len" yields="size"/>
<function name="empty" yields="empty"/>
<function name="IsEmpty" yields="empty"/>
<function name="IsNull" yields="empty"/>
@ -5482,6 +5481,16 @@
<use-retval/>
<warn severity="style">This is a wxWidgets 1.xx compatibility function; you should not use it in new code.</warn>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_string.html#ab20a87ca731a52c36ec674dae2213ad8 -->
<!-- size_t wxString::Len () const -->
<!-- size_t wxString::length () const -->
<function name="wxString::Len,wxString::length">
<noreturn>false</noreturn>
<leak-ignore/>
<const/>
<returnValue type="size_t"/>
<use-retval/>
</function>
<!-- wxUniChar wxString::Last () const -->
<!-- wxUniCharRef wxString::Last () const -->
<function name="wxString::Last">
@ -6820,7 +6829,7 @@
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="wxSizerItem*"/>
<arg nr="1">
<arg nr="1" direction="in">
<!-- <not-null/> Deactivated due to FPs with overloaded function: wxSizerItem * Add (int width, int height, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL) -->
<not-uninit/>
</arg>
@ -7309,7 +7318,7 @@
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1">
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
@ -9164,7 +9173,7 @@
<leak-ignore/>
<const/>
<returnValue type="bool"/>
<arg nr="1" direction="out">
<arg nr="1" direction="in">
<not-null/>
</arg>
</function>
@ -9375,7 +9384,7 @@
<!-- virtual void wxPGSpinCtrlEditor::OnFocus (wxPGProperty *property, wxWindow *wnd) const-->
<!-- virtual void wxPGTextCtrlEditor::OnFocus (wxPGProperty *property, wxWindow *wnd) const-->
<!-- virtual void wxPGTextCtrlAndButtonEditor::OnFocus (wxPGProperty *property, wxWindow *wnd) const-->
<function name="wxPGSpinCtrlEditor::OnFocus,wxPGTextCtrlAndButtonEditor::OnFocus">
<function name="wxPGSpinCtrlEditor::OnFocus,wxPGProperty::Hide,wxPGTextCtrlAndButtonEditor::OnFocus">
<noreturn>false</noreturn>
<leak-ignore/>
<const/>
@ -13670,8 +13679,8 @@ wxItemKind kind = wxITEM_NORMAL) -->
<const/>
<use-retval/>
<leak-ignore/>
<arg nr="1" direction="out"/>
<arg nr="2" default="0" direction="out">
<arg nr="1" direction="in"/>
<arg nr="2" default="0" direction="in">
<not-uninit/>
<not-bool/>
</arg>
@ -14209,7 +14218,7 @@ wxItemKind kind = wxITEM_NORMAL) -->
<arg nr="2" direction="in" default="0">
<not-uninit/>
</arg>
<arg nr="3" direction="in" default="wxString::npos">
<arg nr="3" direction="in" default="std::wxString::npos">
<not-uninit/>
</arg>
</function>
@ -14877,10 +14886,10 @@ wxItemKind kind = wxITEM_NORMAL) -->
<returnValue type="void"/>
<leak-ignore/>
<const/>
<arg nr="1" direction="out">
<arg nr="1" direction="in">
<not-null/>
</arg>
<arg nr="2" direction="out">
<arg nr="2" direction="in">
<not-null/>
</arg>
</function>

View File

@ -1,113 +0,0 @@
<?xml version="1.0"?>
<def format="2">
<function name="device_is_ready">
<returnValue type="bool"/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<not-bool/>
</arg>
</function>
<function name="gpio_init_callback">
<returnValue type="void"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<not-bool/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
<not-bool/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<function name="gpio_add_callback">
<returnValue type="int"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<not-bool/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
<not-bool/>
</arg>
</function>
<function name="gpio_pin_configure_dt,gpio_pin_interrupt_configure_dt">
<returnValue type="int"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<not-bool/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<function name="gpio_pin_toggle_dt">
<returnValue type="int"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<not-bool/>
</arg>
</function>
<function name="k_msleep">
<returnValue type="int32_t"/>
<noreturn>false</noreturn>
<arg nr="1" direction="in">
<not-uninit/>
<valid>0:2147483647</valid>
</arg>
</function>
<function name="printk">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr/>
<arg nr="1" direction="in">
<formatstr/>
<not-uninit/>
<strz/>
</arg>
</function>
<define name="KERN_EMERG" value="&quot;0&quot;"/>
<define name="KERN_ALERT" value="&quot;1&quot;"/>
<define name="KERN_CRIT" value="&quot;2&quot;"/>
<define name="KERN_ERR" value="&quot;3&quot;"/>
<define name="KERN_WARNING" value="&quot;4&quot;"/>
<define name="KERN_NOTICE" value="&quot;5&quot;"/>
<define name="KERN_INFO" value="&quot;6&quot;"/>
<define name="KERN_DEBUG" value="&quot;7&quot;"/>
<define name="KERN_DEFAULT" value="&quot;&quot;"/>
<define name="KERN_CONT" value="&quot;c&quot;"/>
<define name="ARRAY_SIZE(array)" value="(sizeof(array) / sizeof((array)[0]))"/>
<define name="BIT(x)" value="(1UL&lt;&lt;x)"/>
<define name="IS_ENABLED(flag)" value="flag"/>
</def>

View File

@ -1,200 +0,0 @@
# clang-tidy
Below are the reasoning why certain checks are (currently) disabled for out code base
## Externals
We do not perform static analysis of the source of the external libraries. `simplecpp` has its own CI with a clang-tidy workflow.
## Disabled Checks
`abseil-*`<br/>
`altera-*`<br/>
`android-*`<br/>
`boost-*`<br/>
`darwin-*`<br/>
`fuchsia-*`<br/>
`linuxkernel-*`<br/>
`llvm-*`<br/>
`llvmlibc-*`<br/>
`mpi-*`<br/>
`objc-*`<br/>
`openmp-*`<br/>
`zircon-*`<br/>
These are disabled since the platforms/libraries in question are not targeted by us.
`cert-*`<br/>
`cppcoreguidelines-*`<br/>
`google-*`<br/>
`hicpp-*`<br/>
These are coding guidelines we do not follow. Some of the checks might be explicitly enabled though.
`readability-braces-around-statements`<br/>
`readability-isolate-declaration`<br/>
`modernize-use-trailing-return-type`<br/>
`modernize-use-auto`<br/>
`readability-uppercase-literal-suffix`<br/>
`readability-else-after-return`<br/>
`readability-identifier-length`<br/>
These do not reflect the style we are (currently) enforcing.
`readability-function-size`<br/>
`readability-function-cognitive-complexity`<br/>
We are not interested in the size/complexity of a function.
`readability-magic-numbers`<br/>
These do not (always) increase readability.
`bugprone-macro-parentheses`<br/>
To be documented.
`readability-implicit-bool-conversion`<br/>
This does not appear to be useful as it is reported on very common code.
`bugprone-narrowing-conversions`<br/>
`performance-no-automatic-move`<br/>
It was decided not to apply these.
`modernize-loop-convert`<br/>
These might change the behavior of code which might not be intended (need to file an upstream issue)
`modernize-raw-string-literal`<br/>
This leads to a mismatch of raw string literals and regular ones and does reduce the readability.
`-clang-analyzer-*`<br/>
Disabled because of false positives (needs to file an upstream bug report).
`misc-non-private-member-variables-in-classes`<br/>
We intentionally use this.
`misc-no-recursion`<br/>
Leads to lots of "false positives". This seem to enforce a coding guidelines of certain codebases.
`bugprone-easily-swappable-parameters`<br/>
This produces a lot of noise and they are not fixable that easily.
`readability-container-data-pointer`<br/>
Disable because of false positives and inconsistent warnings (need to file an upstream bug report).
`misc-const-correctness`<br/>
Work in progress.
`bugprone-assignment-in-if-condition`<br/>
Is reported for valid patterns we are using.
`readability-suspicious-call-argument`<br/>
Produces a lot of false positives since it is too vague in its analysis.
`performance-inefficient-string-concatenation`<br/>
Produces warnings which might be considered false positives starting with C++11 - see https://github.com/llvm/llvm-project/issues/54526.
`modernize-avoid-c-arrays`<br/>
Produces warnings when `const char[]` is being used which is quite common in our code. Does not make sense to enable before C++17 when `std::string_view` becomes available.
Also reports a false positive about templates which deduce the array length: https://github.com/llvm/llvm-project/issues/60053.
`misc-include-cleaner`<br/>
We run this separately via `clang-include-cleaner` in the `iwyu.yml` workflow as the findings of the include checkers still need to be reviewed manually before applying them.
`bugprone-branch-clone`<br/>
`modernize-return-braced-init-list`<br/>
`misc-throw-by-value-catch-by-reference`<br/>
`readability-avoid-const-params-in-decls`<br/>
`bugprone-signed-char-misuse`<br/>
`readability-redundant-access-specifiers`<br/>
`concurrency-mt-unsafe`<br/>
`misc-use-anonymous-namespace`<br/>
`performance-avoid-endl`<br/>
`performance-noexcept-swap`<br/>
`bugprone-switch-missing-default-case`<br/>
`bugprone-empty-catch`<br/>
To be evaluated (need to remove exclusion).
`cppcoreguidelines-missing-std-forward`<br/>
`cppcoreguidelines-avoid-const-or-ref-data-members`<br/>
`cppcoreguidelines-macro-usage`<br/>
`cppcoreguidelines-pro-type-member-init`<br/>
`cppcoreguidelines-pro-type-static-cast-downcast`<br/>
`cppcoreguidelines-prefer-member-initializer`<br/>
`cppcoreguidelines-misleading-capture-default-by-value`<br/>
`bugprone-argument-comment.CommentBoolLiterals`<br/>
`cert-err33-c`<br/>
`google-readability-namespace-comments`<br/>
`cppcoreguidelines-special-member-functions`<br/>
To be evaluated (need to enable explicitly).
`modernize-type-traits`</br>
`modernize-use-nodiscard`</br>
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.
### Disabled for performance reasons
`portability-std-allocator-const`<br/>
Only necessary for code which is exclusively compiled with `libc++`. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132.
`modernize-deprecated-ios-base-aliases`<br/>
Warns about aliases which are removed in C++20. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132.
`bugprone-unchecked-optional-access`<br/>
We are not using any `optional` implementation. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132.
`modernize-replace-auto-ptr`<br/>
Still available until C++17. It is unlikely such code will ever be introduced. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132.
`readability-identifier-naming`<br/>
We are currently using our own `naming.json` to enforce naming schemes. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132.
`portability-simd-intrinsics`<br/>
We are not using SIMD instructions and it suggests to use `std::experiemental::` features which might not be commonly available. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132.
`modernize-macro-to-enum`<br/>
It does not seem to produce any warnings for us (needs to be investigated) and it is one of the more expensive checks.
`misc-unused-using-decls`
This is the most expensive check for several files and it is providing much in terms of code quality. Reported upstream as https://github.com/llvm/llvm-project/issues/72300.
`modernize-use-nullptr`
This is already covered by the `-Wzero-as-null-pointer-constant` compiler warning so there is no need for an additional check.
### Disabled for GUI only
`readability-convert-member-functions-to-static`<br/>
Disabled because of false positives with Qt `slot` methods (see https://github.com/llvm/llvm-project/issues/57520).
`readability-redundant-access-specifiers`<br/>
Reports warning with the Qt `<access-specifier> slots:` syntax in class declarations - see https://github.com/llvm/llvm-project/issues/60055.

View File

@ -7,45 +7,31 @@ add_library(cli_objs OBJECT ${hdrs} ${srcs})
target_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/lib/)
if(USE_BUNDLED_TINYXML2)
target_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/tinyxml2/)
else()
target_include_directories(cli_objs SYSTEM PRIVATE ${tinyxml2_INCLUDE_DIRS})
endif()
target_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/simplecpp/)
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
target_precompile_headers(cli_objs PRIVATE precompiled.h)
endif()
if (BUILD_CORE_DLL)
target_compile_definitions(cli_objs PRIVATE CPPCHECKLIB_IMPORT TINYXML2_IMPORT)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
# false positive warning in up to Clang 13 - caused by FD_ZERO macro
set_source_files_properties(processexecutor.cpp PROPERTIES COMPILE_FLAGS -Wno-reserved-identifier)
set_source_files_properties(threadexecutor.cpp PROPERTIES COMPILE_FLAGS -Wno-reserved-identifier)
endif()
list(APPEND cppcheck_SOURCES ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs>)
if (NOT BUILD_CORE_DLL)
list(APPEND cppcheck_SOURCES $<TARGET_OBJECTS:cppcheck-core>)
list(APPEND cppcheck_SOURCES $<TARGET_OBJECTS:simplecpp_objs>)
if(USE_BUNDLED_TINYXML2)
list(APPEND cppcheck_SOURCES $<TARGET_OBJECTS:tinyxml2_objs>)
endif()
endif()
if (WIN32)
list(APPEND cppcheck_SOURCES version.rc)
list(APPEND cppcheck_SOURCES ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:simplecpp_objs>)
if(USE_BUNDLED_TINYXML2)
list(APPEND cppcheck_SOURCES $<TARGET_OBJECTS:tinyxml2_objs>)
endif()
add_executable(cppcheck ${cppcheck_SOURCES})
target_include_directories(cppcheck PRIVATE ${PROJECT_SOURCE_DIR}/lib/)
if(USE_BUNDLED_TINYXML2)
target_include_directories(cppcheck PRIVATE ${PROJECT_SOURCE_DIR}/externals/tinyxml2/)
else()
target_include_directories(cppcheck SYSTEM PRIVATE ${tinyxml2_INCLUDE_DIRS})
endif()
target_include_directories(cppcheck PRIVATE ${PROJECT_SOURCE_DIR}/externals/simplecpp/)
if (HAVE_RULES)
target_link_libraries(cppcheck ${PCRE_LIBRARY})
endif()
if (USE_Z3)
target_link_libraries(cppcheck ${Z3_LIBRARIES})
endif()
if (WIN32 AND NOT BORLAND)
if(NOT MINGW)
target_link_libraries(cppcheck Shlwapi.lib)
@ -56,17 +42,13 @@ endif()
if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
target_link_libraries(cppcheck ${tinyxml2_LIBRARIES})
endif()
target_link_libraries(cppcheck ${CMAKE_THREAD_LIBS_INIT})
if (BUILD_CORE_DLL)
target_link_libraries(cppcheck cppcheck-core)
if (USE_THREADS)
target_link_libraries(cppcheck ${CMAKE_THREAD_LIBS_INIT})
endif()
add_dependencies(cppcheck copy_cfg)
add_dependencies(cppcheck copy_addons)
add_dependencies(cppcheck copy_platforms)
if (NOT DISABLE_DMAKE)
add_dependencies(cppcheck run-dmake)
endif()
add_dependencies(cppcheck run-dmake)
install(TARGETS cppcheck
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}

View File

@ -1,260 +1,425 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-PCRE|x64">
<Configuration>Debug-PCRE</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-PCRE|x64">
<Configuration>Release-PCRE</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{35CBDF51-2456-3EC3-99ED-113C30858883}</ProjectGuid>
<RootNamespace>cli</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">$(SolutionDir)bin\debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cppcheck</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">cppcheck</TargetName>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</IgnoreImportLibrary>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">true</IgnoreImportLibrary>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cppcheck</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">cppcheck</TargetName>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</IgnoreImportLibrary>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">true</IgnoreImportLibrary>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>precompiled.h</ForcedIncludeFiles>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>precompiled.h</ForcedIncludeFiles>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<FunctionLevelLinking>true</FunctionLevelLinking>
<StringPooling>true</StringPooling>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>precompiled.h</ForcedIncludeFiles>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<FunctionLevelLinking>true</FunctionLevelLinking>
<StringPooling>true</StringPooling>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>precompiled.h</ForcedIncludeFiles>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="version.rc" />
</ItemGroup>
<ItemGroup Label="HeaderFiles">
<ClInclude Include="cmdlineparser.h" />
<ClInclude Include="cppcheckexecutor.h" />
<ClInclude Include="cppcheckexecutorseh.h" />
<ClInclude Include="cppcheckexecutorsig.h" />
<ClInclude Include="executor.h" />
<ClInclude Include="filelister.h" />
<ClInclude Include="processexecutor.h" />
<ClInclude Include="singleexecutor.h" />
<ClInclude Include="stacktrace.h" />
<ClInclude Include="threadexecutor.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\lib\cppcheck.vcxproj">
<Project>{c183db5b-ad6c-423d-80ca-1f9549555a1a}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup Label="SourceFiles">
<ClCompile Include="cmdlineparser.cpp" />
<ClCompile Include="cppcheckexecutor.cpp" />
<ClCompile Include="cppcheckexecutorseh.cpp" />
<ClCompile Include="cppcheckexecutorsig.cpp" />
<ClCompile Include="executor.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="filelister.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="processexecutor.cpp" />
<ClCompile Include="singleexecutor.cpp" />
<ClCompile Include="stacktrace.cpp" />
<ClCompile Include="threadexecutor.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-PCRE|Win32">
<Configuration>Debug-PCRE</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-PCRE|x64">
<Configuration>Debug-PCRE</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-PCRE|Win32">
<Configuration>Release-PCRE</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-PCRE|x64">
<Configuration>Release-PCRE</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{35CBDF51-2456-3EC3-99ED-113C30858883}</ProjectGuid>
<RootNamespace>cli</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'">$(SolutionDir)bin\debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">$(SolutionDir)bin\debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cppcheck</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'">cppcheck</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cppcheck</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">cppcheck</TargetName>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</IgnoreImportLibrary>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'">true</IgnoreImportLibrary>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</IgnoreImportLibrary>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">true</IgnoreImportLibrary>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">temp\$(Configuration)_$(PlatformName)\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cppcheck</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'">cppcheck</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cppcheck</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">cppcheck</TargetName>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</IgnoreImportLibrary>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'">true</IgnoreImportLibrary>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</IgnoreImportLibrary>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">true</IgnoreImportLibrary>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BrowseInformation>false</BrowseInformation>
<BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>$(TargetDir)cli.pdb</ProgramDatabaseFile>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BrowseInformation>false</BrowseInformation>
<BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<DebugInformationFormat>
</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<DebugInformationFormat>
</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<FunctionLevelLinking>true</FunctionLevelLinking>
<StringPooling>true</StringPooling>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<DebugInformationFormat>
</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<FunctionLevelLinking>true</FunctionLevelLinking>
<StringPooling>true</StringPooling>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
<DebugInformationFormat>
</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="version.rc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\lib\config.h" />
<ClInclude Include="cmdlineparser.h" />
<ClInclude Include="cppcheckexecutor.h" />
<ClInclude Include="filelister.h" />
<ClInclude Include="threadexecutor.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\lib\cppcheck.vcxproj">
<Project>{c183db5b-ad6c-423d-80ca-1f9549555a1a}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cmdlineparser.cpp" />
<ClCompile Include="cppcheckexecutor.cpp" />
<ClCompile Include="filelister.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="threadexecutor.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

View File

@ -1,88 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{6d3be647-edb6-43e6-a7eb-3031a2c7b655}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup Label="HeaderFiles">
<ClInclude Include="cmdlineparser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="threadexecutor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cppcheckexecutor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cppcheckexecutorseh.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cppcheckexecutorsig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="executor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="filelister.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="processexecutor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stacktrace.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="singleexecutor.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup Label="SourceFiles">
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="threadexecutor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cppcheckexecutor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cppcheckexecutorseh.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cppcheckexecutorsig.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="executor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="filelister.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cmdlineparser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="processexecutor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="stacktrace.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="singleexecutor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="version.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{6d3be647-edb6-43e6-a7eb-3031a2c7b655}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\lib\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cmdlineparser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="threadexecutor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cppcheckexecutor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="filelister.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="threadexecutor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cppcheckexecutor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="filelister.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cmdlineparser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="version.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -1,37 +0,0 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2023 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CMD_LINE_LOGGER_H
#define CMD_LINE_LOGGER_H
#include <string>
class CmdLineLogger
{
public:
virtual ~CmdLineLogger() = default;
/** print a regular message */
virtual void printMessage(const std::string &message) = 0;
/** print an error message */
virtual void printError(const std::string &message) = 0;
/** print to the output */
virtual void printRaw(const std::string &message) = 0;
};
#endif // CMD_LINE_LOGGER_H

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2023 Cppcheck team.
* Copyright (C) 2007-2022 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
@ -19,19 +19,10 @@
#ifndef CMDLINE_PARSER_H
#define CMDLINE_PARSER_H
#include <cstddef>
#include <list>
#include <string>
#include <utility>
#include <vector>
#include "cmdlinelogger.h"
#include "filesettings.h"
#include "utils.h"
class Settings;
class Suppressions;
class Library;
/// @addtogroup CLI
/// @{
@ -49,31 +40,30 @@ class CmdLineParser {
public:
/**
* The constructor.
* @param logger The logger instance to log messages through
* @param settings Settings instance that will be modified according to
* options user has given.
* @param suppressions Suppressions instance that keeps the suppressions
* @param suppressionsNoFail Suppressions instance that keeps the "do not fail" suppressions
*/
CmdLineParser(CmdLineLogger &logger, Settings &settings, Suppressions &suppressions, Suppressions &suppressionsNoFail);
enum class Result { Success, Exit, Fail };
/**
* @brief Parse command line args and fill settings and file lists
* from there.
*
* @param argc argc from main()
* @param argv argv from main()
* @return false when errors are found in the input
*/
bool fillSettingsFromArgs(int argc, const char* const argv[]);
explicit CmdLineParser(Settings *settings);
/**
* Parse given command line.
* @return true if command line was ok, false if there was an error.
*/
Result parseFromArgs(int argc, const char* const argv[]);
bool parseFromArgs(int argc, const char* const argv[]);
/**
* Return if user wanted to see program version.
*/
bool getShowVersion() const {
return mShowVersion;
}
/**
* Return if user wanted to see list of error messages.
*/
bool getShowErrorMessages() const {
return mShowErrorMessages;
}
/**
* Return the path names user gave to command line.
@ -83,17 +73,17 @@ public:
}
/**
* Return the files user gave to command line.
* Return if help is shown to user.
*/
const std::list<std::pair<std::string, std::size_t>>& getFiles() const {
return mFiles;
bool getShowHelp() const {
return mShowHelp;
}
/**
* Return the file settings read from command line.
* Return if we should exit after printing version, help etc.
*/
const std::list<FileSettings>& getFileSettings() const {
return mFileSettings;
bool exitAfterPrinting() const {
return mExitAfterPrint;
}
/**
@ -108,59 +98,26 @@ protected:
/**
* Print help text to the console.
*/
void printHelp() const;
static void printHelp();
/**
* Print message (to stdout).
*/
static void printMessage(const std::string &message);
/**
* Print error message (to stdout).
*/
static void printError(const std::string &message);
private:
bool isCppcheckPremium() const;
template<typename T>
bool parseNumberArg(const char* const arg, std::size_t offset, T& num, bool mustBePositive = false)
{
T tmp;
std::string err;
if (!strToInt(arg + offset, tmp, &err)) {
mLogger.printError("argument to '" + std::string(arg, offset) + "' is not valid - " + err + ".");
return false;
}
if (mustBePositive && tmp < 0) {
mLogger.printError("argument to '" + std::string(arg, offset) + "' needs to be a positive integer.");
return false;
}
num = tmp;
return true;
}
/**
* Tries to load a library and prints warning/error messages
* @return false, if an error occurred (except unknown XML elements)
*/
bool tryLoadLibrary(Library& destination, const std::string& basepath, const char* filename);
/**
* @brief Load libraries
* @param settings Settings
* @return Returns true if successful
*/
bool loadLibraries(Settings& settings);
/**
* @brief Load addons
* @param settings Settings
* @return Returns true if successful
*/
bool loadAddons(Settings& settings);
bool loadCppcheckCfg();
CmdLineLogger &mLogger;
std::vector<std::string> mPathNames;
std::list<std::pair<std::string, std::size_t>> mFiles;
std::list<FileSettings> mFileSettings;
std::vector<std::string> mIgnoredPaths;
Settings &mSettings;
Suppressions &mSuppressions;
Suppressions &mSuppressionsNoFail;
Settings *mSettings;
bool mShowHelp;
bool mShowVersion;
bool mShowErrorMessages;
bool mExitAfterPrint;
std::string mVSConfig;
};

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2023 Cppcheck team.
* Copyright (C) 2007-2022 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
@ -19,18 +19,20 @@
#ifndef CPPCHECKEXECUTOR_H
#define CPPCHECKEXECUTOR_H
#include "config.h"
#include "filesettings.h"
#include "color.h"
#include "errorlogger.h"
#include <cstdio>
#include <list>
#include <ctime>
#include <iosfwd>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
class CppCheck;
class Library;
class Settings;
class ErrorLogger;
/**
* This class works as an example of how CppCheck can be used in external
@ -39,17 +41,20 @@ class ErrorLogger;
* just rewrite this class for your needs and possibly use other methods
* from CppCheck class instead the ones used here.
*/
class CppCheckExecutor {
class CppCheckExecutor : public ErrorLogger {
public:
friend class TestSuppressions;
/**
* Constructor
*/
CppCheckExecutor() = default;
CppCheckExecutor();
CppCheckExecutor(const CppCheckExecutor &) = delete;
void operator=(const CppCheckExecutor&) = delete;
/**
* Destructor
*/
~CppCheckExecutor() override;
/**
* Starts the checking.
*
@ -63,6 +68,36 @@ public:
*/
int check(int argc, const char* const argv[]);
/**
* Information about progress is directed here. This should be
* called by the CppCheck class only.
*
* @param outmsg Progress message e.g. "Checking main.cpp..."
*/
void reportOut(const std::string &outmsg, Color c = Color::Reset) override;
/** xml output of errors */
void reportErr(const ErrorMessage &msg) override;
void reportProgress(const std::string &filename, const char stage[], const std::size_t value) override;
/**
* Output information messages.
*/
void reportInfo(const ErrorMessage &msg) override;
void bughuntingReport(const std::string &str) override;
/**
* Information about how many files have been checked
*
* @param fileindex This many files have been checked.
* @param filecount This many files there are in total.
* @param sizedone The sum of sizes of the files checked.
* @param sizetotal The total sizes of the files.
*/
static void reportStatus(std::size_t fileindex, std::size_t filecount, std::size_t sizedone, std::size_t sizetotal);
/**
* @param exceptionOutput Output file
*/
@ -72,16 +107,43 @@ public:
*/
static FILE* getExceptionOutput();
private:
/**
* Tries to load a library and prints warning/error messages
* @return false, if an error occurred (except unknown XML elements)
*/
static bool tryLoadLibrary(Library& destination, const std::string& basepath, const char* filename);
/**
* Execute a shell command and read the output from it. Returns exitcode of the executed command,.
* Execute a shell command and read the output from it. Returns true if command terminated successfully.
*/
static int executeCommand(std::string exe, std::vector<std::string> args, std::string redirect, std::string &output_);
static bool executeCommand(std::string exe, std::vector<std::string> args, const std::string &redirect, std::string *output_);
protected:
static bool reportSuppressions(const Settings &settings, bool unusedFunctionCheckEnabled, const std::list<std::pair<std::string, std::size_t>> &files, ErrorLogger& errorLogger);
/**
* Helper function to print out errors. Appends a line change.
* @param errmsg String printed to error stream
*/
void reportErr(const std::string &errmsg);
/**
* @brief Parse command line args and get settings and file lists
* from there.
*
* @param cppcheck cppcheck instance
* @param argc argc from main()
* @param argv argv from main()
* @return false when errors are found in the input
*/
bool parseFromArgs(CppCheck *cppcheck, int argc, const char* const argv[]);
/**
* Helper function to supply settings. This can be used for testing.
* @param settings Reference to an Settings instance
*/
void setSettings(const Settings &settings);
private:
/**
* Wrapper around check_internal
@ -101,24 +163,47 @@ protected:
* given value is returned instead of default 0.
* If no errors are found, 0 is returned.
*/
int check_internal(CppCheck& cppcheck) const;
int check_internal(CppCheck& cppcheck);
/**
* Pointer to current settings; set while check() is running.
*/
const Settings* mSettings;
/**
* Used to filter out duplicate error messages.
*/
std::set<std::string> mShownErrors;
/**
* Filename associated with size of file
*/
std::list<std::pair<std::string, std::size_t>> mFiles;
std::map<std::string, std::size_t> mFiles;
std::list<FileSettings> mFileSettings;
/**
* Report progress time
*/
std::time_t mLatestProgressOutputTime;
#if defined(USE_WINDOWS_SEH) || defined(USE_UNIX_SIGNAL_HANDLING)
/**
* Output file name for exception handler
*/
static FILE* mExceptionOutput;
#endif
class StdLogger;
StdLogger* mStdLogger{};
/**
* Error output
*/
std::ofstream *mErrorOutput;
/**
* Bug hunting report
*/
std::ostream *mBugHuntingReport;
/**
* Has --errorlist been given?
*/
bool mShowAllErrors;
};
#endif // CPPCHECKEXECUTOR_H

View File

@ -1,267 +0,0 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2023 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cppcheckexecutorseh.h"
#ifdef USE_WINDOWS_SEH
#include "cppcheckexecutor.h"
#include "utils.h"
#include <windows.h>
#include <dbghelp.h>
#include <tchar.h>
namespace {
const ULONG maxnamelength = 512;
struct IMAGEHLP_SYMBOL64_EXT : public IMAGEHLP_SYMBOL64 {
TCHAR nameExt[maxnamelength]; // actually no need to worry about character encoding here
};
typedef BOOL (WINAPI *fpStackWalk64)(DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID, PREAD_PROCESS_MEMORY_ROUTINE64, PFUNCTION_TABLE_ACCESS_ROUTINE64, PGET_MODULE_BASE_ROUTINE64, PTRANSLATE_ADDRESS_ROUTINE64);
fpStackWalk64 pStackWalk64;
typedef DWORD64 (WINAPI *fpSymGetModuleBase64)(HANDLE, DWORD64);
fpSymGetModuleBase64 pSymGetModuleBase64;
typedef BOOL (WINAPI *fpSymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
fpSymGetSymFromAddr64 pSymGetSymFromAddr64;
typedef BOOL (WINAPI *fpSymGetLineFromAddr64)(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64);
fpSymGetLineFromAddr64 pSymGetLineFromAddr64;
typedef DWORD (WINAPI *fpUnDecorateSymbolName)(const TCHAR*, PTSTR, DWORD, DWORD);
fpUnDecorateSymbolName pUnDecorateSymbolName;
typedef PVOID (WINAPI *fpSymFunctionTableAccess64)(HANDLE, DWORD64);
fpSymFunctionTableAccess64 pSymFunctionTableAccess64;
typedef BOOL (WINAPI *fpSymInitialize)(HANDLE, PCSTR, BOOL);
fpSymInitialize pSymInitialize;
HMODULE hLibDbgHelp;
// avoid explicit dependency on Dbghelp.dll
bool loadDbgHelp()
{
hLibDbgHelp = ::LoadLibraryW(L"Dbghelp.dll");
if (!hLibDbgHelp)
return false;
pStackWalk64 = (fpStackWalk64) ::GetProcAddress(hLibDbgHelp, "StackWalk64");
pSymGetModuleBase64 = (fpSymGetModuleBase64) ::GetProcAddress(hLibDbgHelp, "SymGetModuleBase64");
pSymGetSymFromAddr64 = (fpSymGetSymFromAddr64) ::GetProcAddress(hLibDbgHelp, "SymGetSymFromAddr64");
pSymGetLineFromAddr64 = (fpSymGetLineFromAddr64)::GetProcAddress(hLibDbgHelp, "SymGetLineFromAddr64");
pSymFunctionTableAccess64 = (fpSymFunctionTableAccess64)::GetProcAddress(hLibDbgHelp, "SymFunctionTableAccess64");
pSymInitialize = (fpSymInitialize) ::GetProcAddress(hLibDbgHelp, "SymInitialize");
pUnDecorateSymbolName = (fpUnDecorateSymbolName)::GetProcAddress(hLibDbgHelp, "UnDecorateSymbolName");
return true;
}
void printCallstack(FILE* outputFile, PEXCEPTION_POINTERS ex)
{
if (!loadDbgHelp())
return;
const HANDLE hProcess = GetCurrentProcess();
const HANDLE hThread = GetCurrentThread();
pSymInitialize(
hProcess,
nullptr,
TRUE
);
CONTEXT context = *(ex->ContextRecord);
STACKFRAME64 stack= {0};
#ifdef _M_IX86
stack.AddrPC.Offset = context.Eip;
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Offset = context.Esp;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Offset = context.Ebp;
stack.AddrFrame.Mode = AddrModeFlat;
#else
stack.AddrPC.Offset = context.Rip;
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Offset = context.Rsp;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Offset = context.Rsp;
stack.AddrFrame.Mode = AddrModeFlat;
#endif
IMAGEHLP_SYMBOL64_EXT symbol;
symbol.SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
symbol.MaxNameLength = maxnamelength;
DWORD64 displacement = 0;
int beyond_main=-1; // emergency exit, see below
for (ULONG frame = 0; ; frame++) {
BOOL result = pStackWalk64
(
#ifdef _M_IX86
IMAGE_FILE_MACHINE_I386,
#else
IMAGE_FILE_MACHINE_AMD64,
#endif
hProcess,
hThread,
&stack,
&context,
nullptr,
pSymFunctionTableAccess64,
pSymGetModuleBase64,
nullptr
);
if (!result) // official end...
break;
pSymGetSymFromAddr64(hProcess, (ULONG64)stack.AddrPC.Offset, &displacement, &symbol);
TCHAR undname[maxnamelength]= {0};
pUnDecorateSymbolName((const TCHAR*)symbol.Name, (PTSTR)undname, (DWORD)getArrayLength(undname), UNDNAME_COMPLETE);
if (beyond_main>=0)
++beyond_main;
if (_tcscmp(undname, _T("main"))==0)
beyond_main=0;
fprintf(outputFile,
"%lu. 0x%08I64X in ",
frame, (ULONG64)stack.AddrPC.Offset);
fputs((const char *)undname, outputFile);
fputc('\n', outputFile);
if (0==stack.AddrReturn.Offset || beyond_main>2) // StackWalk64() sometimes doesn't reach any end...
break;
}
FreeLibrary(hLibDbgHelp);
hLibDbgHelp=nullptr;
}
void writeMemoryErrorDetails(FILE* outputFile, PEXCEPTION_POINTERS ex, const char* description)
{
fputs(description, outputFile);
fprintf(outputFile, " (instruction: 0x%p) ", ex->ExceptionRecord->ExceptionAddress);
// Using %p for ULONG_PTR later on, so it must have size identical to size of pointer
// This is not the universally portable solution but good enough for Win32/64
C_ASSERT(sizeof(void*) == sizeof(ex->ExceptionRecord->ExceptionInformation[1]));
switch (ex->ExceptionRecord->ExceptionInformation[0]) {
case 0:
fprintf(outputFile, "reading from 0x%p",
reinterpret_cast<void*>(ex->ExceptionRecord->ExceptionInformation[1]));
break;
case 1:
fprintf(outputFile, "writing to 0x%p",
reinterpret_cast<void*>(ex->ExceptionRecord->ExceptionInformation[1]));
break;
case 8:
fprintf(outputFile, "data execution prevention at 0x%p",
reinterpret_cast<void*>(ex->ExceptionRecord->ExceptionInformation[1]));
break;
default:
break;
}
}
/*
* Any evaluation of the exception needs to be done here!
*/
int filterException(FILE *outputFile, int code, PEXCEPTION_POINTERS ex)
{
fputs("Internal error: ", outputFile);
switch (ex->ExceptionRecord->ExceptionCode) {
case EXCEPTION_ACCESS_VIOLATION:
writeMemoryErrorDetails(outputFile, ex, "Access violation");
break;
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
fputs("Out of array bounds", outputFile);
break;
case EXCEPTION_BREAKPOINT:
fputs("Breakpoint", outputFile);
break;
case EXCEPTION_DATATYPE_MISALIGNMENT:
fputs("Misaligned data", outputFile);
break;
case EXCEPTION_FLT_DENORMAL_OPERAND:
fputs("Denormalized floating-point value", outputFile);
break;
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
fputs("Floating-point divide-by-zero", outputFile);
break;
case EXCEPTION_FLT_INEXACT_RESULT:
fputs("Inexact floating-point value", outputFile);
break;
case EXCEPTION_FLT_INVALID_OPERATION:
fputs("Invalid floating-point operation", outputFile);
break;
case EXCEPTION_FLT_OVERFLOW:
fputs("Floating-point overflow", outputFile);
break;
case EXCEPTION_FLT_STACK_CHECK:
fputs("Floating-point stack overflow", outputFile);
break;
case EXCEPTION_FLT_UNDERFLOW:
fputs("Floating-point underflow", outputFile);
break;
case EXCEPTION_GUARD_PAGE:
fputs("Page-guard access", outputFile);
break;
case EXCEPTION_ILLEGAL_INSTRUCTION:
fputs("Illegal instruction", outputFile);
break;
case EXCEPTION_IN_PAGE_ERROR:
writeMemoryErrorDetails(outputFile, ex, "Invalid page access");
break;
case EXCEPTION_INT_DIVIDE_BY_ZERO:
fputs("Integer divide-by-zero", outputFile);
break;
case EXCEPTION_INT_OVERFLOW:
fputs("Integer overflow", outputFile);
break;
case EXCEPTION_INVALID_DISPOSITION:
fputs("Invalid exception dispatcher", outputFile);
break;
case EXCEPTION_INVALID_HANDLE:
fputs("Invalid handle", outputFile);
break;
case EXCEPTION_NONCONTINUABLE_EXCEPTION:
fputs("Non-continuable exception", outputFile);
break;
case EXCEPTION_PRIV_INSTRUCTION:
fputs("Invalid instruction", outputFile);
break;
case EXCEPTION_SINGLE_STEP:
fputs("Single instruction step", outputFile);
break;
case EXCEPTION_STACK_OVERFLOW:
fputs("Stack overflow", outputFile);
break;
default:
fprintf(outputFile, "Unknown exception (%d)\n",
code);
break;
}
fputc('\n', outputFile);
printCallstack(outputFile, ex);
fflush(outputFile);
return EXCEPTION_EXECUTE_HANDLER;
}
}
/**
* Signal/SEH handling
* Has to be clean for using with SEH on windows, i.e. no construction of C++ object instances is allowed!
* TODO Check for multi-threading issues!
*
*/
int check_wrapper_seh(CppCheckExecutor& executor, int (CppCheckExecutor::*f)(CppCheck&) const, CppCheck& cppcheck)
{
FILE *outputFile = CppCheckExecutor::getExceptionOutput();
__try {
return (&executor->*f)(cppcheck);
} __except (filterException(outputFile, GetExceptionCode(), GetExceptionInformation())) {
fputs("Please report this to the cppcheck developers!\n", outputFile);
return -1;
}
}
#endif

View File

@ -1,33 +0,0 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2023 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPPCHECKEXECUTORSEH_H
#define CPPCHECKEXECUTORSEH_H
#include "config.h" // IWYU pragma: keep
#ifdef USE_WINDOWS_SEH
class CppCheckExecutor;
class CppCheck;
int check_wrapper_seh(CppCheckExecutor& executor, int (CppCheckExecutor::*f)(CppCheck&) const, CppCheck& cppcheck);
#endif
#endif // CPPCHECKEXECUTORSEH_H

View File

@ -1,327 +0,0 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2023 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cppcheckexecutorsig.h"
#if defined(USE_UNIX_SIGNAL_HANDLING)
#include "cppcheckexecutor.h"
#ifdef USE_UNIX_BACKTRACE_SUPPORT
#include "stacktrace.h"
#endif
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <cstring>
//#include <features.h> // __USE_DYNAMIC_STACK_SIZE
#include <map>
#include <string>
#include <unistd.h>
#include <utility>
#if defined(__linux__) && defined(REG_ERR)
#include <sys/syscall.h>
#endif
#if defined(__APPLE__)
# define _XOPEN_SOURCE // ucontext.h APIs can only be used on Mac OSX >= 10.7 if _XOPEN_SOURCE is defined
# include <ucontext.h>
# undef _XOPEN_SOURCE
#elif !defined(__OpenBSD__) && !defined(__HAIKU__)
# include <ucontext.h>
#endif
// TODO: __USE_DYNAMIC_STACK_SIZE is dependent on the features.h include and not a built-in compiler define, so it might be problematic to depend on it
#ifdef __USE_DYNAMIC_STACK_SIZE
static constexpr size_t MYSTACKSIZE = 16*1024+32768; // wild guess about a reasonable buffer
#else
static constexpr size_t MYSTACKSIZE = 16*1024+SIGSTKSZ; // wild guess about a reasonable buffer
#endif
static char mytstack[MYSTACKSIZE]= {0}; // alternative stack for signal handler
static bool bStackBelowHeap=false; // lame attempt to locate heap vs. stack address space. See CppCheckExecutor::check_wrapper()
/**
* \param[in] ptr address to be examined.
* \return true if address is supposed to be on stack (contrary to heap). If ptr is 0 false will be returned.
* If unknown better return false.
*/
static bool IsAddressOnStack(const void* ptr)
{
if (nullptr==ptr)
return false;
char a;
if (bStackBelowHeap)
return ptr < &a;
return ptr > &a;
}
/* (declare this list here, so it may be used in signal handlers in addition to main())
* A list of signals available in ISO C
* Check out http://pubs.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html
* For now we only want to detect abnormal behaviour for a few selected signals:
*/
#define DECLARE_SIGNAL(x) std::make_pair(x, #x)
using Signalmap_t = std::map<int, std::string>;
static const Signalmap_t listofsignals = {
DECLARE_SIGNAL(SIGABRT),
DECLARE_SIGNAL(SIGBUS),
DECLARE_SIGNAL(SIGFPE),
DECLARE_SIGNAL(SIGILL),
DECLARE_SIGNAL(SIGINT),
DECLARE_SIGNAL(SIGQUIT),
DECLARE_SIGNAL(SIGSEGV),
DECLARE_SIGNAL(SIGSYS),
// don't care: SIGTERM
DECLARE_SIGNAL(SIGUSR1),
//DECLARE_SIGNAL(SIGUSR2) no usage currently
};
#undef DECLARE_SIGNAL
/*
* Entry pointer for signal handlers
* It uses functions which are not safe to be called from a signal handler,
* (http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04 has a whitelist)
* but when ending up here something went terribly wrong anyway.
* And all which is left is just printing some information and terminate.
*/
// cppcheck-suppress constParameterCallback
static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
{
int type = -1;
pid_t killid;
// TODO: separate these two defines
#if defined(__linux__) && defined(REG_ERR)
const ucontext_t* const uc = reinterpret_cast<const ucontext_t*>(context);
killid = (pid_t) syscall(SYS_gettid);
if (uc) {
type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2;
}
#else
(void)context;
killid = getpid();
#endif
const Signalmap_t::const_iterator it=listofsignals.find(signo);
const char * const signame = (it==listofsignals.end()) ? "unknown" : it->second.c_str();
#ifdef USE_UNIX_BACKTRACE_SUPPORT
bool lowMem=false; // was low-memory condition detected? Be careful then! Avoid allocating much more memory then.
#endif
bool unexpectedSignal=true; // unexpected indicates program failure
bool terminate=true; // exit process/thread
const bool isAddressOnStack = IsAddressOnStack(info->si_addr);
FILE* output = CppCheckExecutor::getExceptionOutput();
switch (signo) {
case SIGABRT:
fputs("Internal error: cppcheck received signal ", output);
fputs(signame, output);
fputs(
#ifdef NDEBUG
" - out of memory?\n",
#else
" - out of memory or assertion?\n",
#endif
output);
#ifdef USE_UNIX_BACKTRACE_SUPPORT
lowMem=true; // educated guess
#endif
break;
case SIGBUS:
fputs("Internal error: cppcheck received signal ", output);
fputs(signame, output);
switch (info->si_code) {
case BUS_ADRALN: // invalid address alignment
fputs(" - BUS_ADRALN", output);
break;
case BUS_ADRERR: // nonexistent physical address
fputs(" - BUS_ADRERR", output);
break;
case BUS_OBJERR: // object-specific hardware error
fputs(" - BUS_OBJERR", output);
break;
#ifdef BUS_MCEERR_AR
case BUS_MCEERR_AR: // Hardware memory error consumed on a machine check;
fputs(" - BUS_MCEERR_AR", output);
break;
#endif
#ifdef BUS_MCEERR_AO
case BUS_MCEERR_AO: // Hardware memory error detected in process but not consumed
fputs(" - BUS_MCEERR_AO", output);
break;
#endif
default:
break;
}
fprintf(output, " (at 0x%lx).\n",
(unsigned long)info->si_addr);
break;
case SIGFPE:
fputs("Internal error: cppcheck received signal ", output);
fputs(signame, output);
switch (info->si_code) {
case FPE_INTDIV: // integer divide by zero
fputs(" - FPE_INTDIV", output);
break;
case FPE_INTOVF: // integer overflow
fputs(" - FPE_INTOVF", output);
break;
case FPE_FLTDIV: // floating-point divide by zero
fputs(" - FPE_FLTDIV", output);
break;
case FPE_FLTOVF: // floating-point overflow
fputs(" - FPE_FLTOVF", output);
break;
case FPE_FLTUND: // floating-point underflow
fputs(" - FPE_FLTUND", output);
break;
case FPE_FLTRES: // floating-point inexact result
fputs(" - FPE_FLTRES", output);
break;
case FPE_FLTINV: // floating-point invalid operation
fputs(" - FPE_FLTINV", output);
break;
case FPE_FLTSUB: // subscript out of range
fputs(" - FPE_FLTSUB", output);
break;
default:
break;
}
fprintf(output, " (at 0x%lx).\n",
(unsigned long)info->si_addr);
break;
case SIGILL:
fputs("Internal error: cppcheck received signal ", output);
fputs(signame, output);
switch (info->si_code) {
case ILL_ILLOPC: // illegal opcode
fputs(" - ILL_ILLOPC", output);
break;
case ILL_ILLOPN: // illegal operand
fputs(" - ILL_ILLOPN", output);
break;
case ILL_ILLADR: // illegal addressing mode
fputs(" - ILL_ILLADR", output);
break;
case ILL_ILLTRP: // illegal trap
fputs(" - ILL_ILLTRP", output);
break;
case ILL_PRVOPC: // privileged opcode
fputs(" - ILL_PRVOPC", output);
break;
case ILL_PRVREG: // privileged register
fputs(" - ILL_PRVREG", output);
break;
case ILL_COPROC: // coprocessor error
fputs(" - ILL_COPROC", output);
break;
case ILL_BADSTK: // internal stack error
fputs(" - ILL_BADSTK", output);
break;
default:
break;
}
fprintf(output, " (at 0x%lx).%s\n",
(unsigned long)info->si_addr,
(isAddressOnStack)?" Stackoverflow?":"");
break;
case SIGINT:
unexpectedSignal=false; // legal usage: interrupt application via CTRL-C
fputs("cppcheck received signal ", output);
fputs(signame, output);
fputs(".\n", output);
break;
case SIGSEGV:
fputs("Internal error: cppcheck received signal ", output);
fputs(signame, output);
switch (info->si_code) {
case SEGV_MAPERR: // address not mapped to object
fputs(" - SEGV_MAPERR", output);
break;
case SEGV_ACCERR: // invalid permissions for mapped object
fputs(" - SEGV_ACCERR", output);
break;
default:
break;
}
fprintf(output, " (%sat 0x%lx).%s\n",
// cppcheck-suppress knownConditionTrueFalse ; FP
(type==-1)? "" :
(type==0) ? "reading " : "writing ",
(unsigned long)info->si_addr,
(isAddressOnStack)?" Stackoverflow?":""
);
break;
case SIGUSR1:
fputs("cppcheck received signal ", output);
fputs(signame, output);
fputs(".\n", output);
terminate=false;
break;
default:
fputs("Internal error: cppcheck received signal ", output);
fputs(signame, output);
fputs(".\n", output);
break;
}
#ifdef USE_UNIX_BACKTRACE_SUPPORT
print_stacktrace(output, true, -1, lowMem);
#endif
if (unexpectedSignal) {
fputs("\nPlease report this to the cppcheck developers!\n", output);
}
fflush(output);
if (terminate) {
// now let things proceed, shutdown and hopefully dump core for post-mortem analysis
struct sigaction act;
memset(&act, 0, sizeof(act));
act.sa_handler=SIG_DFL;
sigaction(signo, &act, nullptr);
kill(killid, signo);
}
}
int check_wrapper_sig(CppCheckExecutor& executor, int (CppCheckExecutor::*f)(CppCheck&) const, CppCheck& cppcheck)
{
// determine stack vs. heap
char stackVariable;
char *heapVariable=static_cast<char*>(malloc(1));
bStackBelowHeap = &stackVariable < heapVariable;
free(heapVariable);
// set up alternative stack for signal handler
stack_t segv_stack;
segv_stack.ss_sp = mytstack;
segv_stack.ss_flags = 0;
segv_stack.ss_size = MYSTACKSIZE;
sigaltstack(&segv_stack, nullptr);
// install signal handler
struct sigaction act;
memset(&act, 0, sizeof(act));
act.sa_flags=SA_SIGINFO|SA_ONSTACK;
act.sa_sigaction=CppcheckSignalHandler;
for (std::map<int, std::string>::const_iterator sig=listofsignals.cbegin(); sig!=listofsignals.cend(); ++sig) {
sigaction(sig->first, &act, nullptr);
}
return (executor.*f)(cppcheck);
}
#endif

Some files were not shown because too many files have changed in this diff Show More