Compare commits

..

21 Commits

Author SHA1 Message Date
Daniel Marjamäki 3e518e64d0 2.6.3: set version 2021-12-15 19:25:42 +01:00
Daniel Marjamäki 800317aad0 Fix execution of executable addons from GUI 2021-12-15 19:22:29 +01:00
Daniel Marjamäki db8d486ce4 remove --rule command 2021-11-21 14:44:09 +01:00
Daniel Marjamäki f5f0c115a2 release-windows: do not build with PCRE 2021-11-21 14:26:31 +01:00
Daniel Marjamäki 051b1bb3fe skip 'install pcre' step in windows github action, it failed because curl timed out 2021-11-21 13:40:21 +01:00
Paul Fultz II c48f97e9cc Install pcre from github since the ftp.pcre.org site is no longer available (#3546) 2021-11-21 13:35:53 +01:00
Daniel Marjamäki 51c30cf270 2.6.2: Set version 2021-11-20 08:43:47 +01:00
Daniel Marjamäki 9eb8174d90 dumpfile: remove redundant Variable attributes isArgument and isLocal. Add isVolatile. 2021-11-20 08:40:23 +01:00
Daniel Marjamäki d1d60999ad win_installer: update building. all files needed are collected in a single folder. the 'deploy' artifact will contain all the files. 2021-10-21 14:58:43 +02:00
Daniel Marjamäki 45a5ae6191 Set version 2.6.1 2021-10-21 14:57:17 +02:00
Daniel Marjamäki 328fa49981 Fixed #10529 (Cleanup dump and ctu-info files) 2021-10-21 14:48:50 +02:00
Daniel Marjamäki 3b3ae419a7 Addon; Determine proper full path for 'executable' addon 2021-10-21 14:48:43 +02:00
Daniel Marjamäki d053f8ba23 Make it possible to configure default addons in a cppcheck.cfg file.
Example:
{
    "addons":["cert"]
}

With that cppcheck.cfg file cppcheck will always run the "cert" addon. Explicit options such as --addon=cert will not be needed.
2021-10-21 14:48:37 +02:00
Daniel Marjamäki 935c9349f3 Addons; allow multiple locations in addon error message 2021-10-21 14:48:28 +02:00
Daniel Marjamäki 66a734b481 Allow compiled addons 2021-10-21 14:48:21 +02:00
Daniel Marjamäki d873b8e771 Remove -rc1 from version 2021-10-02 09:41:35 +02:00
Paul Fultz II 056a1b3313
Add release notes for the library config changes (#3471) 2021-09-28 17:51:32 +02:00
Paul Fultz II 7836eb3663
Add some release notes for some features in 2.6 (#3470) 2021-09-28 08:02:14 +02:00
Daniel Marjamäki 7a33de5aa5 Add releasenotes document in repo 2021-09-27 07:56:27 +02:00
Daniel Marjamäki 92cfdf2cb6 Makefile: Set release mode 2021-09-26 16:45:15 +02:00
Daniel Marjamäki a7fc054a8e 2.6: Set version 2021-09-26 12:09:02 +02:00
788 changed files with 155090 additions and 118211 deletions

View File

@ -1,78 +1,6 @@
--- ---
Checks: > 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,-performance-for-range-copy,-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'
*,
-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
WarningsAsErrors: '*' WarningsAsErrors: '*'
HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h'
CheckOptions: CheckOptions:
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1' value: '1'
- key: readability-simplify-boolean-expr.SimplifyDeMorgan
value: '0'

View File

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

View File

@ -1,73 +0,0 @@
# Some convenient links:
# - https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md
#
name: CI-mingw
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
defaults:
run:
shell: msys2 {0}
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]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
release: false # use pre-installed
install: >-
mingw-w64-x86_64-lld
mingw-w64-x86_64-ccache
- 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
- 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
- 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

View File

@ -2,166 +2,73 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: CI-unixish-docker name: CI-unixish-docker
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
build_cmake: build:
strategy: strategy:
matrix: matrix:
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"] image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:21.04"]
include:
- build_gui: false
- image: "ubuntu:23.10"
build_gui: true
fail-fast: false # Prefer quick result fail-fast: false # Prefer quick result
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
# TODO: is this actually applied to the guest?
env:
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros
container: container:
image: ${{ matrix.image }} image: ${{ matrix.image }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Install missing software on CentOS 7 - name: Install missing software on CentOS 7
if: matrix.image == 'centos:7' if: matrix.image == 'centos:7'
run: | run: |
yum install -y cmake gcc-c++ make pcre-devel yum install -y cmake gcc-c++ make
yum --enablerepo=extras install -y epel-release yum install -y pcre-devel
yum install -y ccache
- name: Install missing software on ubuntu - name: Install missing software on ubuntu
if: contains(matrix.image, 'ubuntu') if: matrix.image != 'centos:7'
run: | run: |
apt-get update 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 # tests require CMake 3.4
if: matrix.build_gui - name: Test CMake build (no tests)
run: | if: matrix.image != 'ubuntu:21.04'
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'
run: | run: |
mkdir cmake.output mkdir cmake.output
cd cmake.output cd cmake.output
cmake -G "Unix Makefiles" -DHAVE_RULES=On .. cmake -G "Unix Makefiles" -DHAVE_RULES=On ..
cmake --build . -- -j$(nproc) make -j$(nproc)
cd ..
# tests require CMake 3.9 - ccache available - name: Test CMake build
- name: CMake build (no tests) if: matrix.image == 'ubuntu:21.04'
if: matrix.image == 'centos:7' || matrix.image == 'ubuntu:16.04'
run: | run: |
mkdir cmake.output mkdir cmake.output
cd 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 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On ..
cmake --build . -- -j$(nproc) make -j$(nproc) check
cd ..
- 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 }}
- name: Build cppcheck - name: Build cppcheck
run: | run: |
# "/usr/lib64" for centos / "/usr/lib" for ubuntu make clean
export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) HAVE_RULES=yes
make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w"
- name: Build test - name: Build test
run: | run: |
# "/usr/lib64" for centos / "/usr/lib" for ubuntu make -j$(nproc) testrunner HAVE_RULES=yes
export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w"
- name: Run test - name: Run test
run: | run: |
make -j$(nproc) check HAVE_RULES=yes make -j$(nproc) check HAVE_RULES=yes
# requires python3
- name: Run extra tests - name: Run extra tests
run: | run: |
tools/generate_and_run_more_tests.sh tools/generate_and_run_more_tests.sh
# requires which
- name: Validate - name: Validate
run: | run: |
make -j$(nproc) checkCWEEntries validateXML make -j$(nproc) checkCWEEntries validateXML
@ -170,10 +77,3 @@ jobs:
run: | run: |
./cppcheck --addon=threadsafety addons/test/threadsafety ./cppcheck --addon=threadsafety addons/test/threadsafety
./cppcheck --addon=threadsafety --std=c++03 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,412 +2,133 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: CI-unixish name: CI-unixish
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
build_cmake_tinyxml2: build:
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12] os: [ubuntu-18.04, ubuntu-20.04, macos-10.15]
include:
- use_qt6: On
- os: ubuntu-20.04
use_qt6: Off
fail-fast: false # Prefer quick result fail-fast: false # Prefer quick result
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env:
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: ccache - name: Set up Python 3.9
uses: hendrikmuhs/ccache-action@v1.2 uses: actions/setup-python@v2
with: with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} python-version: 3.9
- name: Install missing software on ubuntu - name: Cache uncrustify
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off' uses: actions/cache@v2
id: cache-uncrustify
with:
path: |
~/uncrustify
key: ${{ runner.os }}-uncrustify
- name: build uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
run: |
wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.tar.gz
tar xzvf uncrustify-0.72.0.tar.gz && cd uncrustify-uncrustify-0.72.0 && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) -s && mkdir ~/uncrustify && cp uncrustify ~/uncrustify/
- name: Install missing software on ubuntu 18.04
if: matrix.os == 'ubuntu-18.04'
run: | run: |
sudo apt-get update 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 z3 libz3-dev
cp externals/z3_version_old.h externals/z3_version.h
- name: Install missing software on ubuntu - name: Install missing software on ubuntu 20.04
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On' if: matrix.os == 'ubuntu-20.04'
run: | run: |
sudo apt-get update sudo apt-get update
# qt6-tools-dev-tools for lprodump sudo apt-get install libxml2-utils
# qt6-l10n-tools for lupdate sudo apt-get install z3 libz3-dev
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
# coreutils contains "nproc"
- name: Install missing software on macos - name: Install missing software on macos
if: contains(matrix.os, 'macos') if: contains(matrix.os, 'macos')
run: | run: |
# pcre was removed from runner images in November 2022 brew install coreutils z3
brew install coreutils qt@6 tinyxml2 pcre cp externals/z3_version_old.h externals/z3_version.h
- name: CMake build on ubuntu (with GUI / system tinyxml2) - name: Install missing Python packages
run: |
python -m pip install pip --upgrade
python -m pip install pytest
- name: Install Qt
if: contains(matrix.os, 'ubuntu') if: contains(matrix.os, 'ubuntu')
run: | uses: jurplel/install-qt-action@v2
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)
- name: Run CMake test (system tinyxml2)
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: with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} modules: 'qtcharts'
- name: Install missing software on ubuntu - name: Uncrustify check
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off'
run: | run: |
sudo apt-get update ~/uncrustify/uncrustify -c .uncrustify.cfg -l CPP --check */*.cpp */*.h
sudo apt-get install libxml2-utils qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
# TODO: move latest compiler to separate step - name: Test CMake build
# 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: | run: |
echo "CXX=g++-13" >> $GITHUB_ENV mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On ..
make -j$(nproc) check
cd ..
- name: Install missing software on ubuntu - name: Build and test with Unsigned char
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On'
run: | run: |
sudo apt-get update make clean
# 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)
- 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)
- name: Run CMake test
run: |
cmake --build cmake.output --target check -- -j$(nproc)
- name: Run CTest
run: |
pushd cmake.output
ctest --output-on-failure -j$(nproc)
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')
run: |
brew install coreutils
- name: Build with Unsigned char
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) CXXFLAGS=-funsigned-char testrunner make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
- name: Test with Unsigned char
run: |
./testrunner TestSymbolDatabase ./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 - name: Check syntax with NONNEG
run: | run: |
ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG 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 - name: Build cppcheck
run: | run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make clean
make -j$(nproc) HAVE_RULES=yes make -j$(nproc) USE_Z3=yes HAVE_RULES=yes
- name: Build test - name: Build test
run: | run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) testrunner USE_Z3=yes HAVE_RULES=yes
make -j$(nproc) testrunner HAVE_RULES=yes
- name: Run test - name: Run test
run: | 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 - name: Run extra tests
if: contains(matrix.os, 'ubuntu')
run: | run: |
tools/generate_and_run_more_tests.sh 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 - name: Run test/cli
run: | run: |
cd test/cli cd test/cli
python3 -m pytest -Werror --strict-markers -vv test-*.py pytest test-*.py
cd ../../.. cd ../../..
ln -s cppcheck 'cpp check' ln -s cppcheck 'cpp check'
cd 'cpp check/test/cli' cd 'cpp check/test/cli'
python3 -m pytest -Werror --strict-markers -vv test-*.py pytest test-*.py
# fails on macos since some includes (e.g. sys/epoll.h) are not available
- name: Run cfg tests - name: Run cfg tests
if: matrix.os != 'ubuntu-22.04' if: contains(matrix.os, 'ubuntu')
run: | run: |
make -j$(nproc) checkcfg make -j$(nproc) checkcfg
- name: Run cfg tests (strict) # it seems macos has no "wc" command
if: matrix.os == 'ubuntu-22.04' - name: Run showtimetop5 tests
if: contains(matrix.os, 'ubuntu')
run: | run: |
make -j$(nproc) checkcfg ./tools/test_showtimetop5.sh
env:
STRICT: 1
- name: Run --dump test - name: Run --dump test
run: | run: |
@ -418,101 +139,67 @@ jobs:
run: | run: |
make -j$(nproc) checkCWEEntries validateXML make -j$(nproc) checkCWEEntries validateXML
# TODO: move to scriptcheck.yml so these are tested with all Python versions?
- name: Test addons - name: Test addons
run: | run: |
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety addons/test/threadsafety ./cppcheck --addon=threadsafety addons/test/threadsafety
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety --std=c++03 addons/test/threadsafety ./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra addons/test/misra/crash*.c ./cppcheck --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra --enable=information addons/test/misra/config*.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 - name: Build GUI on ubuntu
pushd addons/test if: contains(matrix.os, 'ubuntu')
# 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'
run: | 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" pushd gui
g++ $warnings -c -Ilib -Iexternals/tinyxml2 democlient/democlient.cpp qmake HAVE_QCHART=yes
make -j$(nproc)
selfcheck: - name: Run GUI tests on ubuntu
needs: build # wait for all tests to be successful first if: contains(matrix.os, 'ubuntu')
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
run: | run: |
sudo apt-get update pushd gui/test/projectfile
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev libboost-container-dev qmake
make -j$(nproc)
./test-projectfile
popd
pushd gui/test/cppchecklibrarydata
qmake
make -j$(nproc)
./test-cppchecklibrarydata
- name: Self check (build) - name: Generate Qt help file on ubuntu
if: contains(matrix.os, 'ubuntu')
run: | run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" pushd gui/help
# compile with verification and ast matchers qhelpgenerator online-help.qhcp -o online-help.qhc
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
# Run self check after "Build GUI" to include generated headers in analysis
- name: Self check - name: Self check
if: matrix.os == 'ubuntu-20.04'
run: | 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" # compile with verification and ast matchers
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2" make clean
ec=0 make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2" MATCHCOMPILER=yes VERIFY=1
# 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 # self check lib/cli
mkdir b1 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,internal --exception-handling --debug-warnings cli lib
# check gui with qt settings # check gui with qt settings
mkdir b2 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 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt --addon=naming.json -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings gui/*.cpp
# self check test and tools # 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__ --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
# 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 - name: Build triage on ubuntu
exit $ec if: matrix.os == 'ubuntu-20.04'
run: |
pushd tools/triage
qmake
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

View File

@ -4,204 +4,139 @@
name: CI-windows name: CI-windows
on: on: [push,pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
defaults: defaults:
run: run:
shell: cmd shell: cmd
# TODO: choose/add a step to bail out on compiler warnings (maybe even the release build)
jobs: 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: build:
strategy: strategy:
matrix: matrix:
os: [windows-2019, windows-2022] # windows 2016 should default to VS 2017. Not supported by setup-msbuild
config: [debug, release] os: [windows-2019]
arch: [x64, x86]
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env:
# see https://www.pcre.org/original/changelog.txt
PCRE_VERSION: 8.45
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Set up Python 3.12 - name: Set up Python 3.9
if: matrix.config == 'release' uses: actions/setup-python@v2
uses: actions/setup-python@v4
with: with:
python-version: '3.12' python-version: 3.9
check-latest: true
- name: Set up Visual Studio environment - name: Setup msbuild.exe
uses: ilammy/msvc-dev-cmd@v1 uses: microsoft/setup-msbuild@v1.0.2
with:
arch: x64
- name: Cache PCRE
id: cache-pcre
uses: actions/cache@v3
with:
path: |
externals\pcre.h
externals\pcre.lib
externals\pcre64.lib
key: pcre-${{ env.PCRE_VERSION }}-x64-bin-win
- name: Download PCRE
if: steps.cache-pcre.outputs.cache-hit != 'true'
run: |
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
- name: Install PCRE - name: Install PCRE
if: steps.cache-pcre.outputs.cache-hit != 'true' if: false
run: | run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
curl -fsSL https://ftp.pcre.org/pub/pcre/pcre-%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel! 7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
cd pcre-%PCRE_VERSION% || 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! 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! nmake || exit /b !errorlevel!
copy pcre.h ..\externals || 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: env:
# see https://www.pcre.org/original/changelog.txt
PCRE_VERSION: 8.44
CL: /MP CL: /MP
- name: Install missing Python packages - name: Install Z3 library
if: matrix.config == 'release'
run: | run: |
python -m pip install pip --upgrade || exit /b !errorlevel! curl -fsSL https://github.com/Z3Prover/z3/releases/download/z3-%Z3_VERSION%/z3-%Z3_VERSION%-${{ matrix.arch }}-win.zip -o z3-%Z3_VERSION%-win.zip || exit /b !errorlevel!
python -m pip install pytest || exit /b !errorlevel! 7z x z3-%Z3_VERSION%-win.zip -oexternals -r -y || exit /b !errorlevel!
python -m pip install pytest-custom_exit_code || exit /b !errorlevel! move externals\z3-%Z3_VERSION%-${{ matrix.arch }}-win externals\z3 || exit /b !errorlevel!
python -m pip install pytest-timeout || exit /b !errorlevel! env:
# see https://github.com/Z3Prover/z3/releases:
Z3_VERSION: 4.8.10
- name: Run CMake # no 32-bit Qt available
if: false # TODO: enable - name: Install Qt
if: matrix.arch == 'x64'
uses: jurplel/install-qt-action@v2
with:
modules: 'qtcharts'
- name: Install missing Python packages
run: | run: |
cmake -S . -B build -DBUILD_TESTS=On || exit /b !errorlevel! python -m pip install pip --upgrade
python -m pip install pytest
python -m pip install pytest-custom_exit_code
- name: Build GUI release
if: matrix.arch == 'x64'
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
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.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: Configure MSBuild
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || 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 ..
- name: Build CLI debug configuration using MSBuild - name: Build CLI debug configuration using MSBuild
if: matrix.config == 'debug'
run: | run: |
:: cmake --build build --target check --config Debug || exit /b !errorlevel! call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel! set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" (
- name: Run Debug test set ARCH=Win32
if: matrix.config == 'debug' )
run: .\bin\debug\testrunner.exe || exit /b !errorlevel! cmake --build build --target check --config Debug
- name: Build CLI release configuration using MSBuild - name: Build CLI release configuration using MSBuild
if: matrix.config == 'release'
run: | run: |
:: cmake --build build --target check --config Release || exit /b !errorlevel! call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel! set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" (
- name: Run Release test set ARCH=Win32
if: matrix.config == 'release' )
run: .\bin\testrunner.exe || exit /b !errorlevel! cmake --build build --target check --config Release
- name: Run test/cli - name: Run test/cli
if: matrix.config == 'release'
run: | run: |
:: since FILESDIR is not set copy the binary to the root so the addons are found :: 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 .\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! 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 --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 test-helloworld.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-inline-suppress.py || exit /b !errorlevel! python -m pytest test-inline-suppress.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-more-projects.py || exit /b !errorlevel! python -m pytest test-more-projects.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-other.py || exit /b !errorlevel! python -m pytest test-proj2.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-proj2.py || exit /b !errorlevel! python -m pytest test-suppress-syntaxError.py || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv test-suppress-syntaxError.py || exit /b !errorlevel!
- name: Test addons - name: Test addons
if: matrix.config == 'release'
run: | run: |
.\cppcheck --addon=threadsafety addons\test\threadsafety || exit /b !errorlevel! .\cppcheck.exe --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c
.\cppcheck --addon=threadsafety --std=c++03 addons\test\threadsafety || exit /b !errorlevel!
.\cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c || exit /b !errorlevel!
cd addons\test cd addons\test
rem We'll force C89 standard to enable an additional verification for ..\..\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
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!

View File

@ -2,122 +2,43 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: address sanitizer name: address sanitizer
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
env: env:
QT_VERSION: 5.15.2
ASAN_OPTIONS: detect_stack_use_after_return=1 ASAN_OPTIONS: detect_stack_use_after_return=1
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- 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 - name: Install missing software on ubuntu
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils sudo apt-get install libz3-4 libz3-dev
- name: Install clang - name: Build
run: | run: make -j$(nproc) cppcheck testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes VERIFY=1
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
env: env:
CC: clang-17 CC: clang
CXX: clang++-17 CXX: clang++
CXXFLAGS: "-fsanitize=address -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG"
- name: Build cppcheck CPPFLAGS: "-DCHECK_INTERNAL"
run: |
cmake --build cmake.output --target cppcheck -- -j $(nproc)
- name: Build test
run: |
cmake --build cmake.output --target testrunner -- -j $(nproc)
- name: Run tests - name: Run tests
run: ./cmake.output/bin/testrunner run: ./testrunner
- name: Run cfg tests # Does not work
run: | # - name: Self check
cmake --build cmake.output --target checkcfg -- -j $(nproc) # 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 # This takes too long time right now
- name: Run CTest # - name: Bughunting lib
if: false # run: ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib
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: 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

View File

@ -1,22 +1,12 @@
name: Build manual name: Build manual
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
convert_via_pandoc: convert_via_pandoc:
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- run: | - run: |
mkdir output mkdir output
@ -24,35 +14,12 @@ jobs:
- uses: docker://pandoc/latex:2.9 - uses: docker://pandoc/latex:2.9
with: with:
args: --output=output/manual.html man/manual.md args: --output=output/manual.html man/manual.md
- uses: docker://pandoc/latex:2.9 - uses: docker://pandoc/latex:2.9
with: with:
args: --output=output/manual.pdf man/manual.md args: --output=output/manual.pdf man/manual.md
- uses: docker://pandoc/latex:2.9 - uses: actions/upload-artifact@v2
with:
args: --output=output/manual-premium.pdf man/manual-premium.md
- uses: actions/upload-artifact@v3
with: with:
name: output name: output
path: 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,72 +2,47 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: clang-tidy name: clang-tidy
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
env: container:
QT_VERSION: 6.6.0 image: "ubuntu:21.04"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Install missing software - name: Install missing software
run: | run: |
sudo apt-get update apt-get update
sudo apt-get install -y cmake make apt-get install -y cmake g++ make
sudo apt-get install -y libpcre3-dev apt-get install -y z3 libz3-dev
sudo apt-get install -y libffi7 # work around missing dependency for Qt install step apt-get install -y libpcre3-dev
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y clang-tidy-12
- name: Install clang # uses "sudo" internally which is not available on docker by default
run: | #- name: Install Qt
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14 # uses: jurplel/install-qt-action@v2
wget https://apt.llvm.org/llvm.sh # with:
chmod +x llvm.sh # modules: 'qtcharts'
sudo ./llvm.sh 17
sudo apt-get install -y clang-tidy-17
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
- name: Verify clang-tidy configuration
run: |
clang-tidy-17 --verify-config
- name: Prepare CMake - name: Prepare CMake
run: | 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 mkdir cmake.output
env: cd cmake.output
CC: clang-17 # cannot include GUI since we need to generate the ui_*.h files first
CXX: clang++-17 cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=Off -DWITH_QCHART=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 sure the auto-generated GUI sources exist
make -C cmake.output autogen
- name: Clang-Tidy - name: Clang-Tidy
run: | run: |
# make sure the precompiled headers exist
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
cmake --build cmake.output --target run-clang-tidy 2> /dev/null cmake --build cmake.output --target run-clang-tidy 2> /dev/null

View File

@ -1,22 +1,11 @@
name: "CodeQL" name: "CodeQL"
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
security-events: write
jobs: jobs:
analyze: analyze:
name: Analyze name: Analyze
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
strategy: strategy:
fail-fast: false fail-fast: false
@ -29,16 +18,17 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v2
- name: Install missing software on ubuntu - name: Install missing software on ubuntu
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install libxml2-utils sudo apt-get install libxml2-utils
sudo apt-get install libz3-dev libz3-4
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v2 uses: github/codeql-action/init@v1
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # 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 setup-python-dependencies: false
- run: | - run: |
make -j$(nproc) HAVE_RULES=yes cppcheck make -j$(nproc) USE_Z3=yes HAVE_RULES=yes cppcheck
- name: Perform CodeQL Analysis - 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 # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: Coverage name: Coverage
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ runner.os }}
- name: Install missing software on ubuntu - name: Install missing software on ubuntu
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install libxml2-utils lcov sudo apt-get install libxml2-utils
sudo apt-get install libz3-dev libz3-4
- name: Install missing Python packages on ubuntu sudo apt-get install lcov
run: | sudo apt-get install libcppunit-dev
python -m pip install pip --upgrade python -m pip install pip --upgrade
python -m pip install lcov_cobertura python -m pip install lcov_cobertura
- name: Compile instrumented - name: Compile instrumented
run: | run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) test CXXFLAGS="-g -fprofile-arcs -ftest-coverage" USE_Z3=yes HAVE_RULES=yes
make -j$(nproc) all CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes
- name: Run instrumented tests
run: |
./testrunner
test/cfg/runtests.sh
- name: Generate coverage report - name: Generate coverage report
run: | run: |
rm -rf coverage_report
./testrunner
test/cfg/runtests.sh
gcov lib/*.cpp -o lib/ gcov lib/*.cpp -o lib/
lcov --directory ./ --capture --output-file lcov_tmp.info -b ./ lcov --directory ./ --capture --output-file lcov_tmp.info -b ./
lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info
genhtml lcov.info -o coverage_report --frame --legend --demangle-cpp genhtml lcov.info -o coverage_report --frame --legend --demangle-cpp
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v2
with: with:
name: Coverage results name: Coverage results
path: coverage_report path: coverage_report
- uses: codecov/codecov-action@v3 - uses: codecov/codecov-action@v1.2.1
with: with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
# file: ./coverage.xml # optional # 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

@ -1,47 +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: format
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Cache uncrustify
uses: actions/cache@v3
id: cache-uncrustify
with:
path: |
~/uncrustify
key: ${{ runner.os }}-uncrustify
- name: build uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
run: |
wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.tar.gz
tar xzvf uncrustify-0.72.0.tar.gz && cd uncrustify-uncrustify-0.72.0
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -- -j$(nproc) -s
mkdir ~/uncrustify
cd build && 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

View File

@ -1,168 +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: include-what-you-use
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
permissions:
contents: read
jobs:
iwyu:
strategy:
matrix:
image: ["fedora:latest"] # "debian:unstable" / "archlinux:latest"
runs-on: ubuntu-22.04
container:
image: "fedora:latest"
steps:
- uses: actions/checkout@v3
# 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')
run: |
apt-get update
apt-get install -y cmake g++ make 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
- 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
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
- 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
- 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()
with:
name: Qt Mappings
path: ./qt5.imp
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: Logs (include-what-you-use)
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 * * *' - cron: '0 0 * * *'
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
defaults: defaults:
run: run:
shell: cmd shell: cmd
@ -23,147 +20,103 @@ jobs:
build: build:
runs-on: windows-2022 runs-on: windows-2019
env:
# see https://www.pcre.org/original/changelog.txt
PCRE_VERSION: 8.45
QT_VERSION: 5.15.2
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Set up Visual Studio environment - name: Setup msbuild.exe
uses: ilammy/msvc-dev-cmd@v1 uses: microsoft/setup-msbuild@v1.0.2
- name: Cache PCRE
id: cache-pcre
uses: actions/cache@v3
with:
path: |
externals\pcre.h
externals\pcre64.lib
key: pcre-${{ env.PCRE_VERSION }}-bin-x64-win-release-job
- name: Download PCRE
if: steps.cache-pcre.outputs.cache-hit != 'true'
run: |
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
- name: Install PCRE - name: Install PCRE
if: steps.cache-pcre.outputs.cache-hit != 'true' if: false
run: | run: |
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel! curl -fsSL https://ftp.pcre.org/pub/pcre/pcre-8.44.zip -o pcre-8.44.zip
cd pcre-%PCRE_VERSION% || exit /b !errorlevel! 7z x pcre-8.44.zip
cmake . -G "Visual Studio 17 2022" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF || exit /b !errorlevel! cd pcre-8.44
msbuild -m PCRE.sln -p:Configuration=Release -p:Platform=x64 || exit /b !errorlevel! cmake . -G "Visual Studio 16 2019" -A x64
copy pcre.h ..\externals || exit /b !errorlevel! msbuild -m PCRE.sln /p:Configuration=Release /p:Platform=x64
copy Release\pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel! dir
dir Release
dir x64
dir x64\Release
copy pcre.h ..\externals
copy Release\pcre.lib ..\externals\pcre64.lib
# available modules: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-modules - name: Install Z3 library
# available tools: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-tools run: |
- name: Install Qt ${{ env.QT_VERSION }} curl -fsSL https://github.com/Z3Prover/z3/releases/download/z3-4.8.7/z3-4.8.7-x64-win.zip -o z3-4.8.7-win.zip
uses: jurplel/install-qt-action@v3 7z x z3-4.8.7-win.zip -oexternals -r -y
move externals\z3-4.8.7-x64-win externals\z3
- name: Install Qt
uses: jurplel/install-qt-action@v2
with: with:
version: ${{ env.QT_VERSION }} version: '5.15.2'
modules: 'qtcharts' modules: 'qtcharts qthelp'
tools: 'tools_opensslv3_x64'
cache: true
- name: Create .qm - name: Create .qm
run: | run: |
cd gui || exit /b !errorlevel! cd gui
lupdate gui.pro -no-obsolete || exit /b !errorlevel! lupdate gui.pro
lrelease gui.pro -removeidentical || exit /b !errorlevel! lrelease gui.pro -removeidentical
- name: Matchcompiler - 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 - name: Build x64 release GUI
run: | run: |
cd gui || exit /b !errorlevel! call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
qmake HAVE_QCHART=yes || exit /b !errorlevel! cd gui
nmake release || exit /b !errorlevel! qmake HAVE_QCHART=yes
nmake release
env: env:
CL: /MP CL: /MP
- name: Deploy app - name: Deploy app
run: | run: |
windeployqt Build\gui || exit /b !errorlevel! windeployqt Build\gui
del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel! del Build\gui\cppcheck-gui.ilk
del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel! del Build\gui\cppcheck-gui.pdb
# TODO: build with boost enabled
- name: Build CLI x64 release configuration using MSBuild - name: Build CLI x64 release configuration using MSBuild
run: msbuild -m cppcheck.sln -t:cli -p:Configuration=Release-PCRE -p:Platform=x64 || exit /b !errorlevel! run: msbuild -m cppcheck.sln /t:cli /p:Configuration=Release /p:Platform=x64
- 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!
- name: Collect files - name: Collect files
run: | run: |
move Build\gui win_installer\files || exit /b !errorlevel! move Build\gui win_installer\files
mkdir win_installer\files\addons || exit /b !errorlevel! mkdir win_installer\files\addons
copy addons\*.* win_installer\files\addons || exit /b !errorlevel! copy addons\*.* win_installer\files\addons
copy addons\dist\misra\*.* win_installer\files\addons || exit /b !errorlevel! mkdir win_installer\files\cfg
mkdir win_installer\files\cfg || exit /b !errorlevel! copy cfg\*.cfg win_installer\files\cfg
copy cfg\*.cfg win_installer\files\cfg || exit /b !errorlevel! mkdir win_installer\files\platforms
:: "platforms" is a folder used by Qt as well so it already exists copy platforms\*.xml win_installer\files\platforms
:: mkdir win_installer\files\platforms || exit /b !errorlevel! copy bin\cppcheck.exe win_installer\files
copy platforms\*.xml win_installer\files\platforms || exit /b !errorlevel! copy bin\cppcheck-core.dll win_installer\files
copy bin\cppcheck.exe win_installer\files || exit /b !errorlevel! copy externals\z3\bin\libz3.dll win_installer\files
copy bin\cppcheck-core.dll win_installer\files || exit /b !errorlevel! mkdir win_installer\files\help
mkdir win_installer\files\help || exit /b !errorlevel! xcopy /s gui\help win_installer\files\help
xcopy /s gui\help win_installer\files\help || exit /b !errorlevel! del win_installer\files\translations\*.qm
del win_installer\files\translations\*.qm || exit /b !errorlevel! move gui\*.qm win_installer\files\translations
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!
- name: Build Installer - name: Build Installer
run: | 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 REM Read ProductVersion
for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a
REM Remove double quotes REM Remove double quotes
set PRODUCTVER=%PRODUCTVER:"=% set PRODUCTVER=%PRODUCTVER:"=%
echo ProductVersion="%PRODUCTVER%" || exit /b !errorlevel! echo ProductVersion=%PRODUCTVER%
msbuild -m cppcheck.wixproj -p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }} || exit /b !errorlevel! msbuild -m cppcheck.wixproj /p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }}
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v2
with: with:
name: installer name: installer
path: win_installer/Build/ path: win_installer/Build/
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v2
with: with:
name: deploy name: deploy
path: win_installer\files 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,24 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: scriptcheck name: scriptcheck
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
build: 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 }}
- name: Cache Cppcheck
uses: actions/cache@v3
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"
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 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11', '3.12'] python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
include:
- python-version: '3.12'
python-latest: true
fail-fast: false fail-fast: false
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Restore Cppcheck
uses: actions/cache@v3
with:
path: cppcheck
key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }}
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install missing software on ubuntu - name: Install missing software on ubuntu
run: | run: |
@ -79,16 +30,12 @@ jobs:
if: matrix.python-version == '2.7' if: matrix.python-version == '2.7'
run: | run: |
python -m pip install pip --upgrade python -m pip install pip --upgrade
python -m pip install pathlib
python -m pip install pytest python -m pip install pytest
python -m pip install pygments python -m pip install pygments
- name: Install missing software on ubuntu (Python 3) - name: Install missing software on ubuntu (Python 3)
if: matrix.python-version != '2.7' if: matrix.python-version != '2.7'
run: | 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 sudo apt-get install shellcheck
python -m pip install pip --upgrade python -m pip install pip --upgrade
python -m pip install natsort python -m pip install natsort
@ -101,25 +48,25 @@ jobs:
python -m pip install psutil python -m pip install psutil
- name: run Shellcheck - name: run Shellcheck
if: matrix.python-latest if: matrix.python-version == '3.9'
run: | run: |
find . -name "*.sh" | xargs shellcheck --exclude SC2002,SC2013,SC2034,SC2035,SC2043,SC2046,SC2086,SC2089,SC2090,SC2129,SC2211,SC2231 find . -name "*.sh" | xargs shellcheck --exclude SC2002,SC2013,SC2034,SC2035,SC2043,SC2046,SC2086,SC2089,SC2090,SC2129,SC2211,SC2231
- name: run pylint - name: run pylint
if: matrix.python-latest if: matrix.python-version == '3.9'
run: | run: |
echo "FIXME pylint is disabled for now because it fails to import files:" pylint --rcfile=pylintrc_travis addons/*.py
echo "FIXME addons/runaddon.py:1:0: E0401: Unable to import 'cppcheckdata' (import-error)" pylint --rcfile=pylintrc_travis htmlreport/cppcheck-htmlreport
echo "FIXME addons/runaddon.py:1:0: E0401: Unable to import 'cppcheck' (import-error)" pylint --rcfile=pylintrc_travis htmlreport/*.py
# pylint --rcfile=pylintrc_travis --jobs $(nproc) addons/*.py htmlreport/cppcheck-htmlreport htmlreport/*.py tools/*.py pylint --rcfile=pylintrc_travis tools/*.py
- name: check .json files - name: check .json files
if: matrix.python-latest if: matrix.python-version == '3.9'
run: | run: |
find . -name '*.json' | xargs -n 1 python -m json.tool > /dev/null find . -name '*.json' | xargs -n 1 python -m json.tool > /dev/null
- name: Validate - name: Validate
if: matrix.python-latest if: matrix.python-version == '3.9'
run: | run: |
make -j$(nproc) validateCFG validatePlatforms validateRules make -j$(nproc) validateCFG validatePlatforms validateRules
@ -139,18 +86,13 @@ jobs:
run: | run: |
python tools/test_matchcompiler.py 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: build cppcheck
- name: test addons
if: matrix.python-version == '3.9' || matrix.python-version == '3.10'
run: | run: |
python -m pytest --strict-markers -vv addons/test/test-*.py make -j$(nproc) -s
env:
PYTHONPATH: ./addons
- name: test addons - name: test addons
if: matrix.python-version != '3.9' && matrix.python-version != '3.10'
run: | run: |
python -m pytest -Werror --strict-markers -vv addons/test/test-*.py python -m pytest addons/test/test-*.py
env: env:
PYTHONPATH: ./addons PYTHONPATH: ./addons
@ -160,41 +102,9 @@ jobs:
cd htmlreport cd htmlreport
./check.sh ./check.sh
- name: test reduce - name: dmake
run: | if: matrix.python-version == '3.9'
python -m pytest -Werror --strict-markers -vv 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
run: | run: |
make -j$(nproc) run-dmake
git diff --exit-code git diff --exit-code

View File

@ -1,135 +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: selfcheck
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
env:
QT_VERSION: 6.6.0
steps:
- uses: actions/checkout@v3
- name: Install missing software
run: |
sudo apt-get update
sudo apt-get install libboost-container-dev
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ runner.os }}
- name: Install missing software
run: |
sudo apt-get update
sudo apt-get install clang-14 valgrind
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
# TODO: cache this - perform same build as for the other self check
- name: Self check (build)
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
# valgrind cannot handle DWARF 5 yet so force version 4
# work around performance regression with -inline-deferral
make -j$(nproc) -s CXXFLAGS="-O2 -w -DHAVE_BOOST -gdwarf-4 -mllvm -inline-deferral" MATCHCOMPILER=yes
env:
CC: clang-14
CXX: clang++-14
- 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
- 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 test/CMakeFiles/testrunner.dir/cmake_pch.hxx.cxx
# make sure auto-generated GUI files exist
make -C cmake.output autogen
make -C cmake.output gui-build-deps
# TODO: find a way to report unmatched suppressions without need to add information checks
- name: Self check (unusedFunction)
if: false # TODO: fails with preprocessorErrorDirective - see #10667
run: |
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --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
- name: Generate dependencies (no test)
run: |
# make sure the precompiled headers exist
make -C cmake.output.notest lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx
# make sure auto-generated GUI files exist
make -C cmake.output.notest autogen
make -C cmake.output.notest gui-build-deps
# TODO: find a way to report unmatched suppressions without need to add information checks
- name: Self check (unusedFunction / no test)
run: |
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --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.*

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,42 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: undefined behaviour sanitizers name: undefined behaviour sanitizers
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
env: env:
QT_VERSION: 5.15.2 UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:report_error_type=1
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- 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 - name: Install missing software on ubuntu
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils sudo apt-get install libz3-4 libz3-dev
- name: Install clang - name: Build
run: | run: make -j$(nproc) cppcheck testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes VERIFY=1
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
env: env:
CC: clang-17 CC: clang
CXX: clang++-17 CXX: clang++
CXXFLAGS: "-fsanitize=undefined -fsanitize=nullability -fno-sanitize=signed-integer-overflow -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG"
- name: Build cppcheck CPPFLAGS: "-DCHECK_INTERNAL"
run: |
cmake --build cmake.output --target cppcheck -- -j $(nproc)
- name: Build test
run: |
cmake --build cmake.output --target testrunner -- -j $(nproc)
- name: Run tests - 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 - name: Self check
run: | 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 -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_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2" ./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
ec=0 ./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
./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 # This takes too long time right now
./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 # - name: Bughunting lib
./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1 # run: ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib
./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,60 +2,51 @@
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: valgrind name: valgrind
on: on: [push, pull_request]
push:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: 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 - name: Add debug repos on ubuntu
uses: hendrikmuhs/ccache-action@v1.2 run: |
with: echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
key: ${{ github.workflow }}-${{ runner.os }} 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 - name: Install missing software
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install libxml2-utils sudo apt-get install libxml2-utils
sudo apt-get install valgrind sudo apt-get install valgrind
sudo apt-get install libboost-container-dev sudo apt-get install libz3-dev libz3-4 libz3-4-dbgsym
sudo apt-get install debuginfod sudo apt-get install libc6-dbg-amd64-cross
- name: Build cppcheck - name: Build cppcheck
run: | run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" CXXFLAGS="-O1 -g" make -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes
CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) HAVE_RULES=yes MATCHCOMPILER=yes
- name: Build test - name: Build test
run: | run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" CXXFLAGS="-O1 -g" make -j$(nproc) testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes
CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) testrunner HAVE_RULES=yes MATCHCOMPILER=yes
- name: Run valgrind - name: Run valgrind
run: | 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
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
cat memcheck.log cat memcheck.log
exit $ec
env:
DEBUGINFOD_URLS: https://debuginfod.ubuntu.com
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v2
if: success() || failure()
with: with:
name: Logs name: Logs
path: ./*.log path: ./*.log

99
.gitignore vendored
View File

@ -2,16 +2,16 @@
*.gcno *.gcno
*.o *.o
*.pyc *.pyc
/cppcheck cppcheck
/cppcheck.exe cppcheck.exe
cppcheck-core.dll cppcheck-core.dll
/dmake dmake
/dmake.exe dmake.exe
reduce reduce
reduce.exe reduce.exe
tags tags
/testrunner testrunner
/testrunner.exe testrunner.exe
tools/daca2*.html tools/daca2*.html
tools/dmake tools/dmake
tools/errmsg tools/errmsg
@ -20,9 +20,6 @@ tools/extracttests
# dump files generated by Cppcheck # dump files generated by Cppcheck
*.*.dump *.*.dump
# CTU info files generated by Cppcheck
*.*.ctu-info
# VS generated files # VS generated files
*.aps *.aps
*.idb *.idb
@ -34,17 +31,16 @@ tools/extracttests
*.sdf *.sdf
*.suo *.suo
*.user *.user
/.vs/ .vs/
UpgradeLog*.htm
# VS build folders # VS build folders
bin/ bin/
Build/ Build/
BuildTmp/ BuildTmp/
/cli/temp/ cli/temp/
ipch/ ipch/
/lib/temp/ lib/temp/
/test/temp/ test/temp/
# XCode build folders and files # XCode build folders and files
*.mode[0-9]v[0-9] *.mode[0-9]v[0-9]
@ -52,33 +48,30 @@ ipch/
build/ build/
# GUI build folders # GUI build folders
/gui/debug/ gui/debug/
/gui/release/ gui/release/
/gui/temp/ gui/temp/
/triage/temp
# Other (generated) GUI files # Other (generated) GUI files
/gui/*.qm gui/*.qm
/gui/cppcheck-gui gui/cppcheck-gui
/gui/cppcheck-gui.exe gui/cppcheck-gui.exe
/gui/gui.sln gui/gui.sln
/gui/gui.vcproj gui/gui.vcproj
/gui/help/online-help.qch gui/Makefile
/gui/help/online-help.qhc gui/Makefile.debug
/gui/Makefile gui/Makefile.release
/gui/Makefile.debug gui/qrc_gui.cpp
/gui/Makefile.release gui/test/Makefile
/gui/qrc_gui.cpp gui/test/*/Makefile
/gui/test/Makefile gui/test/*/*/Makefile
/gui/test/*/Makefile gui/test/benchmark/simple/benchmark-simple
/gui/test/*/*/Makefile gui/test/filelist/test-filelist
/gui/test/benchmark/simple/benchmark-simple gui/test/projectfile/test-projectfile
/gui/test/cppchecklibrarydata/qrc_resources.cpp gui/test/translationhandler/test-translationhandler
/gui/test/cppchecklibrarydata/test-cppchecklibrarydata gui/test/xmlreport/test-xmlreport
/gui/test/filelist/test-filelist gui/test/xmlreportv1/test-xmlreportv1
/gui/test/projectfile/test-projectfile gui/test/xmlreportv2/test-xmlreportv2
/gui/test/translationhandler/test-translationhandler
/gui/test/xmlreportv2/test-xmlreportv2
# Doxygen output folder # Doxygen output folder
doxyoutput/ doxyoutput/
@ -95,7 +88,7 @@ htmlreport/MANIFEST
*.kdev4 *.kdev4
# Common cmake build directories # Common cmake build directories
build**/ build*
# Temporal files # Temporal files
*.swp *.swp
@ -106,33 +99,25 @@ prime
parts parts
stage stage
*.snap *.snap
/snap/.snapcraft snap/.snapcraft
# Manual folder # Manual folder
/man/manual.log man/manual.log
/man/manual.tex man/manual.tex
/man/*.pdf man/*.pdf
/man/*.html man/*.html
# CLion # CLion
/.idea .idea
/.metadata/ /.metadata/
/cmake-build-* cmake-*
/.run
# clang tooling temporary files # clang tooling temporary files
.clangd/ .clangd/
.cache/
compile_commands.json compile_commands.json
# qmake # qmake
.qmake.stash /gui/.qmake.stash
#vs code #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 +0,0 @@
# we are not using all methods of their interfaces
unusedFunction:externals/*/*
# TODO: fix these
# false positive - # 10660
unusedFunction:gui/mainwindow.cpp
unusedFunction:gui/resultstree.cpp
unusedFunction:gui/codeeditor.*
# 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

View File

@ -18,7 +18,21 @@ env:
before_install: before_install:
# install needed deps # install needed deps
- travis_retry sudo apt-get update -qq - 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: matrix:
# do notify immediately about it when a job of a build fails. # do notify immediately about it when a job of a build fails.
@ -41,3 +55,75 @@ matrix:
- echo $CXXFLAGS - echo $CXXFLAGS
- make -s MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck -j$(nproc) - make -s MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck -j$(nproc)
- sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck install - 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/cert.py
- cd addons/test
- ${CPPCHECK} --dump cert-test.c
- python3 ../cert.py -verify cert-test.c.dump
- ${CPPCHECK} --dump cert-test.cpp
- python3 ../cert.py -verify cert-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 ../..
# bug hunting
- name: "bug hunting"
compiler: gcc
script:
- make clean
- make USE_Z3=yes -j$(nproc) all
- ./testrunner TestExprEngine
# FIXME: this is slowish
#- python3 test/bug-hunting/cve.py
#- git clone https://github.com/regehr/itc-benchmarks.git ~/itc
#- python3 test/bug-hunting/itc.py
#- 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
#- cd -
#- python3 test/bug-hunting/juliet.py
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
functionConst
functionStatic
bitwiseOnBoolean
# temporary suppressions - fix the warnings!
unusedPrivateFunction:test/test*.cpp
useStlAlgorithm
simplifyUsing:lib/valueptr.h
# debug suppressions
valueFlowBailout
valueFlowBailoutIncompleteVar
varid0
autoNoType
bailoutUninitVar
*:gui/test/*
*:test/test.cxx
*:test/cfg/*
*:externals/*/*

61
AUTHORS
View File

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

View File

@ -1,72 +1,35 @@
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
project(Cppcheck) project(Cppcheck)
include(cmake/cxx11.cmake)
use_cxx11()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(GNUInstallDirs) include(GNUInstallDirs)
include(cmake/ccache.cmake)
include(cmake/compilerCheck.cmake)
include(cmake/versions.cmake) include(cmake/versions.cmake)
include(cmake/options.cmake) include(cmake/options.cmake)
include(cmake/findDependencies.cmake) include(cmake/findDependencies.cmake)
include(cmake/compileroptions.cmake) include(cmake/compileroptions.cmake)
include(cmake/compilerDefinitions.cmake) include(cmake/compilerDefinitions.cmake)
include(cmake/buildFiles.cmake) include(cmake/buildFiles.cmake)
include(cmake/printInfo.cmake) include(cmake/cxx11.cmake)
if(BUILD_GUI)
include(cmake/qtCompat.cmake)
endif()
use_cxx11()
file(GLOB addons "addons/*.py") file(GLOB addons "addons/*.py")
file(GLOB cfgs "cfg/*.cfg") file(GLOB cfgs "cfg/*.cfg")
file(GLOB platforms "platforms/*.xml") file(GLOB platforms "platforms/*.xml")
if(LIBXML2_XMLLINT_EXECUTABLE) find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint)
add_custom_target(validateCFG DEPENDS validateCFG-cmd) if (LIBXML2_XMLLINT_EXECUTABLE)
add_custom_command(OUTPUT validateCFG-cmd add_custom_target(validateCFG ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng)
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng)
foreach(cfg ${cfgs}) foreach(cfg ${cfgs})
add_custom_command(OUTPUT validateCFG-cmd APPEND get_filename_component(cfgname ${cfg} NAME_WE)
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng ${cfg}) add_custom_target(validateCFG-${cfgname} ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng ${cfg})
add_dependencies(validateCFG validateCFG-${cfgname})
endforeach() 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() endif()
if(BUILD_TESTS) if (BUILD_TESTS)
enable_testing() enable_testing()
endif() endif()
@ -80,22 +43,18 @@ add_custom_target(copy_addons ALL
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/addons" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/addons"
COMMENT "Copying addons files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}") 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) if(USE_BUNDLED_TINYXML2)
message(STATUS "Using bundled version of tinyxml2") message(STATUS "Using bundled version of tinyxml2")
add_subdirectory(externals/tinyxml2) add_subdirectory(externals/tinyxml2)
endif() endif()
add_subdirectory(externals/simplecpp) add_subdirectory(externals/simplecpp)
add_subdirectory(lib) # CppCheck Library add_subdirectory(lib) # CppCheck Library
add_subdirectory(cli) # Client application add_subdirectory(cli) # Client application
add_subdirectory(test) # Tests add_subdirectory(test) # Tests
add_subdirectory(gui) # Graphical application add_subdirectory(gui) # Graphical application
add_subdirectory(tools/triage) # Triage tool add_subdirectory(tools/triage) # Triage tool
add_subdirectory(oss-fuzz) # OSS-Fuzz clients
add_subdirectory(tools) add_subdirectory(tools)
add_subdirectory(man)
include(cmake/printInfo.cmake)
include(cmake/clang_tidy.cmake) include(cmake/clang_tidy.cmake)

740
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

@ -4,54 +4,27 @@ Addons are scripts that analyses Cppcheck dump files to check compatibility with
## Supported addons ## Supported addons
+ [cert.py](https://github.com/danmar/cppcheck/blob/main/addons/cert.py)
Checks for compliance with the safe programming standard [CERT](http://www.cert.org/secure-coding/).
+ [misra.py](https://github.com/danmar/cppcheck/blob/main/addons/misra.py) + [misra.py](https://github.com/danmar/cppcheck/blob/main/addons/misra.py)
Used to verify compliance with MISRA C 2012 - a proprietary set of guidelines to avoid such questionable code, developed for embedded systems. Since this standard is proprietary, cppcheck does not display error text by specifying only the number of violated rules (for example, [c2012-21.3]). If you want to display full texts for violated rules, you will need to create a text file containing MISRA rules, which you will have to pass when calling the script with `--rule-texts` key. Some examples of rule texts files available in [tests directory](https://github.com/danmar/cppcheck/blob/main/addons/test/misra/). Used to verify compliance with MISRA C 2012 - a proprietary set of guidelines to avoid such questionable code, developed for embedded systems. Since this standard is proprietary, cppcheck does not display error text by specifying only the number of violated rules (for example, [c2012-21.3]). If you want to display full texts for violated rules, you will need to create a text file containing MISRA rules, which you will have to pass when calling the script with `--rule-texts` key. Some examples of rule texts files available in [tests directory](https://github.com/danmar/cppcheck/blob/main/addons/test/misra/).
+ [y2038.py](https://github.com/danmar/cppcheck/blob/main/addons/y2038.py) + [y2038.py](https://github.com/danmar/cppcheck/blob/main/addons/y2038.py)
Checks Linux system for [year 2038 problem](https://en.wikipedia.org/wiki/Year_2038_problem) safety. This required [modified environment](https://github.com/3adev/y2038). See complete description [here](https://github.com/danmar/cppcheck/blob/main/addons/doc/y2038.txt). 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) + [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. 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 ## Usage
### Command line interface ### Command line interface
```bash ```bash
cppcheck --addon=misc src/test.c cppcheck --addon=cert --addon=y2038 src/test.c
``` ```
It is also possible to call scripts as follows: It is also possible to call scripts as follows:
```bash ```bash
cppcheck --dump --quiet src/test.c cppcheck --dump --quiet src/test.c
python misc.py src/test.c.dump python cert.py src/test.c.dump
python misra.py --rule-texts=~/misra_rules.txt src/test.c.dump python misra.py --rule-texts=~/misra_rules.txt src/test.c.dump
``` ```

441
addons/cert.py Executable file
View File

@ -0,0 +1,441 @@
#!/usr/bin/env python3
#
# Cert: Some extra CERT checkers
#
# Cppcheck itself handles many CERT rules. Cppcheck warns when there is undefined behaviour.
# CERT Homepage: https://www.cert.org/secure-coding/
#
# Example usage of this addon (scan a sourcefile main.cpp)
# cppcheck --dump main.cpp
# python cert.py main.cpp.dump
import argparse
import cppcheckdata
import sys
import re
VERIFY = ('-verify' in sys.argv)
VERIFY_EXPECTED = []
VERIFY_ACTUAL = []
def reportError(token, severity, msg, id):
if VERIFY:
VERIFY_ACTUAL.append(str(token.linenr) + ':cert-' + id)
else:
cppcheckdata.reportError(token, severity, msg, 'cert', id)
def simpleMatch(token, pattern):
return cppcheckdata.simpleMatch(token, pattern)
def isUnpackedStruct(token):
if token.valueType is None:
return False
if token.valueType.typeScope is None:
return False
if token.valueType.typeScope.type != "Struct":
return False
startToken = token.valueType.typeScope.bodyStart
linenr = int(startToken.linenr)
for line in open(startToken.file):
linenr -= 1
if linenr == 0:
return True
if linenr < 3 and re.match(r'#pragma\s+pack\s*\(', line):
return False
return True
def isLocalUnpackedStruct(arg):
if arg and arg.str == '&' and not arg.astOperand2:
arg = arg.astOperand1
return arg and arg.variable and (arg.variable.isLocal or arg.variable.isArgument) and isUnpackedStruct(arg)
def isBitwiseOp(token):
return token and (token.str in {'&', '|', '^'})
def isComparisonOp(token):
return token and (token.str in {'==', '!=', '>', '>=', '<', '<='})
def isCast(expr):
if not expr or expr.str != '(' or not expr.astOperand1 or expr.astOperand2:
return False
if simpleMatch(expr, '( )'):
return False
return True
def isStandardFunction(token):
if token.function:
return False
prev = token.previous
if prev:
if prev.str == '.':
return False
if prev.str == '::':
prevprev = prev.previous
if prevprev and not prevprev.str == 'std':
return False
return True
# Is this a function call
def isFunctionCall(token, function_names, number_of_arguments=None):
if not token.isName:
return False
if token.str not in function_names:
return False
if (token.next is None) or token.next.str != '(' or token.next != token.astParent:
return False
if number_of_arguments is None:
return True
return len(cppcheckdata.getArguments(token)) == number_of_arguments
# EXP05-C
# do not attempt to cast away const
def exp05(data):
# TODO Reuse code in misra rule 11.8
for token in data.tokenlist:
if isCast(token):
# C-style cast
if not token.valueType:
continue
if not token.astOperand1.valueType:
continue
if token.valueType.pointer == 0:
continue
if token.astOperand1.valueType.pointer == 0:
continue
const1 = token.valueType.constness
const2 = token.astOperand1.valueType.constness
if (const1 % 2) < (const2 % 2):
reportError(token, 'style', "Attempt to cast away const", 'EXP05-C')
elif token.str == '(' and token.astOperand1 and token.astOperand2 and token.astOperand1.function:
function = token.astOperand1.function
arguments = cppcheckdata.getArguments(token.previous)
if not arguments:
continue
for argnr, argvar in function.argument.items():
if argnr < 1 or argnr > len(arguments):
continue
if not argvar.isPointer:
continue
if (argvar.constness % 2) == 1: # data is const
continue
argtok = arguments[argnr - 1]
if not argtok.valueType:
continue
if argtok.valueType.pointer == 0:
continue
const2 = arguments[argnr - 1].valueType.constness
if (const2 % 2) == 1:
reportError(token, 'style', "Attempt to cast away const", 'EXP05-C')
# EXP42-C
# do not compare padding data
def exp42(data):
for token in data.tokenlist:
if token.str != '(' or not token.astOperand1 or token.astOperand1.str != 'memcmp':
continue
arg1 = None
arg2 = None
if token.astOperand2 and token.astOperand2.str == ',':
if token.astOperand2.astOperand1 and token.astOperand2.astOperand1.str == ',':
arg1 = token.astOperand2.astOperand1.astOperand1
arg2 = token.astOperand2.astOperand1.astOperand2
if isLocalUnpackedStruct(arg1) or isLocalUnpackedStruct(arg2):
reportError(
token, 'style', "Comparison of struct padding data " +
"(fix either by packing the struct using '#pragma pack' or by rewriting the comparison)", 'EXP42-C')
# EXP15-C
# Do not place a semicolon on the same line as an if, for or while statement
def exp15(data):
for scope in data.scopes:
if scope.type in ('If', 'For', 'While'):
token = scope.bodyStart.next
if token.str==';' and token.linenr==scope.bodyStart.linenr:
reportError(token, 'style', 'Do not place a semicolon on the same line as an IF, FOR or WHILE', 'EXP15-C')
# EXP46-C
# Do not use a bitwise operator with a Boolean-like operand
# int x = (a == b) & c;
def exp46(data):
for token in data.tokenlist:
if isBitwiseOp(token) and (isComparisonOp(token.astOperand1) or isComparisonOp(token.astOperand2)):
reportError(
token, 'style', 'Bitwise operator is used with a Boolean-like operand', 'EXP46-c')
# INT31-C
# Ensure that integer conversions do not result in lost or misinterpreted data
def int31(data, platform):
if not platform:
return
for token in data.tokenlist:
if not isCast(token):
continue
if not token.valueType or not token.astOperand1.values:
continue
bits = None
if token.valueType.type == 'char':
bits = platform.char_bit
elif token.valueType.type == 'short':
bits = platform.short_bit
elif token.valueType.type == 'int':
bits = platform.int_bit
elif token.valueType.type == 'long':
bits = platform.long_bit
elif token.valueType.type == 'long long':
bits = platform.long_long_bit
else:
continue
if token.valueType.sign == 'unsigned':
found = False
for value in token.astOperand1.values:
if value.intvalue and value.intvalue < 0:
found = True
reportError(
token,
'style',
'Ensure that integer conversions do not result in lost or misinterpreted data (casting ' + str(value.intvalue) + ' to unsigned ' + token.valueType.type + ')',
'INT31-c')
break
if found:
continue
if bits >= 64:
continue
minval = 0
maxval = 1
if token.valueType.sign == 'signed':
minval = -(1 << (bits - 1))
maxval = ((1 << (bits - 1)) - 1)
else:
minval = 0
maxval = ((1 << bits) - 1)
for value in token.astOperand1.values:
if value.intvalue and (value.intvalue < minval or value.intvalue > maxval):
destType = ''
if token.valueType.sign:
destType = token.valueType.sign + ' ' + token.valueType.type
else:
destType = token.valueType.type
reportError(
token,
'style',
'Ensure that integer conversions do not result in lost or misinterpreted data (casting ' + str(value.intvalue) + ' to ' + destType + ')',
'INT31-c')
break
# ENV33-C
# Do not call system()
def env33(data):
for token in data.tokenlist:
if isFunctionCall(token, ('system',), 1):
# Invalid syntax
if not token.next.astOperand2:
continue
# ENV33-C-EX1: It is permissible to call system() with a null
# pointer argument to determine the presence of a command processor
# for the system.
argValue = token.next.astOperand2.getValue(0)
if argValue and argValue.intvalue == 0 and argValue.isKnown():
continue
reportError(token, 'style', 'Do not call system()', 'ENV33-C')
# MSC24-C
# Do not use deprecated or obsolescent functions
def msc24(data):
for token in data.tokenlist:
if isFunctionCall(token, ('asctime',), 1):
reportError(token,'style','Do not use asctime() better use asctime_s()', 'MSC24-C')
elif isFunctionCall(token, ('atof',), 1):
reportError(token,'style','Do not use atof() better use strtod()', 'MSC24-C')
elif isFunctionCall(token, ('atoi',), 1):
reportError(token,'style','Do not use atoi() better use strtol()', 'MSC24-C')
elif isFunctionCall(token, ('atol',), 1):
reportError(token,'style','Do not use atol() better use strtol()', 'MSC24-C')
elif isFunctionCall(token, ('atoll',), 1):
reportError(token,'style','Do not use atoll() better use strtoll()', 'MSC24-C')
elif isFunctionCall(token, ('ctime',), 1):
reportError(token,'style','Do not use ctime() better use ctime_s()', 'MSC24-C')
elif isFunctionCall(token, ('fopen',), 2):
reportError(token,'style','Do not use fopen() better use fopen_s()', 'MSC24-C')
elif isFunctionCall(token, ('freopen',), 3):
reportError(token,'style','Do not use freopen() better use freopen_s()', 'MSC24-C')
elif isFunctionCall(token, ('rewind',), 1):
reportError(token,'style','Do not use rewind() better use fseek()', 'MSC24-C')
elif isFunctionCall(token, ('setbuf',), 2):
reportError(token,'style','Do not use setbuf() better use setvbuf()', 'MSC24-C')
# MSC30-C
# Do not use the rand() function for generating pseudorandom numbers
def msc30(data):
for token in data.tokenlist:
if simpleMatch(token, "rand ( )") and isStandardFunction(token):
reportError(token, 'style', 'Do not use the rand() function for generating pseudorandom numbers', 'MSC30-c')
# STR03-C
# Do not inadvertently truncate a string
def str03(data):
for token in data.tokenlist:
if not isFunctionCall(token, 'strncpy'):
continue
arguments = cppcheckdata.getArguments(token)
if len(arguments)!=3:
continue
if arguments[2].str=='(' and arguments[2].astOperand1.str=='sizeof':
reportError(token, 'style', 'Do not inadvertently truncate a string', 'STR03-C')
# STR05-C
# Use pointers to const when referring to string literals
def str05(data):
for token in data.tokenlist:
if token.isString:
parent = token.astParent
if parent is None:
continue
parentOp1 = parent.astOperand1
if parent.isAssignmentOp and parentOp1.valueType:
if (parentOp1.valueType.type in ('char', 'wchar_t')) and parentOp1.valueType.pointer and not parentOp1.valueType.constness:
reportError(parentOp1, 'style', 'Use pointers to const when referring to string literals', 'STR05-C')
# STR07-C
# Use the bounds-checking interfaces for string manipulation
def str07(data):
if data.standards.c=='c89' or data.standards.c=='c99':
return
for token in data.tokenlist:
if not isFunctionCall(token, ('strcpy', 'strcat')):
continue
args = cppcheckdata.getArguments(token)
if len(args)!=2:
continue
if args[1].isString:
continue
reportError(token, 'style', 'Use the bounds-checking interfaces %s_s()' % token.str, 'STR07-C')
# STR11-C
# Do not specify the bound of a character array initialized with a string literal
def str11(data):
for token in data.tokenlist:
if not token.isString:
continue
strlen = token.strlen
parent = token.astParent
if parent is None:
continue
parentOp1 = parent.astOperand1
if parentOp1 is None or parentOp1.str!='[':
continue
if not parent.isAssignmentOp:
continue
varToken = parentOp1.astOperand1
if varToken is None or not varToken.isName:
continue
if varToken.variable is None:
continue
if varToken != varToken.variable.nameToken:
continue
valueToken = parentOp1.astOperand2
if valueToken is None:
continue
if valueToken.isNumber and int(valueToken.str)==strlen:
reportError(valueToken, 'style', 'Do not specify the bound of a character array initialized with a string literal', 'STR11-C')
# API01-C
# Avoid laying out strings in memory directly before sensitive data
def api01(data):
for scope in data.scopes:
if scope.type!='Struct':
continue
token = scope.bodyStart
arrayFound=False
# loop through the complete struct
while token != scope.bodyEnd:
if token.isName and token.variable:
if token.variable.isArray:
arrayFound=True
elif arrayFound and not token.variable.isArray and not token.variable.isConst:
reportError(token, 'style', 'Avoid laying out strings in memory directly before sensitive data', 'API01-C')
# reset flags to report other positions in the same struct
arrayFound=False
token = token.next
def get_args_parser():
parser = cppcheckdata.ArgumentParser()
parser.add_argument("-verify", help=argparse.SUPPRESS, action="store_true")
return parser
if __name__ == '__main__':
parser = get_args_parser()
args = parser.parse_args()
if args.verify:
VERIFY = True
if not args.dumpfile:
if not args.quiet:
print("no input files.")
sys.exit(0)
for dumpfile in args.dumpfile:
if not args.quiet:
print('Checking %s...' % dumpfile)
data = cppcheckdata.CppcheckData(dumpfile)
if VERIFY:
VERIFY_ACTUAL = []
VERIFY_EXPECTED = []
for tok in data.rawTokens:
if tok.str.startswith('//') and 'TODO' not in tok.str:
for word in tok.str[2:].split(' '):
if re.match(r'cert-[A-Z][A-Z][A-Z][0-9][0-9].*',word):
VERIFY_EXPECTED.append(str(tok.linenr) + ':' + word)
for cfg in data.iterconfigurations():
if not args.quiet:
print('Checking %s, config %s...' % (dumpfile, cfg.name))
exp05(cfg)
exp42(cfg)
exp46(cfg)
exp15(cfg)
int31(cfg, data.platform)
str03(cfg)
str05(cfg)
str07(cfg)
str11(cfg)
env33(cfg)
msc24(cfg)
msc30(cfg)
api01(cfg)
if VERIFY:
for expected in VERIFY_EXPECTED:
if expected not in VERIFY_ACTUAL:
print('Expected but not seen: ' + expected)
sys.exit(1)
for actual in VERIFY_ACTUAL:
if actual not in VERIFY_EXPECTED:
print('Not expected: ' + actual)
sys.exit(1)
sys.exit(cppcheckdata.EXIT_CODE)

View File

@ -8,28 +8,7 @@ License: No restrictions, use this as you need.
import argparse import argparse
import json import json
import os
import sys 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 xml.etree import ElementTree
from fnmatch import fnmatch from fnmatch import fnmatch
@ -76,7 +55,6 @@ class Directive:
print(directive.str) print(directive.str)
@endcode @endcode
""" """
#preprocessor.cpp/Preprocessor::dump
str = None str = None
file = None file = None
@ -97,15 +75,7 @@ class Directive:
class MacroUsage: class MacroUsage:
""" """
Tracks preprocessor macro usage Tracks preprocessor macro usage
Attributes:
name Name of the macro
usefile
useline
usecolumn
isKnownValue
""" """
#preprocessor.cpp/Preprocessor::dump
name = None # Macro name name = None # Macro name
file = None file = None
@ -121,10 +91,9 @@ class MacroUsage:
self.usefile = element.get('usefile') self.usefile = element.get('usefile')
self.useline = element.get('useline') self.useline = element.get('useline')
self.usecolumn = element.get('usecolumn') self.usecolumn = element.get('usecolumn')
self.isKnownValue = element.get('is-known-value', 'false') == 'true'
def __repr__(self): def __repr__(self):
attrs = ["name", "file", "linenr", "column", "usefile", "useline", "usecolumn", "isKnownValue"] attrs = ["name", "file", "linenr", "column", "usefile", "useline", "usecolumn"]
return "{}({})".format( return "{}({})".format(
"MacroUsage", "MacroUsage",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -134,12 +103,7 @@ class MacroUsage:
class PreprocessorIfCondition: class PreprocessorIfCondition:
""" """
Information about #if/#elif conditions Information about #if/#elif conditions
Attributes:
E
result
""" """
#preprocessor.cpp/Preprocessor::dump
file = None file = None
linenr = None linenr = None
@ -159,22 +123,11 @@ class PreprocessorIfCondition:
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
) )
class ValueType: class ValueType:
""" """
ValueType class. Contains (promoted) type information for each node in the AST. 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 type = None
sign = None sign = None
@ -188,18 +141,25 @@ class ValueType:
def __init__(self, element): def __init__(self, element):
self.type = element.get('valueType-type') self.type = element.get('valueType-type')
self.sign = element.get('valueType-sign') self.sign = element.get('valueType-sign')
self.bits = int(element.get('valueType-bits', 0)) bits = element.get('valueType-bits')
self.pointer = int(element.get('valueType-pointer', 0)) if bits:
self.constness = int(element.get('valueType-constness', 0)) self.bits = int(bits)
self.reference = element.get('valueType-reference')
self.typeScopeId = element.get('valueType-typeScope') self.typeScopeId = element.get('valueType-typeScope')
self.originalTypeName = element.get('valueType-originalTypeName') self.originalTypeName = element.get('valueType-originalTypeName')
#valueType-containerId TODO add constness = element.get('valueType-constness')
if constness:
self.constness = int(constness)
else:
self.constness = 0
pointer = element.get('valueType-pointer')
if pointer:
self.pointer = int(pointer)
else:
self.pointer = 0
def __repr__(self): def __repr__(self):
attrs = ["type", "sign", "bits", "typeScopeId", "originalTypeName", attrs = ["type", "sign", "bits", "typeScopeId", "originalTypeName",
"constness", "pointer"] "constness", "pointer"]
return "{}({})".format( return "{}({})".format(
"ValueType", "ValueType",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -235,45 +195,35 @@ class Token:
corresponding '}', ']' and ')'. For templates, the '<' is linked to corresponding '}', ']' and ')'. For templates, the '<' is linked to
the corresponding '>'. the corresponding '>'.
scope Scope information for this token. See the Scope class. scope Scope information for this token. See the Scope class.
type Type information: name/op/number/string/..
isName Is this token a symbol name 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 isNumber Is this token a number, for example 123, 12.34
isInt Is this token a int value such as 1234 isInt Is this token a int value such as 1234
isFloat Is this token a float value such as 12.34 isFloat Is this token a float value such as 12.34
isString Is this token a string literal such as "hello" isString Is this token a string literal such as "hello"
strlen string length for string literal strlen string length for string literal
isChar Is this token a char literal such as 'x' isChar Is this token a char literal such as 'x'
isBoolean Is this token a boolean
isOp Is this token a operator isOp Is this token a operator
isArithmeticalOp Is this token a arithmetic operator isArithmeticalOp Is this token a arithmetic operator
isAssignmentOp Is this token a assignment operator isAssignmentOp Is this token a assignment operator
isComparisonOp Is this token a comparison operator isComparisonOp Is this token a comparison operator
isLogicalOp Is this token a logical operator: && || isLogicalOp Is this token a logical operator: && ||
isCast isUnsigned Is this token a unsigned type
externLang isSigned Is this token a signed type
isExpandedMacro Is this token a expanded macro token isExpandedMacro Is this token a expanded macro token
macroName Macro name that this token is expanded from isSplittedVarDeclComma Is this a comma changed to semicolon in a splitted variable declaration ('int a,b;' => 'int a; int b;')
isRemovedVoidParameter Has void parameter been removed? isSplittedVarDeclEq Is this a '=' changed to semicolon in a splitted variable declaration ('int a=5;' => 'int a; a=5;')
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;')
isImplicitInt Is this token an implicit "int"? isImplicitInt Is this token an implicit "int"?
isComplex
isRestrict
isAttributeExport
varId varId for token, each variable has a unique non-zero id 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. variable Variable information for this token. See the Variable class.
function If this token points at a function call, this attribute has the Function function If this token points at a function call, this attribute has the Function
information. See the Function class. information. See the Function class.
values Possible/Known values of token values Possible/Known values of token
impossible_values Impossible values of token
valueType type information
typeScope type scope (token->type()->classScope) typeScope type scope (token->type()->classScope)
astParent ast parent astParent ast parent
astOperand1 ast operand1 astOperand1 ast operand1
astOperand2 ast operand2 astOperand2 ast operand2
orriginalName orriginal name of the token
valueType type information: container/..
file file name file file name
linenr line number linenr line number
column column column column
@ -288,7 +238,6 @@ class Token:
print(code) print(code)
@endcode @endcode
""" """
#tokenize.cpp/Tokenizer::dump
Id = None Id = None
str = None str = None
@ -305,25 +254,17 @@ class Token:
isString = False isString = False
strlen = None strlen = None
isChar = False isChar = False
isBoolean = False
isOp = False isOp = False
isArithmeticalOp = False isArithmeticalOp = False
isAssignmentOp = False isAssignmentOp = False
isComparisonOp = False isComparisonOp = False
isLogicalOp = False isLogicalOp = False
isCast = False
isUnsigned = False isUnsigned = False
isSigned = False isSigned = False
macroName = None
isExpandedMacro = False isExpandedMacro = False
isRemovedVoidParameter = False
isSplittedVarDeclComma = False isSplittedVarDeclComma = False
isSplittedVarDeclEq = False isSplittedVarDeclEq = False
isImplicitInt = False isImplicitInt = False
isComplex = False
isRestrict = False
isAttributeExport = False
exprId = None
varId = None varId = None
variableId = None variableId = None
variable = None variable = None
@ -373,8 +314,6 @@ class Token:
self.strlen = int(element.get('strlen')) self.strlen = int(element.get('strlen'))
elif type == 'char': elif type == 'char':
self.isChar = True self.isChar = True
elif type == 'boolean':
self.isBoolean = True
elif type == 'op': elif type == 'op':
self.isOp = True self.isOp = True
if element.get('isArithmeticalOp'): if element.get('isArithmeticalOp'):
@ -385,38 +324,28 @@ class Token:
self.isComparisonOp = True self.isComparisonOp = True
elif element.get('isLogicalOp'): elif element.get('isLogicalOp'):
self.isLogicalOp = True self.isLogicalOp = True
if element.get('isCast'): if element.get('isExpandedMacro'):
self.isCast = True
self.externLang = element.get('externLang')
self.macroName = element.get('macroName')
if self.macroName or element.get('isExpandedMacro'):
self.isExpandedMacro = True self.isExpandedMacro = True
if element.get('isRemovedVoidParameter'):
self.isRemovedVoidParameter = True
if element.get('isSplittedVarDeclComma'): if element.get('isSplittedVarDeclComma'):
self.isSplittedVarDeclComma = True self.isSplittedVarDeclComma = True
if element.get('isSplittedVarDeclEq'): if element.get('isSplittedVarDeclEq'):
self.isSplittedVarDeclEq = True self.isSplittedVarDeclEq = True
if element.get('isImplicitInt'): if element.get('isImplicitInt'):
self.isImplicitInt = True 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.linkId = element.get('link')
self.link = None self.link = None
if element.get('varId'): if element.get('varId'):
self.varId = int(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.variableId = element.get('variable')
self.variable = None self.variable = None
self.functionId = element.get('function') self.functionId = element.get('function')
self.function = None self.function = None
self.valuesId = element.get('values') self.valuesId = element.get('values')
self.values = None self.values = None
if element.get('valueType-type'):
self.valueType = ValueType(element)
else:
self.valueType = None
self.typeScopeId = element.get('type-scope') self.typeScopeId = element.get('type-scope')
self.typeScope = None self.typeScope = None
self.astParentId = element.get('astParent') self.astParentId = element.get('astParent')
@ -425,21 +354,15 @@ class Token:
self.astOperand1 = None self.astOperand1 = None
self.astOperand2Id = element.get('astOperand2') self.astOperand2Id = element.get('astOperand2')
self.astOperand2 = None 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) _load_location(self, element)
def __repr__(self): def __repr__(self):
attrs = ["Id", "str", "scopeId", "isName", "isUnsigned", "isSigned", attrs = ["Id", "str", "scopeId", "isName", "isUnsigned", "isSigned",
"isNumber", "isInt", "isFloat", "isString", "strlen", "isNumber", "isInt", "isFloat", "isString", "strlen",
"isChar", "isBoolean", "isOp", "isArithmeticalOp", "isAssignmentOp", "isChar", "isOp", "isArithmeticalOp", "isComparisonOp",
"isComparisonOp", "isLogicalOp", "isCast", "externLang", "isExpandedMacro", "isLogicalOp", "isExpandedMacro", "isSplittedVarDeclComma",
"isRemovedVoidParameter", "isSplittedVarDeclComma", "isSplittedVarDeclEq", "isSplittedVarDeclEq", "isImplicitInt", "linkId", "varId",
"isImplicitInt", "isComplex", "isRestrict", "isAttributeExport", "linkId", "variableId", "functionId", "valuesId", "valueType",
"varId", "variableId", "functionId", "valuesId", "valueType",
"typeScopeId", "astParentId", "astOperand1Id", "file", "typeScopeId", "astParentId", "astOperand1Id", "file",
"linenr", "column"] "linenr", "column"]
return "{}({})".format( return "{}({})".format(
@ -499,45 +422,6 @@ class Token:
def isBinaryOp(self): def isBinaryOp(self):
return self.astOperand1 and self.astOperand2 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: class Scope:
""" """
Scope. Information about global scope, function scopes, class scopes, inner scopes, etc. Scope. Information about global scope, function scopes, class scopes, inner scopes, etc.
@ -551,13 +435,8 @@ class Scope:
For a class scope, this is the class name. For a class scope, this is the class name.
function If this scope belongs at a function call, this attribute function If this scope belongs at a function call, this attribute
has the Function information. See the Function class. has the Function information. See the Function class.
functions if this is a Class type, it may have functions defined type Type of scope: Global, Function, Class, If, While
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
""" """
#symboldatabase.cpp/SymbolDatabase::printXml
Id = None Id = None
bodyStartId = None bodyStartId = None
@ -569,7 +448,6 @@ class Scope:
function = None function = None
nestedInId = None nestedInId = None
nestedIn = None nestedIn = None
nestedList = None
type = None type = None
isExecutable = None isExecutable = None
varlistId = None varlistId = None
@ -580,25 +458,21 @@ class Scope:
self.className = element.get('className') self.className = element.get('className')
self.functionId = element.get('function') self.functionId = element.get('function')
self.function = None self.function = None
self.functions = []
self.bodyStartId = element.get('bodyStart') self.bodyStartId = element.get('bodyStart')
self.bodyStart = None self.bodyStart = None
self.bodyEndId = element.get('bodyEnd') self.bodyEndId = element.get('bodyEnd')
self.bodyEnd = None self.bodyEnd = None
self.nestedInId = element.get('nestedIn') self.nestedInId = element.get('nestedIn')
self.nestedIn = None self.nestedIn = None
self.nestedList = list()
self.type = element.get('type') self.type = element.get('type')
self.definedType = element.get('definedType')
self.isExecutable = (self.type in ('Function', 'If', 'Else', 'For', 'While', 'Do', self.isExecutable = (self.type in ('Function', 'If', 'Else', 'For', 'While', 'Do',
'Switch', 'Try', 'Catch', 'Unconditional', 'Lambda')) 'Switch', 'Try', 'Catch', 'Unconditional', 'Lambda'))
self.varlistId = list() self.varlistId = list()
self.varlist = list() self.varlist = list()
def __repr__(self): def __repr__(self):
attrs = ["Id", "className", "functionId", "bodyStartId", "bodyEndId", attrs = ["Id", "className", "functionId", "bodyStartId", "bodyEndId",
"nestedInId", "nestedIn", "type", "definedType", "isExecutable", "functions"] "nestedInId", "nestedIn", "type", "isExecutable"]
return "{}({})".format( return "{}({})".format(
"Scope", "Scope",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -608,8 +482,6 @@ class Scope:
self.bodyStart = IdMap[self.bodyStartId] self.bodyStart = IdMap[self.bodyStartId]
self.bodyEnd = IdMap[self.bodyEndId] self.bodyEnd = IdMap[self.bodyEndId]
self.nestedIn = IdMap[self.nestedInId] self.nestedIn = IdMap[self.nestedInId]
if self.nestedIn:
self.nestedIn.nestedList.append(self)
self.function = IdMap[self.functionId] self.function = IdMap[self.functionId]
for v in self.varlistId: for v in self.varlistId:
value = IdMap.get(v) value = IdMap.get(v)
@ -624,20 +496,14 @@ class Function:
https://cppcheck.sourceforge.io/devinfo/doxyoutput/classFunction.html https://cppcheck.sourceforge.io/devinfo/doxyoutput/classFunction.html
Attributes Attributes
argument Argument list (dict of argument number and variable) argument Argument list
token Token in function implementation token Token in function implementation
tokenDef Token in function definition tokenDef Token in function definition
name isVirtual Is this function is virtual
type Constructor/CopyConstructor/MoveConstructor/OperatorEqual/Destructor/Function/Lambda/Unknown
hasVirtualSpecifier Is this function is virtual
isImplicitlyVirtual Is this function is virtual this in the base classes isImplicitlyVirtual Is this function is virtual this in the base classes
access Public/Protected/Private
isInlineKeyword Is inline keyword used isInlineKeyword Is inline keyword used
isStatic Is this function static isStatic Is this function static?
isAttributeNoreturn
overriddenFunction
""" """
#symboldatabase.cpp/SymbolDatabase::printXml
Id = None Id = None
argument = None argument = None
@ -648,13 +514,10 @@ class Function:
tokenDefId = None tokenDefId = None
name = None name = None
type = None type = None
access = None isVirtual = None
isImplicitlyVirtual = None isImplicitlyVirtual = None
hasVirtualSpecifier = None
isInlineKeyword = None isInlineKeyword = None
isStatic = None isStatic = None
isAttributeNoreturn = None
overriddenFunction = None
nestedIn = None nestedIn = None
def __init__(self, element, nestedIn): def __init__(self, element, nestedIn):
@ -663,22 +526,18 @@ class Function:
self.tokenDefId = element.get('tokenDef') self.tokenDefId = element.get('tokenDef')
self.name = element.get('name') self.name = element.get('name')
self.type = element.get('type') self.type = element.get('type')
self.hasVirtualSpecifier = element.get('hasVirtualSpecifier', 'false') == 'true'
self.isImplicitlyVirtual = element.get('isImplicitlyVirtual', '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.isInlineKeyword = element.get('isInlineKeyword', 'false') == 'true'
self.isStatic = element.get('isStatic', '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.nestedIn = nestedIn
self.argument = {} self.argument = {}
self.argumentId = {} self.argumentId = {}
def __repr__(self): def __repr__(self):
attrs = ["Id", "tokenId", "tokenDefId", "name", "type", "hasVirtualSpecifier", attrs = ["Id", "tokenId", "tokenDefId", "name", "type", "isVirtual",
"isImplicitlyVirtual", "access", "isInlineKeyword", "isStatic", "isImplicitlyVirtual", "isInlineKeyword", "isStatic", "argumentId"]
"isAttributeNoreturn", "overriddenFunction", "nestedIn", "argumentId"]
return "{}({})".format( return "{}({})".format(
"Function", "Function",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -691,10 +550,6 @@ class Function:
self.tokenDef = IdMap[self.tokenDefId] self.tokenDef = IdMap[self.tokenDefId]
#todo add class Types:
#symboldatabase.cpp/SymbolDatabase::printXml
class Variable: class Variable:
""" """
Information about a variable Information about a variable
@ -705,22 +560,20 @@ class Variable:
nameToken Name token in variable declaration nameToken Name token in variable declaration
typeStartToken Start token of variable declaration typeStartToken Start token of variable declaration
typeEndToken End 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 scope Variable scope
constness Variable constness (same encoding as ValueType::constness)
isArgument Is this variable a function argument? 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? isArray Is this variable an array?
isClass Is this variable a class or struct? isClass Is this variable a class or struct?
isConst Is this variable a const variable? isConst Is this variable a const variable?
isGlobal Is this variable a global variable?
isExtern Is this variable an extern variable? isExtern Is this variable an extern variable?
isLocal Is this variable a local variable?
isPointer Is this variable a pointer isPointer Is this variable a pointer
isReference Is this variable a reference isReference Is this variable a reference
isStatic Is this variable static? isStatic Is this variable static?
isVolatile Is this variable volatile? constness Variable constness (same encoding as ValueType::constness)
""" """
#symboldatabase.cpp/SymbolDatabase::printXml
Id = None Id = None
nameTokenId = None nameTokenId = None
@ -742,7 +595,6 @@ class Variable:
isPointer = False isPointer = False
isReference = False isReference = False
isStatic = False isStatic = False
isVolatile = False
constness = 0 constness = 0
def __init__(self, element): def __init__(self, element):
@ -754,26 +606,27 @@ class Variable:
self.typeEndTokenId = element.get('typeEndToken') self.typeEndTokenId = element.get('typeEndToken')
self.typeEndToken = None self.typeEndToken = None
self.access = element.get('access') 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.scopeId = element.get('scope')
self.scope = None 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.isArray = element.get('isArray') == 'true'
self.isClass = element.get('isClass') == 'true' self.isClass = element.get('isClass') == 'true'
self.isConst = element.get('isConst') == 'true' self.isConst = element.get('isConst') == 'true'
self.isGlobal = (self.access and self.access == 'Global')
self.isExtern = element.get('isExtern') == 'true' self.isExtern = element.get('isExtern') == 'true'
self.isLocal = (self.access and self.access == 'Local')
self.isPointer = element.get('isPointer') == 'true' self.isPointer = element.get('isPointer') == 'true'
self.isReference = element.get('isReference') == 'true' self.isReference = element.get('isReference') == 'true'
self.isStatic = element.get('isStatic') == 'true' self.isStatic = element.get('isStatic') == 'true'
self.isVolatile = element.get('isVolatile') == 'true' self.constness = element.get('constness')
if self.constness:
self.constness = int(self.constness)
def __repr__(self): def __repr__(self):
attrs = ["Id", "nameTokenId", "typeStartTokenId", "typeEndTokenId", attrs = ["Id", "nameTokenId", "typeStartTokenId", "typeEndTokenId",
"access", "scopeId", "isArgument", "isArray", "isClass", "access", "scopeId", "isArgument", "isArray", "isClass",
"isConst", "isGlobal", "isExtern", "isLocal", "isPointer", "isConst", "isGlobal", "isExtern", "isLocal", "isPointer",
"isReference", "isStatic", "isVolatile", "constness"] "isReference", "isStatic", "constness", ]
return "{}({})".format( return "{}({})".format(
"Variable", "Variable",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -785,32 +638,11 @@ class Variable:
self.typeEndToken = IdMap[self.typeEndTokenId] self.typeEndToken = IdMap[self.typeEndTokenId]
self.scope = IdMap[self.scopeId] 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: class TypedefInfo:
""" """
TypedefInfo class -- information about typedefs TypedefInfo class -- information about typedefs
Attributes:
name name of the typedef
used 0/1
""" """
#tokenizer.cpp/tokenizer::dump
name = None name = None
used = None used = None
file = None file = None
@ -830,19 +662,11 @@ class Value:
intvalue integer value intvalue integer value
tokvalue token value tokvalue token value
floatvalue float value floatvalue float value
movedvalue
uninit
containerSize container size 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 condition condition where this Value comes from
bound Upper/Lower/Point valueKind 'known' or 'possible'
valueKind known/possible/impossible/inconclusive inconclusive Is value inconclusive?
path 0/1/2/3/..
""" """
#token.cpp/token::printValueFlow
intvalue = None intvalue = None
tokvalue = None tokvalue = None
@ -850,6 +674,7 @@ class Value:
containerSize = None containerSize = None
condition = None condition = None
valueKind = None valueKind = None
inconclusive = False
def isKnown(self): def isKnown(self):
return self.valueKind and self.valueKind == 'known' return self.valueKind and self.valueKind == 'known'
@ -860,27 +685,13 @@ class Value:
def isImpossible(self): def isImpossible(self):
return self.valueKind and self.valueKind == 'impossible' return self.valueKind and self.valueKind == 'impossible'
def isInconclusive(self):
return self.valueKind and self.valueKind == 'inconclusive'
def __init__(self, element): def __init__(self, element):
self.intvalue = element.get('intvalue') self.intvalue = element.get('intvalue')
if self.intvalue: if self.intvalue:
self.intvalue = int(self.intvalue) self.intvalue = int(self.intvalue)
self._tokvalueId = element.get('tokvalue') self._tokvalueId = element.get('tokvalue')
self.floatvalue = element.get('floatvalue') 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.containerSize = element.get('container-size')
self.iteratorStart = element.get('iterator-start')
self.iteratorEnd = element.get('iterator-end')
self._lifetimeId = element.get('lifetime')
self.lifetimeScope = element.get('lifetime-scope')
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.condition = element.get('condition-line')
if self.condition: if self.condition:
self.condition = int(self.condition) self.condition = int(self.condition)
@ -890,18 +701,15 @@ class Value:
self.valueKind = 'possible' self.valueKind = 'possible'
elif element.get('impossible'): elif element.get('impossible'):
self.valueKind = 'impossible' self.valueKind = 'impossible'
elif element.get('inconclusive'): if element.get('inconclusive'):
self.valueKind = 'inconclusive' self.inconclusive = True
self.path = element.get('path')
def setId(self, IdMap): def setId(self, IdMap):
self.tokvalue = IdMap.get(self._tokvalueId) self.tokvalue = IdMap.get(self._tokvalueId)
self.lifetime = IdMap.get(self._lifetimeId)
self.symbolic = IdMap.get(self._symbolicId)
def __repr__(self): def __repr__(self):
attrs = ["intvalue", "tokvalue", "floatvalue", "movedvalue", "uninit", attrs = ["intvalue", "tokvalue", "floatvalue", "containerSize",
"bufferSize", "containerSize", "condition", "valueKind"] "condition", "valueKind", "inconclusive"]
return "{}({})".format( return "{}({})".format(
"Value", "Value",
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
@ -987,7 +795,6 @@ class Configuration:
preprocessor_if_conditions List of preprocessor if conditions that was evaluated during preprocessing preprocessor_if_conditions List of preprocessor if conditions that was evaluated during preprocessing
tokenlist List of Token items tokenlist List of Token items
scopes List of Scope items scopes List of Scope items
containers List of Container items
functions List of Function items functions List of Function items
variables List of Variable items variables List of Variable items
valueflow List of ValueFlow values valueflow List of ValueFlow values
@ -1000,13 +807,11 @@ class Configuration:
preprocessor_if_conditions = [] preprocessor_if_conditions = []
tokenlist = [] tokenlist = []
scopes = [] scopes = []
containers = []
functions = [] functions = []
variables = [] variables = []
typedefInfo = [] typedefInfo = []
valueflow = [] valueflow = []
standards = None standards = None
clang_warnings = []
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
@ -1015,13 +820,11 @@ class Configuration:
self.preprocessor_if_conditions = [] self.preprocessor_if_conditions = []
self.tokenlist = [] self.tokenlist = []
self.scopes = [] self.scopes = []
self.containers = []
self.functions = [] self.functions = []
self.variables = [] self.variables = []
self.typedefInfo = [] self.typedefInfo = []
self.valueflow = [] self.valueflow = []
self.standards = Standards() self.standards = Standards()
self.clang_warnings = []
def set_tokens_links(self): def set_tokens_links(self):
"""Set next/previous links between tokens.""" """Set next/previous links between tokens."""
@ -1038,8 +841,6 @@ class Configuration:
IdMap[token.Id] = token IdMap[token.Id] = token
for scope in self.scopes: for scope in self.scopes:
IdMap[scope.Id] = scope IdMap[scope.Id] = scope
for container in self.containers:
IdMap[container.Id] = container
for function in self.functions: for function in self.functions:
IdMap[function.Id] = function IdMap[function.Id] = function
for variable in self.variables: for variable in self.variables:
@ -1052,8 +853,6 @@ class Configuration:
token.setId(IdMap) token.setId(IdMap)
for scope in self.scopes: for scope in self.scopes:
scope.setId(IdMap) scope.setId(IdMap)
#for container in self.containers:
# container.setId(IdMap)
for function in self.functions: for function in self.functions:
function.setId(IdMap) function.setId(IdMap)
for variable in self.variables: for variable in self.variables:
@ -1075,7 +874,7 @@ class Platform:
This class contains type sizes This class contains type sizes
Attributes: Attributes:
name Name of the platform: unspecified/native/win32A/win32W/win64/unix32/unix64/platformFile name Name of the platform
char_bit CHAR_BIT value char_bit CHAR_BIT value
short_bit SHORT_BIT value short_bit SHORT_BIT value
int_bit INT_BIT value int_bit INT_BIT value
@ -1189,7 +988,7 @@ class CppcheckData:
self.rawTokens = [] self.rawTokens = []
self.platform = None self.platform = None
self.suppressions = [] self.suppressions = []
self.files = [] # source files for elements occurred in this configuration self.files = []
platform_done = False platform_done = False
rawtokens_done = False rawtokens_done = False
@ -1264,11 +1063,6 @@ class CppcheckData:
cfg = None cfg = None
cfg_arguments = [] cfg_arguments = []
elif node.tag == 'clang-warning' and event == 'start':
cfg.clang_warnings.append({'file': node.get('file'),
'line': int(node.get('line')),
'column': int(node.get('column')),
'message': node.get('message')})
# Parse standards # Parse standards
elif node.tag == "standards" and event == 'start': elif node.tag == "standards" and event == 'start':
continue continue
@ -1282,6 +1076,7 @@ class CppcheckData:
# Parse directives list # Parse directives list
elif node.tag == 'directive' and event == 'start': elif node.tag == 'directive' and event == 'start':
cfg.directives.append(Directive(node)) cfg.directives.append(Directive(node))
# Parse macro usage # Parse macro usage
elif node.tag == 'macro' and event == 'start': elif node.tag == 'macro' and event == 'start':
cfg.macro_usage.append(MacroUsage(node)) cfg.macro_usage.append(MacroUsage(node))
@ -1335,22 +1130,12 @@ class CppcheckData:
else: else:
cfg_arguments.append(var) 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 # Parse typedef info
elif node.tag == 'typedef-info': elif node.tag == 'typedef-info':
iter_typedef_info = (event == 'start') iter_typedef_info = (event == 'start')
elif iter_typedef_info and node.tag == 'info' and event == 'start': elif iter_typedef_info and node.tag == 'info' and event == 'start':
cfg.typedefInfo.append(TypedefInfo(node)) 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) # Parse valueflows (list of values)
elif node.tag == 'valueflow' and event == 'start': elif node.tag == 'valueflow' and event == 'start':
continue continue
@ -1486,6 +1271,7 @@ def get_files(args):
dump_files.append(f) dump_files.append(f)
return dump_files, ctu_info_files return dump_files, ctu_info_files
def simpleMatch(token, pattern): def simpleMatch(token, pattern):
for p in pattern.split(' '): for p in pattern.split(' '):
if not token or token.str != p: if not token or token.str != p:
@ -1493,93 +1279,6 @@ def simpleMatch(token, pattern):
token = token.next token = token.next
return True 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): def get_function_call_name_args(token):
"""Get function name and arguments for function call """Get function name and arguments for function call
name, args = get_function_call_name_args(tok) name, args = get_function_call_name_args(tok)
@ -1646,23 +1345,3 @@ def reportSummary(dumpfile, summary_type, summary_data):
with open(ctu_info_file, 'at') as f: with open(ctu_info_file, 'at') as f:
msg = {'summary': summary_type, 'data': summary_data} msg = {'summary': summary_type, 'data': summary_data}
f.write(json.dumps(msg) + '\n') f.write(json.dumps(msg) + '\n')
def get_path_premium_addon():
p = pathlib.Path(sys.argv[0]).parent.parent
for ext in ('.exe', ''):
p1 = os.path.join(p, 'premiumaddon' + ext)
p2 = os.path.join(p, 'cppcheck' + ext)
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 cppcheck
import sys
@cppcheck.checker @cppcheck.checker
def cast(cfg, data): def cast(cfg, data):

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -81,7 +81,7 @@ for arg in sys.argv[1:]:
for scope in cfg.scopes: for scope in cfg.scopes:
if scope.type == 'Function': if scope.type == 'Function':
function = scope.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 continue
res = re.match(RE_FUNCTIONNAME, scope.className) res = re.match(RE_FUNCTIONNAME, scope.className)
if not res: if not res:

View File

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

194
addons/test/cert-test.c Normal file
View File

@ -0,0 +1,194 @@
// To test:
// ~/cppcheck/cppcheck --dump cert-test.c && python ../cert.py -verify cert-test.c.dump
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
struct S {
short a;
short b;
};
#pragma pack()
struct PackedStruct {
short a;
short b;
};
void api01()
{
const size_t String_Size = 20;
struct bad_node_s
{
char name[String_Size];
struct bad_node_s* next; // cert-API01-C
};
struct good_node_s
{
struct good_node_s* next;
char name[String_Size];
};
struct also_good_node_s
{
struct also_good_node_s* next;
char *name;
};
}
void dostuff(int *data);
void exp05()
{
const int x = 42;
int y = (int)x;
int *p;
p = (int *)&x; // cert-EXP05-C
const int data[] = {1,2,3,4};
dostuff(data); // cert-EXP05-C
}
void print(const char *p);
void exp05_fp() {
print("hello");
}
void exp42()
{
struct S s1 = {1,2};
struct S s2 = {1,2};
memcmp(&s1, &s2, sizeof(struct S)); // cert-EXP42-C
struct PackedStruct s3 = {1,2};
struct PackedStruct s4 = {1,2};
memcmp(&s3, &s4, sizeof(struct S));
}
void exp46(int x, int y, int z)
{
if ((x == y) & z) {} // cert-EXP46-c
}
unsigned char int31(int x)
{
x = (unsigned char)1000; // cert-INT31-c
x = (signed char)0xff; // cert-INT31-c
x = (unsigned char)-1; // cert-INT31-c
x = (unsigned long long)-1; // cert-INT31-c
}
void env33()
{
system("chmod -x $(which chmod)"); // cert-ENV33-C
system(""); // cert-ENV33-C
system(NULL); // no-warning
system(0); // no-warning
const int *np = NULL;
system(np); // no-warning
int system;
}
void msc24()
{
struct S {
int x; int fopen;
};
struct S s;
time_t rawtime;
struct tm *timeinfo;
char buffer[256];
int i;
long int li;
long long int lli;
FILE *f;
s.fopen = 123;
f = fopen ("myfile.txt","w+"); //cert-MSC24-C
setbuf ( f , buffer ); //cert-MSC24-C
for ( i='A' ; i<='Z' ; i++)
fputc ( i, f);
rewind (f); //cert-MSC24-C
fclose (f);
time ( &rawtime );
timeinfo = localtime ( &rawtime );
printf ( "The current date/time is: %s", asctime (timeinfo) ); //cert-MSC24-C
float n = atof (buffer); //cert-MSC24-C
float m = sin (n*M_PI/180);
i = atoi (buffer); //cert-MSC24-C
li = atol(buffer); //cert-MSC24-C
lli = atoll(buffer); //cert-MSC24-C
time (&rawtime);
printf ("The current local time is: %s", ctime (&rawtime)); //cert-MSC24-C
freopen ("myfile.txt","w",stdout); //cert-MSC24-C
printf ("This sentence is redirected to a file.");
fclose (stdout);
}
void msc30()
{
unsigned int num = rand(); // cert-MSC30-c
int rand = 5;
int a = rand;
}
void exp15()
{
int x=5, y=7;
if(x==y); //cert-EXP15-C
{
printf("not working\n");
}
if(x)
;
}
void str03()
{
char *string_data=(char*)malloc(16);
char a[16];
int d;
strncpy(a, string_data, sizeof(a)); //cert-STR03-C
strncpy(a, string_data, 5); d=sizeof(int);
}
void str05()
{
int x=5, y=7;
if(x==y); //cert-EXP15-C
{
printf("not working\n");
}
if(x)
;
}
void str07(char *buf, const char *newBuf)
{
const char *str = "test";
strcat(buf,"bla");
strcat(buf, str); //cert-STR07-C
strcat(buf, newBuf); //cert-STR07-C
strcpy(buf, newBuf); //cert-STR07-C
}
void str11()
{
const char str[3]="abc"; //cert-STR11-C
const char *x[10]; x[3]="def";
}

26
addons/test/cert-test.cpp Normal file
View File

@ -0,0 +1,26 @@
// To test:
// ~/cppcheck/cppcheck --dump cert-test.cpp && python ../cert.py -verify cert-test.cpp.dump
#include <cstdlib>
class msc30TestClass {
public:
static int rand();
};
namespace exp05c {
using uint32 = std::uint32_t;
static const uint32 a = static_cast<uint32>(0xFFFFFFFF);
}
void msc30(msc30TestClass & testClass)
{
unsigned int num = rand(); // cert-MSC30-c
num = std::rand(); // cert-MSC30-c
num = msc30TestClass::rand();
num = unknownClass::rand();
num = testClass.rand();
num = unknownClass.rand();
int rand = 5;
int a = rand;
}

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: // 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" #include "misra-ctu-test.h"
@ -13,16 +13,10 @@ typedef int MISRA_5_6_VIOLATION;
// cppcheck-suppress misra-c2012-5.7 // cppcheck-suppress misra-c2012-5.7
struct misra_5_7_violation_t { 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; 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-8.4
// cppcheck-suppress misra-c2012-5.8 // cppcheck-suppress misra-c2012-5.8
int misra_5_8_var1; int misra_5_8_var1;
@ -45,4 +39,3 @@ extern int misra_8_5;
// cppcheck-suppress misra-c2012-8.6 // cppcheck-suppress misra-c2012-8.6
int32_t misra_8_6 = 1; int32_t misra_8_6 = 1;
void misra_8_7_external(void) {}

View File

@ -1,5 +1,5 @@
// Test with command: // 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" #include "misra-ctu-test.h"
@ -13,22 +13,16 @@ static MISRA_5_6_VIOLATION misra_5_6_x;
// cppcheck-suppress misra-c2012-5.7 // cppcheck-suppress misra-c2012-5.7
struct misra_5_7_violation_t { 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; 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 // cppcheck-suppress misra-c2012-5.8
static int misra_5_8_var1; static int misra_5_8_var1;
// cppcheck-suppress misra-c2012-8.4 // cppcheck-suppress misra-c2012-8.4
// cppcheck-suppress misra-c2012-5.8 // cppcheck-suppress misra-c2012-5.8
void misra_5_8_f(void) { void misra_5_8_f(void) {
// cppcheck-suppress [misra-c2012-5.8, unusedVariable] // cppcheck-suppress misra-c2012-5.8
char misra_5_8_var2; char misra_5_8_var2;
} }
@ -43,16 +37,9 @@ extern int misra_8_5;
// cppcheck-suppress misra-c2012-8.4 // cppcheck-suppress misra-c2012-8.4
// cppcheck-suppress misra-c2012-8.6 // cppcheck-suppress misra-c2012-8.6
int32_t misra_8_6 = 2; 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.4
// cppcheck-suppress misra-c2012-8.7 // cppcheck-suppress misra-c2012-8.7
void misra_8_7(void) {} void misra_8_7(void) {}
static void misra_8_7_caller(void) { static void misra_8_7_caller(void) { misra_8_7(); }
misra_8_7();
misra_8_7_external();
}

View File

@ -9,10 +9,6 @@ struct misra_2_4_violation_t {
int x; int x;
}; };
static inline void misra_5_9_exception(void) {}
void misra_8_7_external(void);
#define MISRA_2_5_OK_1 1 #define MISRA_2_5_OK_1 1
#define MISRA_2_5_OK_2 2 #define MISRA_2_5_OK_2 2
// cppcheck-suppress misra-c2012-2.5 // cppcheck-suppress misra-c2012-2.5

View File

@ -21,13 +21,13 @@ static void foo(void)
{ {
for(i = 0; i < 10; i++) 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____31x;
int misra_5_2_var_hides_var_1____31y;//5.2 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: // 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) static void misra_10_4(void)
{ {
// #10480 // #10480
const char buf1[1] = {a}; char buf[1] = {'f'};
const char c = '0'; const char c = '0';
x = buf1[0] - c; signed int x = buf[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;
} }
static void misra_12_2(void) { static void misra_12_2(void) {

View File

@ -45,7 +45,7 @@
typedef struct { typedef struct {
union { // 19.2 union { // 19.2
struct { struct {
unsigned a : 2; unsigned a : 2; // 8.1
unsigned : 14; unsigned : 14;
}; };
uint16_t value; uint16_t value;
@ -58,37 +58,17 @@ typedef unsigned int u32;
typedef signed int s32; typedef signed int s32;
typedef unsigned long long u64; 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 _Atomic int misra_1_4_var; // 1.4
static _Noreturn void misra_1_4_func(void) // 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 printf_s("hello"); // 1.4
} }
#define MISRA_2_2 (1*60)
static void misra_2_2(int x) {
int a;
a = x + 0; // 2.2
a = 0 + x; // 2.2
a = x * 0; // 2.2
a = 0 * x; // 2.2
a = x * 1; // 2.2
a = 1 * x; // 2.2
a = MISRA_2_2;
(void)a;
}
/* // */ // 3.1 /* // */ // 3.1
/* /* */ // 3.1 /* /* */ // 3.1
//// ////
/* https://cppcheck.net */
// http://example.com // no warning // http://example.com // no warning
@ -160,13 +140,13 @@ static void foo(void)
{ {
for(i = 0; i < 10; i++) 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____31x;
int misra_5_2_var_hides_var_1____31y;//5.2 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; break;
} }
@ -252,11 +232,11 @@ static void misra_5_5_func1(void)
{ {
do do
{ {
if(misra_5_5_func3()) //17.3 if(misra_5_5_func3()) //14.4
{ {
int misra_5_5_hides_macro________31y; //5.5 int misra_5_5_hides_macro________31y; //5.5
} }
} while(misra_5_5_func2()); //17.3 } while(misra_5_5_func2()); //14.4
} }
break; break;
} }
@ -285,13 +265,31 @@ static void misra_7_1(void) {
int x = 066; // 7.1 int x = 066; // 7.1
} }
static void misra_7_2_call_test(int a, unsigned int b, unsigned int c) { } // 2.7
static void misra_7_2_call_va_test(int a, ...) { } // 2.7
static void misra_7_2(void) { static void misra_7_2(void) {
uint32_t a = 0x7fffffff; uint32_t a = 2147483647;
uint32_t b = 0x80000000; // 7.2 const uint32_t b = 2147483648U;
uint32_t c = 0x80000000U; const uint32_t c = 2147483648; // 7.2 10.3
uint32_t d = 2147483647; uint32_t d = 2147483649; // 7.2 10.3
uint64_t e = 2147483648;
uint32_t f = 2147483648U; uint8_t e = 0x80; // 7.2 10.3
uint8_t f = 0x80U;
uint16_t g = 0x8000; // 7.2 10.3
uint16_t h = 0x8000U;
uint32_t i = 0x80000000; // 7.2
uint32_t j = 0x80000000U;
uint64_t k = 0x8000000000000000; // TODO 7.2
uint64_t l = 0x8000000000000000ULL;
uint32_t m = 1 + 0x80000000; // 7.2 10.4
misra_7_2_call_test(1, 2, 2147483648U);
misra_7_2_call_test(1, 2, 2147483648); // 7.2
misra_7_2_call_test(1, 0x80000000, 3); // 7.2
misra_7_2_call_va_test(1, 2, 3);
} }
// The addon should not generate false positives for the identifiers. // The addon should not generate false positives for the identifiers.
@ -322,7 +320,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_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_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(int a, char* b) { } // 2.7
static void misra_7_4_call_2(int a, ...) { } // 2.7
static void misra_7_4(void) static void misra_7_4(void)
{ {
@ -338,7 +335,6 @@ static void misra_7_4(void)
misra_7_4_const_call(1, ("text_const_call")); misra_7_4_const_call(1, ("text_const_call"));
misra_7_4_const_ptr_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(1, "text_call"); // 7.4 11.8
misra_7_4_call_2(1, "a", "b");
} }
const misra_8_1_a; // 8.1 8.4 const misra_8_1_a; // 8.1 8.4
@ -385,8 +381,6 @@ static int misra_8_2_q
(); // 8.2 (); // 8.2
void misra_8_4_foo(void) {} // 8.4 void misra_8_4_foo(void) {} // 8.4
extern void misra_8_4_func(void);
void misra_8_4_func(void) {}
static void misra_8_4_bar(void) {} // Declared in header static void misra_8_4_bar(void) {} // Declared in header
extern int16_t misra_8_4_count; // no-warning extern int16_t misra_8_4_count; // no-warning
int16_t misra_8_4_count = 0; // Compliant int16_t misra_8_4_count = 0; // Compliant
@ -414,25 +408,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 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) { static void misra_9_empty_or_zero_initializers(void) {
int a[2] = {}; // 9.2 int a[2] = {}; // 9.2
int b[2][2] = {}; // 9.2 int b[2][2] = {}; // 9.2
@ -593,13 +568,13 @@ static void misra_9_struct_initializers(void) {
// Struct with fields of unknown type // Struct with fields of unknown type
struct_with_unknown_fields ufa = { 1, { 1, 2 }, { 1, 2 } }; struct_with_unknown_fields ufa = { 1, { 1, 2 }, { 1, 2 } };
struct_with_unknown_fields ufb = { 1, 1, 2 }; // 9.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 } } }; { 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 } } }; { 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 } }; 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 }}, {2, { 1, 2 }, { 1, 2 }},
[1] = { 2, { 1, 2 }, { 1, 2 }} }; [1] = { 2, { 1, 2 }, { 1, 2 }} };
@ -607,6 +582,10 @@ static void misra_9_struct_initializers(void) {
struct1 os1 = { i1: 1, i2: 2 }; // 10.4 13.4 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) { static void misra_9_2(void) {
union misra_9_2_union { // 19.2 union misra_9_2_union { // 19.2
char c; char c;
@ -632,7 +611,7 @@ static void misra_10_1(uint32_t u, char c1, char c2, uint8_t u8) {
int32_t i; int32_t i;
char c; char c;
enum { E1 = 1 }; enum { E1 = 1 };
i = 3 << 1; // 10.1 i = 3 << 1; // 10.1 10.6
i = (u & u) << 4; // no-warning i = (u & u) << 4; // no-warning
c = c1 & c2; // 10.1 c = c1 & c2; // 10.1
c = c1 << 1; // 10.1 c = c1 << 1; // 10.1
@ -666,11 +645,11 @@ static void misra_10_1_ternary(void)
a = ui16 << ui16; // 10.6 a = ui16 << ui16; // 10.6
a = ui16 << (get_bool(42) ? ui16 : ui16); a = ui16 << (get_bool(42) ? ui16 : ui16);
a = ui16 << (get_bool(42) ? ui16 : (get_bool(34) ? ui16 : ui16)); a = ui16 << (get_bool(42) ? ui16 : (get_bool(34) ? ui16 : ui16)); // 10.4
a = ui16 << (get_bool(42) ? (get_bool(34) ? ui16 : ui16) : ui16); 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 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 : 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) ? ui16 : ui8) : ui8); // 10.4
a = ui16 << (get_bool(42) ? (get_bool(34) ? i16 : ui8) : ui8); // 10.1 10.4 a = ui16 << (get_bool(42) ? (get_bool(34) ? i16 : ui8) : ui8); // 10.1 10.4
a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8) << ui16; // 10.4 a = (get_bool(42) ? (get_bool(34) ? ui16 : ui8) : ui8) << ui16; // 10.4
@ -711,7 +690,6 @@ static void misra_10_3(uint32_t u32a, uint32_t u32b) {
res = 2U + 3U; // no warning, utlr=unsigned char res = 2U + 3U; // no warning, utlr=unsigned char
res = 0.1f; // 10.3 res = 0.1f; // 10.3
const char c = '0'; // no-warning const char c = '0'; // no-warning
uint32_t u = UINT32_C(10); // no-warning
} }
static void misra_10_4(u32 x, s32 y) { static void misra_10_4(u32 x, s32 y) {
@ -731,20 +709,6 @@ static void misra_10_4(u32 x, s32 y) {
if ('0' == buf[x]) // no-warning 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) { static void misra_10_5(uint16_t x) {
@ -760,11 +724,11 @@ static void misra_10_5(uint16_t x) {
struct misra_10_6_s { struct misra_10_6_s {
unsigned int a:4; unsigned int a:4;
}; };
static void misra_10_6(u8 x, char c1, char c2) { static void misra_10_6(u8 x, u32 a, u32 b, char c1, char c2) {
u16 y1 = x+x; // 10.6 u16 y = 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 u16 z = ~u8 x ;//10.6
s32 i = c1 - c2; // 10.3 u32 c = ( u16) ( u32 a + u32 b ); //10.6
s32 i = c1 - c2; // 10.3 FIXME: False positive for 10.6 (this is compliant). Trac #9488
struct misra_10_6_s s; struct misra_10_6_s s;
s.a = x & 1U; // no-warning (#10487) s.a = x & 1U; // no-warning (#10487)
} }
@ -773,7 +737,6 @@ static void misra_10_6_1(uint32_t *a, uint16_t b, uint16_t c)
*a = b + c ; // 10.6 *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) { static void misra_10_7(uint16_t u16a, uint16_t u16b) {
uint32_t u32a = 100u; uint32_t u32a = 100u;
res = u32a * u16a + u16b; // 12.1 no-warning res = u32a * u16a + u16b; // 12.1 no-warning
@ -782,7 +745,6 @@ static void misra_10_7(uint16_t u16a, uint16_t u16b) {
res = u32a * (u16a + u16b); // 10.7 res = u32a * (u16a + u16b); // 10.7
u32a *= u16a + u16b; // 10.7 u32a *= u16a + u16b; // 10.7
u32a = ((uint32_t)4 * (uint32_t)2 * (uint32_t)4 ); // no-warning (#10488) 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) { static void misra_10_8(u8 x, s32 a, s32 b) {
@ -794,13 +756,6 @@ static void misra_10_8(u8 x, s32 a, s32 b) {
int (*misra_11_1_p)(void); // 8.4 int (*misra_11_1_p)(void); // 8.4
void *misra_11_1_bad1 = (void*)misra_11_1_p; // 11.1 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_s;
struct misra_11_2_t; struct misra_11_2_t;
@ -813,15 +768,12 @@ static void misra_11_3(u8* p, struct Fred *fred) {
struct Wilma *wilma = (struct Wilma *)fred; // 11.3 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) { static void misra_11_4(u8*p) {
u64 y = (u64)p; // 11.4 u64 y = (u64)p; // 11.4
u8 *misra_11_4_A = ( u8 * ) 0x0005;// 11.4 u8 *misra_11_4_A = ( u8 * ) 0x0005;// 11.4
s32 misra_11_4_B; s32 misra_11_4_B;
u8 *q = ( u8 * ) misra_11_4_B; // 11.4 u8 *q = ( u8 * ) misra_11_4_B; // 11.4
dummy = A_11_4->something; // no-warning
} }
static void misra_11_5(void *p) { static void misra_11_5(void *p) {
@ -836,8 +788,6 @@ static void misra_11_6(void) {
x = (u64)p; // 11.6 x = (u64)p; // 11.6
p = ( void * )0; // no-warning p = ( void * )0; // no-warning
(void)p; // no-warning (void)p; // no-warning
// # 12184
p = (void*)0U; // no-warning
} }
@ -945,8 +895,7 @@ void misra_12_3(int a, int b, int c) {
f((1,2),3); // TODO 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
for (i=0; i<10; i++, j++){} // 12.3 14.2
for (int i = 0, p = &a1; // 12.3 14.2 for (int i = 0, p = &a1; // 12.3 14.2
i < 42; i < 42;
++i, ++p ) // 12.3 ++i, ++p ) // 12.3
@ -1170,15 +1119,12 @@ static s13_4_t s13_4 =
.string = STRING_DEF_13_4 // no-warning .string = STRING_DEF_13_4 // no-warning
}; };
static void misra_13_4(int x, int z) { static void misra_13_4(void) {
int y;
if (x != (y = z)) {} // 13.4 if (x != (y = z)) {} // 13.4
else {} else {}
} }
static void misra_13_5(void) { static void misra_13_5(void) {
int x = 0;
int y = 0;
if (x && (y++ < 123)){} // 13.5 if (x && (y++ < 123)){} // 13.5
if (x || ((y += 19) > 33)){} // 13.5 if (x || ((y += 19) > 33)){} // 13.5
if (x || ((y = 25) > 33)){} // 13.5 13.4 if (x || ((y = 25) > 33)){} // 13.5 13.4
@ -1210,11 +1156,9 @@ static void misra_14_1(void) {
static void misra_14_2_init_value(int32_t *var) { static void misra_14_2_init_value(int32_t *var) {
*var = 0; *var = 0;
} }
static void misra_14_2_init_value_1(int32_t *var);
static void misra_14_2_fn1(bool b) { static void misra_14_2_fn1(bool b) {
for (;i++<10;) {} // 14.2 for (;i++<10;) {} // 14.2
for (;i<10;dostuff()) {} // 14.2 for (;i<10;dostuff()) {} // TODO
int32_t g = 0; int32_t g = 0;
int g_arr[42]; int g_arr[42];
g += 2; // no-warning g += 2; // no-warning
@ -1224,23 +1168,15 @@ static void misra_14_2_fn1(bool b) {
g += 2; g += 2;
i2 ^= 2; // 14.2 i2 ^= 2; // 14.2
if (i2 == 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 misra_14_2_init_value(&i2); // TODO: Fix false negative in function call
} }
int i1;
int i2; for (misra_14_2_init_value(&i); i < 10; ++i) {} // no-warning FIXME: False positive for 14.2 Trac #9491
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
bool abort = false; bool abort = false;
for (i = 0; (i < 10) && !abort; ++i) { // 14.2 as 'i' is not a variable for (i = 0; (i < 10) && !abort; ++i) { // no-warning
if (b) {
abort = true;
}
}
for (int i = 0; (i < 10) && !abort; ++i) { // no warning
if (b) { if (b) {
abort = true; abort = true;
} }
@ -1251,18 +1187,6 @@ static void misra_14_2_fn1(bool b) {
for (int i = x; i < 42; i++) { for (int i = x; i < 42; i++) {
x++; // no warning 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++) { for (int i = (x - 3); i < 42; i++) {
x ^= 3; // no warning x ^= 3; // no warning
} }
@ -1282,17 +1206,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) static void misra_14_2_fn2(void)
{ {
@ -1306,18 +1219,16 @@ static void misra_14_2_fn2(void)
for (int i = 0, j = 19; y < 10, --j > 10; y++, j--) { // 14.2 12.3 for (int i = 0, j = 19; y < 10, --j > 10; y++, j--) { // 14.2 12.3
i++; // no warning i++; // no warning
} }
// 1st clause is not empty, but is not used in 2nd and 3rd clause for (int i = 0; y < 10; y++) { // TODO: 14.2
for (int i = 0; y < 10; y++) { // 14.2
i++; // no warning i++; // no warning
} }
for (; y < 10; y++) {} // without 1st clause, no error for (int i = 0; i < 10; y++) { // TODO: 14.2
for (int i = 0; i < 10; y++) { // 14.2
i++; // no warning 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 i++; // no warning
} }
for (int i = 0; i < 10; (y+=i)) { // 14.2 for (int i = 0; i < 10; (y+=i)) {
i++; // no warning i++; // no warning
} }
@ -1343,16 +1254,13 @@ struct {
unsigned int y:1; unsigned int y:1;
} r14_4_struct; // 8.4 } r14_4_struct; // 8.4
static void misra_14_4(bool b) { static void misra_14_4(bool b) {
if (x+4){} //config if (x+4){} // 14.4
else {} else {}
if (b) {} if (b) {}
else {} else {}
if (r14_4_struct.x) {} if (r14_4_struct.x) {}
// #12079
if (z) {} //config
} }
static void misra_15_1(void) { static void misra_15_1(void) {
@ -1365,9 +1273,7 @@ label:
goto label; // 15.2 15.1 goto label; // 15.2 15.1
} }
static void misra_15_3(int a) { static void misra_15_3(void) {
int x = 0;
int y;
if (x!=0) { if (x!=0) {
goto L1; // 15.3 15.1 goto L1; // 15.3 15.1
if (y!=0) { if (y!=0) {
@ -1418,7 +1324,7 @@ static void misra_15_4(void) {
if (y==2) { if (y==2) {
break; break;
} }
for (z = 0; y < 42; ++z) { // 14.2 for (z = 0; y < 42; ++z) {
if (z==1) { if (z==1) {
break; break;
} }
@ -1482,14 +1388,14 @@ static void misra_15_4(void) {
} }
} }
static int misra_15_5(int x) { static int misra_15_5(void) {
if (x!=0) { if (x!=0) {
return 1; // 15.5 return 1; // 15.5
} else {} } else {}
return 2; return 2;
} }
static void misra_15_6(int x) { static void misra_15_6(void) {
if (x!=0); // 15.6 if (x!=0); // 15.6
else{} else{}
@ -1508,20 +1414,10 @@ static void misra_15_6(int x) {
do {} while (x<0); // no-warning do {} while (x<0); // no-warning
} }
static void misra_15_6_fp(void)
{
uint8_t value = 0U;
do // Test
{
value++;
}
while (value < 2U);
}
#if defined(M_20_9) && M_20_9 > 1 // no-warning (#10380) #if defined(M_20_9) && M_20_9 > 1 // no-warning (#10380)
#endif #endif
static void misra_15_7(int x, int a, int b) { static void misra_15_7(void) {
uint32_t var = 0; uint32_t var = 0;
uint32_t var2 = 0; uint32_t var2 = 0;
@ -1557,7 +1453,7 @@ static void misra_16_1(int32_t i) {
} }
} }
static void misra_16_2(int y) { static void misra_16_2(void) {
switch (x) { switch (x) {
default: default:
break; break;
@ -1569,8 +1465,7 @@ static void misra_16_2(int y) {
} }
} }
static void misra_16_3(int b) { static void misra_16_3(void) {
int a;
switch (x) { switch (x) {
case 1: case 1:
case 2: case 2:
@ -1653,8 +1548,6 @@ static void misra_16_3(int b) {
case 2: case 2:
x++; x++;
} // 16.3 } // 16.3
#define M_16_3(a,b,default) { (a), (b), (default) },
} }
static void misra_16_4(void) { static void misra_16_4(void) {
@ -1708,7 +1601,7 @@ static void misra_16_7(void) {
} }
static void misra_17_1(void) { static void misra_17_1(void) {
va_list(); // 17.1 17.7 va_list(); // 17.1
va_arg(); // 17.1 va_arg(); // 17.1
va_start(); // 17.1 va_start(); // 17.1
va_end(); // 17.1 va_end(); // 17.1
@ -1742,24 +1635,11 @@ static void misra_17_2_5(void) {
misra_17_2_1(); // no-warning 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 void misra_17_6(int x[static 20]) {(void)x;} // 17.6
static int calculation(int x) { return x + 1; } static int calculation(int x) { return x + 1; }
static void misra_17_7(void) { static void misra_17_7(void) {
calculation(123); // 17.7 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) { static void misra_17_8(int x) {
@ -1799,7 +1679,6 @@ struct {
} r18_7_struct; // 8.4 } r18_7_struct; // 8.4
struct { struct {
uint16_t len; uint16_t len;
int (*array_param_func_ptr)(char const *argv[], int argc); // no-warning
uint8_t data_1[ 19 ]; uint8_t data_1[ 19 ];
uint8_t data_2[ ]; // 18.7 uint8_t data_2[ ]; // 18.7
} r18_7_struct; // 8.4 } r18_7_struct; // 8.4
@ -1813,8 +1692,6 @@ static void misra_18_8(int x) {
int buf1[10]; int buf1[10];
int buf2[sizeof(int)]; int buf2[sizeof(int)];
int vla[x]; // 18.8 int vla[x]; // 18.8
// #9498
int vlb[y]; // config
static const unsigned char arr18_8_1[] = UNDEFINED_ID; static const unsigned char arr18_8_1[] = UNDEFINED_ID;
static uint32_t enum_test_0[R18_8_ENUM_CONSTANT_0] = {0}; static uint32_t enum_test_0[R18_8_ENUM_CONSTANT_0] = {0};
} }
@ -2002,13 +1879,4 @@ static void misra_22_10(void)
errno = 0; errno = 0;
f = strtod ( "A.12", NULL ); f = strtod ( "A.12", NULL );
if ( 0 == errno ) {} 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 { class misra_21_1_C {
public: 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 { class C2 {
@ -16,9 +16,9 @@ public:
private: private:
void* f; void* f;
}; };
C2::C2(void) : f(NULL) {} C2::C2() : f(NULL) {}
static void test_misra_21_1_crash(void) static bool test_misra_21_1_crash(void)
{ {
auto misra_21_1_C a, b; // 12.3 auto misra_21_1_C a, b; // 12.3
a = b; a = b;

View File

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

View File

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

View File

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

37
addons/test/test-cert.py Normal file
View File

@ -0,0 +1,37 @@
# Running the test with Python 2:
# Be sure to install pytest version 4.6.4 (newer should also work)
# Command in cppcheck directory:
# python -m pytest addons/test/test-cert.py
#
# Running the test with Python 3:
# Command in cppcheck directory:
# PYTHONPATH=./addons python3 -m pytest addons/test/test-cert.py
import sys
import pytest
def test_arguments_regression():
args_ok = ["-q", "--quiet",
"-verify",
"--cli"]
# Arguments with expected SystemExit
args_exit = ["--non-exists", "--non-exists-param=42", "-h", "--help"]
from addons.cert import get_args_parser
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)

View File

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

View File

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

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; int x;
}; };
void func() { void func() {
// cppcheck-suppress threadsafety-threadsafety static Dummy dummy;
static Dummy dummy;
} }

View File

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

View File

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

View File

@ -1,350 +1,39 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
""" #
cppcheck addon for threadsafety detection. # This script analyses Cppcheck dump files to locate threadsafety issues
# - warn about static local objects
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
import cppcheckdata import cppcheckdata
import sys
# -------------------------------- def reportError(token, severity, msg, id):
# List of MT-Unsafe identifiers cppcheckdata.reportError(token, severity, msg, 'threadsafety', id)
# --------------------------------
# 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, errid): # noqa: D103 def checkstatic(data):
cppcheckdata.reportError(token, severity, msg, 'threadsafety', errid)
def checkstatic(data): # noqa: D103
for var in data.variables: for var in data.variables:
if var.isStatic and var.isLocal: if var.isStatic and var.isLocal:
vartype = None type = None
if var.isClass: if var.isClass:
vartype = 'object' type = 'object'
else: else:
vartype = 'variable' type = 'variable'
if var.isConst: if var.isConst:
if data.standards.cpp == 'c++03': if data.standards.cpp == 'c++03':
reportError( reportError(var.typeStartToken, 'warning', 'Local constant static ' + type + ' \'' + var.nameToken.str + '\', dangerous if it is initialized in parallel threads', 'threadsafety-const')
var.typeStartToken,
'warning',
'Local constant static '
+ vartype + "'" + var.nameToken.str
+ "', dangerous if it is initialized"
+ ' in parallel threads',
'threadsafety-const')
else: else:
reportError(var.typeStartToken, 'warning', reportError(var.typeStartToken, 'warning', 'Local static ' + type + ': ' + var.nameToken.str, 'threadsafety')
'Local static ' + vartype + ': '
+ var.nameToken.str,
'threadsafety')
for arg in sys.argv[1:]:
if arg.startswith('-'):
continue
def check_MTunsafe(cfg): print('Checking %s...' % arg)
""" data = cppcheckdata.CppcheckData(arg)
Look for functions marked MT-unsafe in their man pages.
The MT-unsafe functions are listed in id_MTunsafe (and id_MTunsafe_full). for cfg in data.iterconfigurations():
That section of code can be regenerated by the external script MT-Unsafe.py print('Checking %s, config %s...' % (arg, cfg.name))
""" checkstatic(cfg)
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)
sys.exit(cppcheckdata.EXIT_CODE) sys.exit(cppcheckdata.EXIT_CODE)

View File

@ -9,13 +9,15 @@
# 3. Any Y2038-unsafe symbol when _USE_TIME_BITS64 is not defined. # 3. Any Y2038-unsafe symbol when _USE_TIME_BITS64 is not defined.
# #
# Example usage: # 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 from __future__ import print_function
import cppcheckdata import cppcheckdata
import sys import sys
import os
import re import re
@ -154,14 +156,22 @@ def check_y2038_safe(dumpfile, quiet=False):
# load XML from .dump file # load XML from .dump file
data = cppcheckdata.CppcheckData(dumpfile) 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(): for cfg in data.iterconfigurations():
if not quiet: if not quiet:
print('Checking %s, config %s...' % (srcfile, cfg.name)) print('Checking %s, config %s...' % (srcfile, cfg.name))
safe_ranges = [] safe_ranges = []
safe = -1 safe = -1
time_bits_defined = False time_bits_defined = False
srclinenr = 0 srclinenr = '0'
for directive in cfg.directives: for directive in cfg.directives:
# track source line number # track source line number
@ -226,7 +236,7 @@ if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
exit_code = 0 exit_code = 0
quiet = args.quiet or args.cli quiet = not any((args.quiet, args.cli))
if not args.dumpfile: if not args.dumpfile:
if not args.quiet: if not args.quiet:
@ -234,7 +244,7 @@ if __name__ == '__main__':
sys.exit(0) sys.exit(0)
for dumpfile in args.dumpfile: for dumpfile in args.dumpfile:
if not quiet: if not args.quiet:
print('Checking ' + dumpfile + '...') print('Checking ' + dumpfile + '...')
check_y2038_safe(dumpfile, quiet) check_y2038_safe(dumpfile, quiet)

72
appveyor.yml Normal file
View File

@ -0,0 +1,72 @@
version: '{build}'
clone_depth: 10
matrix:
fast_finish: true
environment:
matrix:
- VisualStudioVersion: 12.0
platform: x64
configuration: Debug
vcvarsall_platform: x64
PlatformToolset: v120
MYQTDIR: C:\Qt\5.6\msvc2013_64
- VisualStudioVersion: 12.0
platform: x64
configuration: Release
vcvarsall_platform: x64
PlatformToolset: v120
# FIXME: These are disabled for now. They were broken by ae8653612802b41b70424ec9a5eefe8a1178f6d1
# - VisualStudioVersion: 14.0
# platform: x64
# configuration: Debug
# vcvarsall_platform: x64
# PlatformToolset: v140
# MYQTDIR: C:\Qt\5.11\msvc2015_64
# That platform causes frequent errors on appveyor due to an unknown infrastructure failure
# - VisualStudioVersion: 14.0
# platform: x64
# configuration: Release
# vcvarsall_platform: x64
# PlatformToolset: v140
install:
- curl -fsSL https://github.com/Z3Prover/z3/releases/download/z3-4.8.9/z3-4.8.9-%platform%-win.zip -o z3-4.8.9-win.zip
- 7z x z3-4.8.9-win.zip -oexternals -r -y
- move externals\z3-4.8.9-%platform%-win externals\z3
build_script:
- ECHO Building %configuration% %platform% with MSVC %VisualStudioVersion% using %PlatformToolset% PlatformToolset
- 'CALL "C:\Program Files (x86)\Microsoft Visual Studio %VisualStudioVersion%\VC\vcvarsall.bat" %vcvarsall_platform%'
# Visual studio project..
- mkdir vsbuild
- cd vsbuild
- cmake -DBUILD_TESTS=ON -DCTEST_TIMEOUT=240 ..
- cmake --build . --target check --config %configuration%
- cd ..
# the following builds are Debug ones so do not perform them in Release jobs
- 'IF "%configuration%" == "Release" exit /b 0'
# use all available processes for nmake
- set CL=/MP
# cmake..
- mkdir build
- cd build
- cmake -DBUILD_TESTS=ON -G"NMake Makefiles" ..
- nmake
- copy bin\cppcheck.exe ..
- cd ..
# build gui..
- ECHO MYQTDIR=%MYQTDIR%
- 'IF defined MYQTDIR cd gui'
- 'IF defined MYQTDIR set QTDIR=%MYQTDIR%'
- 'IF defined MYQTDIR set PATH=%PATH%;%QTDIR%\bin'
- 'IF defined MYQTDIR %QTDIR%\bin\qmake'
- 'IF defined MYQTDIR nmake'
- 'IF defined MYQTDIR cd ..'
test_script:
- build\bin\testrunner.exe -q
- IF EXIST bin\debug\testrunner.exe bin\debug\testrunner.exe -q
- IF EXIST bin\testrunner.exe bin\testrunner.exe -q

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 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 line version of cppcheck. It is readily available on Linux and Mac OS X, but
must be obtained separately for Windows. must be obtained separately for Windows.
If you're using qmake to generate makefiles, the following behavior applies: 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 - 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 to enable rules support. You can disable rules support (removing the PCRE
dependency) by passing HAVE_RULES=no to qmake. dependency) by passing HAVE_RULES=no to qmake.
- If you are on Windows, but have PCRE available, you can enable rules support - If you are on Windows, but have PCRE available, you can enable rules support
by passing HAVE_RULES=yes to qmake. by passing HAVE_RULES=yes to qmake.
- Note: This includes using build.bat since it calls qmake - to use PCRE and - 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.bat, you need to run set HAVE_RULES=yes before each run of build.bat
Build instructions Build instructions
------------------ ------------------
Windows Windows
------- -------
Visual Studio Visual Studio
To build PCRE, download the source code from www.pcre.org and To build PCRE, download the source code from www.pcre.org and
CMake (https://cmake.org/download/). We assume you use Visual Studio 2015 - CMake (https://cmake.org/download/). We assume you use Visual Studio 2015 -
otherwise adapt the commands for your version. otherwise adapt the commands for your version.
VS Solution file VS Solution file
cmake . -G "Visual Studio 14 2015" cmake . -G "Visual Studio 14 2015"
Open PCRE.sln with VS IDE or via cmd: Open PCRE.sln with VS IDE or via cmd:
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86 call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
MSBuild PCRE.sln /target:Build /property:Configuration="Release" MSBuild PCRE.sln /target:Build /property:Configuration="Release"
For 64-bit target: cmake . -G "Visual Studio 14 2015 Win64" For 64-bit target: cmake . -G "Visual Studio 14 2015 Win64"
or using NMake or using NMake
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86 call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
cmake . -G "NMake Makefiles" cmake . -G "NMake Makefiles"
nmake nmake
or using MSYS or using MSYS
cmake . -G "MSYS Makefiles" cmake . -G "MSYS Makefiles"
make make
Linux Linux
----- -----
The normal Makefile should work. The normal Makefile should work.
Install PCRE on Ubuntu might be needed: Install PCRE on Ubuntu might be needed:
sudo apt-get install libpcre3 libpcre3-dev sudo apt-get install libpcre3 libpcre3-dev
Mac OSX Mac OSX
------- -------
Install PCRE: Install PCRE:
homebre homebre
brew install pcre brew install pcre
or macport or macport
sudo port install pcre sudo port install pcre
Ensure /path/to/pcre.h is in CXXFLAGS, e.g: Ensure /path/to/pcre.h is in CXXFLAGS, e.g:
for homebrew for homebrew
export CXXFLAGS=${CXXFLAGS}:/usr/local/include export CXXFLAGS=${CXXFLAGS}:/usr/local/include
or macport or macport
export CXXFLAGS=${CXXFLAGS}:/opt/local/include export CXXFLAGS=${CXXFLAGS}:/opt/local/include
Or for MSVC copy pcre.lib and pcre.h in /externals directory. Or for MSVC copy pcre.lib and pcre.h in /externals directory.

View File

@ -3,6 +3,8 @@
<def format="2"> <def format="2">
<!-- stdint.h --> <!-- stdint.h -->
<define name="__USING_MINT8" value="0"/> <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 --> <!-- Integer types capable of holding object pointers -->
<podtype name="intptr_t" sign="s" size="2"/> <podtype name="intptr_t" sign="s" size="2"/>
<podtype name="uintptr_t" sign="u" 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_MAX" value="INT8_MAX"/>
<define name="SIG_ATOMIC_MIN" value="INT8_MIN"/> <define name="SIG_ATOMIC_MIN" value="INT8_MIN"/>
<define name="SIZE_MAX" value="(__CONCAT(INT16_MAX, U))"/> <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 --> <!-- FIXME: add macros for printf and scanf format specifiers,e.g. PRId8 -->
<!-- math.h --> <!-- 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="powf" value="pow"/>
<define name="roundf" value="round"/> <define name="roundf" value="round"/>
<define name="signbitf" value="signbit"/> <define name="signbitf" value="signbit"/>
@ -111,6 +137,9 @@
<define name="putchar(__c)" value="fputc(__c, stdout)"/> <define name="putchar(__c)" value="fputc(__c, stdout)"/>
<define name="getc(__stream)" value="fgetc(__stream)"/> <define name="getc(__stream)" value="fgetc(__stream)"/>
<define name="getchar()" value="fgetc(stdin)"/> <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"> <function name="vfprintf_P">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>

View File

@ -12,11 +12,8 @@
<define name="BOOST_TYPEOF_REGISTER_TYPE(x)" value=""/> <define name="BOOST_TYPEOF_REGISTER_TYPE(x)" value=""/>
<define name="BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)" value=""/> <define name="BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)" value=""/>
<define name="BOOST_PP_LIST_FOR_EACH(macro, data, list)" value=""/> <define name="BOOST_PP_LIST_FOR_EACH(macro, data, list)" value=""/>
<define name="BOOST_PP_SEQ_FOR_EACH(macro, data, list)" value=""/>
<define name="BOOST_PP_SEQ_TRANSFORM(macro, data, list)" value=""/>
<define name="BOOST_PP_CAT(a, b)" value=""/> <define name="BOOST_PP_CAT(a, b)" value=""/>
<define name="BOOST_PP_REPEAT(a,b,c)" 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 --> <!-- https://www.boost.org/doc/libs/master/doc/html/foreach.html -->
<define name="BOOST_FOREACH(A,B)" value="for (A: B)"/> <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 --> <!-- https://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html -->
@ -26,41 +23,21 @@
<define name="BOOST_THROW_EXCEPTION(X)" value="boost::throw_exception(X)"/> <define name="BOOST_THROW_EXCEPTION(X)" value="boost::throw_exception(X)"/>
<define name="BOOST_LIKELY(X)" value="(X)"/> <define name="BOOST_LIKELY(X)" value="(X)"/>
<define name="BOOST_UNLIKELY(X)" value="(X)"/> <define name="BOOST_UNLIKELY(X)" value="(X)"/>
<define name="BOOST_FIXTURE_TEST_SUITE(name, fixture, ...)" value="struct name : fixture {" /> <define name="BOOST_FIXTURE_TEST_SUITE(...)" value=""/>
<define name="BOOST_FIXTURE_TEST_SUITE_END()" value="};"/> <define name="BOOST_FIXTURE_TEST_SUITE_END()" value=""/>
<define name="BOOST_TEST_GLOBAL_FIXTURE(name)" value=""/> <define name="BOOST_TEST_GLOBAL_FIXTURE(name)" value=""/>
<define name="BOOST_PYTHON_FUNCTION_OVERLOADS(foo_overloads, foo, x, y)" value=""/> <define name="BOOST_PYTHON_FUNCTION_OVERLOADS(foo_overloads, foo, x, y)" value=""/>
<define name="BOOST_AUTO_TEST_SUITE(name, ...)" value="namespace name {" /> <define name="BOOST_AUTO_TEST_SUITE(...)" value=""/>
<define name="BOOST_AUTO_TEST_SUITE_END()" value="}" /> <define name="BOOST_AUTO_TEST_SUITE_END()" value=""/>
<define name="BOOST_ASSERT(condition)" value="assert(condition)"/> <define name="BOOST_ASSERT(condition)" value="assert(condition)"/>
<define name="BOOST_TEST(condition, ...)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;(condition))" /> <define name="BOOST_TEST(condition)" value="assert(condition)"/>
<define name="BOOST_TEST_REQUIRE(condition, ...)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;(condition))" /> <define name="BOOST_WARN(condition)" value="assert(condition)"/>
<define name="BOOST_WARN(condition)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;(condition))" /> <define name="BOOST_CHECK(condition)" value="assert(condition)"/>
<define name="BOOST_WARN_MESSAGE(condition, msg)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;(condition)); std::string(msg)" /> <define name="BOOST_REQUIRE(condition)" value="assert(condition)"/>
<define name="BOOST_WARN_EQUAL(a, b)" value="static_cast&lt;void&gt;((a) == (b))" /> <define name="BOOST_CHECK_EQUAL(a,b)" value="assert((a) == (b))"/>
<define name="BOOST_WARN_NE(a, b)" value="static_cast&lt;void&gt;((a) != (b))" /> <define name="BOOST_WARN_EQUAL(a,b)" value="assert((a) == (b))"/>
<define name="BOOST_WARN_GT(a, b)" value="static_cast&lt;void&gt;((a) &gt; (b))" /> <define name="BOOST_REQUIRE_EQUAL(a,b)" value="assert((a) == (b))"/>
<define name="BOOST_WARN_GE(a, b)" value="static_cast&lt;void&gt;((a) &gt;= (b))" />
<define name="BOOST_WARN_LT(a, b)" value="static_cast&lt;void&gt;((a) &lt; (b))" />
<define name="BOOST_WARN_LE(a, b)" value="static_cast&lt;void&gt;((a) &lt;= (b))" />
<define name="BOOST_CHECK(condition)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;(condition))" />
<define name="BOOST_CHECK_MESSAGE(condition, msg)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;(condition)); std::string(msg)" />
<define name="BOOST_CHECK_EQUAL(a, b)" value="static_cast&lt;void&gt;((a) == (b))" />
<define name="BOOST_CHECK_NE(a, b)" value="static_cast&lt;void&gt;((a) != (b))" />
<define name="BOOST_CHECK_GT(a, b)" value="static_cast&lt;void&gt;((a) &gt; (b))" />
<define name="BOOST_CHECK_GE(a, b)" value="static_cast&lt;void&gt;((a) &gt;= (b))" />
<define name="BOOST_CHECK_LT(a, b)" value="static_cast&lt;void&gt;((a) &lt; (b))" />
<define name="BOOST_CHECK_LE(a, b)" value="static_cast&lt;void&gt;((a) &lt;= (b))" />
<define name="BOOST_REQUIRE(condition)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;(condition))" />
<define name="BOOST_REQUIRE_MESSAGE(condition, msg)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;(condition)); std::string(msg)" />
<define name="BOOST_REQUIRE_EQUAL(a, b)" value="static_cast&lt;void&gt;(static_cast&lt;bool&gt;((a) == (b)))" />
<define name="BOOST_REQUIRE_NE(a, b)" value="static_cast&lt;void&gt;((a) != (b))" />
<define name="BOOST_REQUIRE_GT(a, b)" value="static_cast&lt;void&gt;((a) &gt; (b))" />
<define name="BOOST_REQUIRE_GE(a, b)" value="static_cast&lt;void&gt;((a) &gt;= (b))" />
<define name="BOOST_REQUIRE_LT(a, b)" value="static_cast&lt;void&gt;((a) &lt; (b))" />
<define name="BOOST_REQUIRE_LE(a, b)" value="static_cast&lt;void&gt;((a) &lt;= (b))" />
<define name="BOOST_LOG_ATTRIBUTE_KEYWORD(keyword, name_, value_type_)" value="value_type_ keyword;"/> <define name="BOOST_LOG_ATTRIBUTE_KEYWORD(keyword, name_, value_type_)" value="value_type_ keyword;"/>
<define name="BOOST_TEST_DONT_PRINT_LOG_VALUE(the_type)" value="" />
<!--Boost.Math Macros --> <!--Boost.Math Macros -->
<define name="BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS" value=""/> <define name="BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS" value=""/>
<define name="BOOST_MATH_USE_FLOAT128" value=""/> <define name="BOOST_MATH_USE_FLOAT128" value=""/>
@ -85,17 +62,13 @@
<define name="BOOST_MATH_INT_VALUE_SUFFIX" value=""/> <define name="BOOST_MATH_INT_VALUE_SUFFIX" value=""/>
<!-- Tell cppcheck to interpret BOOST_AUTO_TEST_CASE as a function definition --> <!-- Tell cppcheck to interpret BOOST_AUTO_TEST_CASE as a function definition -->
<define name="BOOST_AUTO_TEST_CASE(...)" value="void BOOST_AUTO_TEST_CASE_run(__VA_ARGS__)"/> <define name="BOOST_AUTO_TEST_CASE(...)" value="void BOOST_AUTO_TEST_CASE_run(__VA_ARGS__)"/>
<define name="BOOST_FIXTURE_TEST_CASE(name, fixture, ...)" value="struct name : fixture { void test_method(); }; void name::test_method()" /> <define name="BOOST_FIXTURE_TEST_CASE(...)" value="void BOOST_FIXTURE_TEST_CASE_run(__VA_ARGS__)"/>
<define name="BOOST_FIXTURE_TEST_CASE_TEMPLATE(test_name, type_name, TL, F)" value="template&lt;typename type_name&gt; struct test_name : public F { void test_method(); }; template&lt;typename type_name&gt; void test_name&lt;type_name&gt;::test_method()" /> <define name="BOOST_AUTO_TEST_CASE_TEMPLATE( test_name, type_name, TL )" value="void BOOST_AUTO_TEST_CASE_TEMPLATE_run( test_name, type_name, TL )"/>
<define name="BOOST_DATA_TEST_CASE(...)" value="void BOOST_DATA_TEST_CASE_run(__VA_ARGS__)"/> <define name="BOOST_DATA_TEST_CASE(...)" value="void BOOST_DATA_TEST_CASE_run(__VA_ARGS__)"/>
<define name="BOOST_DATA_TEST_CASE_F(...)" value="void BOOST_DATA_TEST_CASE_F_run(__VA_ARGS__)"/> <define name="BOOST_DATA_TEST_CASE_F(...)" value="void BOOST_DATA_TEST_CASE_F_run(__VA_ARGS__)"/>
<define name="BOOST_PYTHON_MODULE(str)" value="void BOOST_PYTHON_MODULE_definition(str)"/> <define name="BOOST_PYTHON_MODULE(str)" value="void BOOST_PYTHON_MODULE_definition(str)"/>
<define name="BOOST_SCOPED_ENUM_DECLARE_BEGIN(x)" value=""/> <define name="BOOST_SCOPED_ENUM_DECLARE_BEGIN(x)" value=""/>
<define name="BOOST_SCOPED_ENUM_DECLARE_END(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 ########## -->
<!-- boost containers that are similar to std containers --> <!-- boost containers that are similar to std containers -->
<container id="boostArray" startPattern="boost :: array|scoped_array &lt;" inherits="stdArray"/> <container id="boostArray" startPattern="boost :: array|scoped_array &lt;" inherits="stdArray"/>
@ -108,7 +81,6 @@
<container id="boostVector" startPattern="boost :: vector|small_vector &lt;" inherits="stdVector"/> <container id="boostVector" startPattern="boost :: vector|small_vector &lt;" inherits="stdVector"/>
<container id="boostStableVector" startPattern="boost :: stable_vector|static_vector &lt;" inherits="stdVectorDeque"/> <container id="boostStableVector" startPattern="boost :: stable_vector|static_vector &lt;" inherits="stdVectorDeque"/>
<container id="boostDeque" startPattern="boost :: deque &lt;" inherits="stdDeque"/> <container id="boostDeque" startPattern="boost :: deque &lt;" inherits="stdDeque"/>
<container id="boostStringView" startPattern="boost :: string_view" inherits="stdStringView"/>
<!-- ########## Boost smart pointers ########## --> <!-- ########## Boost smart pointers ########## -->
<!-- https://www.boost.org/doc/libs/1_70_0/libs/smart_ptr/doc/html/smart_ptr.html --> <!-- https://www.boost.org/doc/libs/1_70_0/libs/smart_ptr/doc/html/smart_ptr.html -->
<smart-pointer class-name="boost::scoped_ptr"> <smart-pointer class-name="boost::scoped_ptr">

View File

@ -218,176 +218,6 @@
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </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 --> <!-- https://www.freebsd.org/cgi/man.cgi?query=arc4random -->
<!-- uint32_t arc4random(void); --> <!-- uint32_t arc4random(void); -->
<function name="arc4random"> <function name="arc4random">
@ -400,7 +230,7 @@
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="void"/> <returnValue type="void"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="out"> <arg nr="1">
<not-null/> <not-null/>
<minsize type="argvalue" arg="2"/> <minsize type="argvalue" arg="2"/>
</arg> </arg>
@ -465,59 +295,6 @@
<not-bool/> <not-bool/>
</arg> </arg>
</function> </function>
<function name="err,errx">
<noreturn>true</noreturn>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<formatstr/>
<arg nr="2" direction="in">
<formatstr/>
<strz/>
<not-uninit/>
</arg>
</function>
<function name="errc">
<noreturn>true</noreturn>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<formatstr/>
<arg nr="3" direction="in">
<formatstr/>
<strz/>
<not-uninit/>
</arg>
</function>
<function name="verr,verrx">
<noreturn>true</noreturn>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<strz/>
<not-uninit/>
</arg>
<arg nr="3"/>
</function>
<function name="verrc">
<noreturn>true</noreturn>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<formatstr/>
<arg nr="3" direction="in">
<strz/>
<not-uninit/>
</arg>
<arg nr="4"/>
</function>
<podtype name="FTS"/> <podtype name="FTS"/>
<podtype name="FTSENT"/> <podtype name="FTSENT"/>
<!-- This type definitions refer to https://mandoc.bsd.lv/includes/sys/types.h.html --> <!-- This type definitions refer to https://mandoc.bsd.lv/includes/sys/types.h.html -->

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> <valid>0:</valid>
</arg> </arg>
</function> </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, ...) --> <!-- 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. --> <!-- 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"> <function name="__builtin_assume_aligned">
@ -168,19 +140,6 @@
<arg nr="variadic" direction="in"> <arg nr="variadic" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/getenv.3.html -->
<!-- char * secure_getenv(const char *name); -->
<function name="secure_getenv">
<use-retval/>
<returnValue type="char *"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
</function> </function>
<!-- https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/Alignment.html --> <!-- https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/Alignment.html -->
<!-- __alignof__ is used like sizeof --> <!-- __alignof__ is used like sizeof -->
@ -213,21 +172,6 @@
<not-null/> <not-null/>
</arg> </arg>
</function> </function>
<!-- https://man7.org/linux/man-pages/man3/getpw.3.html -->
<!-- int getpw(uid_t uid, char *buf); -->
<function name="getpw">
<returnValue type="int"/>
<noreturn>false</noreturn>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
<arg nr="2" direction="out">
<not-null/>
<not-bool/>
</arg>
<warn severity="style" reason="Obsolescent" alternatives="getpwnam"/>
</function>
<!-- void timeradd(struct timeval *a, struct timeval *b, struct timeval *res);--> <!-- void timeradd(struct timeval *a, struct timeval *b, struct timeval *res);-->
<!-- void timersub(struct timeval *a, struct timeval *b, struct timeval *res);--> <!-- void timersub(struct timeval *a, struct timeval *b, struct timeval *res);-->
<function name="timeradd,timersub"> <function name="timeradd,timersub">
@ -276,50 +220,6 @@
<not-bool/> <not-bool/>
</arg> </arg>
</function> </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); --> <!-- void xexit(int status); -->
<function name="xexit"> <function name="xexit">
<noreturn>true</noreturn> <noreturn>true</noreturn>
@ -346,7 +246,6 @@
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
<strz/>
</arg> </arg>
</function> </function>
<!-- void xfree(void *block); --> <!-- void xfree(void *block); -->
@ -414,7 +313,7 @@
<arg nr="1" direction="out"> <arg nr="1" direction="out">
<not-null/> <not-null/>
<not-bool/> <not-bool/>
<minsize type="value" value="2" baseType="int"/> <minsize type="value" value="2"/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
@ -471,7 +370,6 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int isascii_l(int c, locale_t locale); --> <!-- int isascii_l(int c, locale_t locale); -->
@ -501,7 +399,6 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-uninit/> <not-uninit/>
@ -530,114 +427,6 @@
</arg> </arg>
<leak-ignore/> <leak-ignore/>
</function> </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 --> <!-- https://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html#Getopt-Long-Options -->
<!-- int getopt_long(int argc, char * const argv[], <!-- int getopt_long(int argc, char * const argv[],
const char *optstring, const char *optstring,
@ -678,7 +467,6 @@
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
<strz/>
</arg> </arg>
</function> </function>
<!-- char *strndupa(const char *s, size_t n); --> <!-- char *strndupa(const char *s, size_t n); -->
@ -689,7 +477,6 @@
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
@ -729,7 +516,6 @@
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<not-bool/> <not-bool/>
<strz/>
</arg> </arg>
</function> </function>
<!-- char *strdupa(const char *s); --> <!-- char *strdupa(const char *s); -->
@ -741,7 +527,6 @@
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
<strz/>
</arg> </arg>
</function> </function>
<!-- http://www.gnu.org/software/libc/manual/html_node/Backtraces.html --> <!-- http://www.gnu.org/software/libc/manual/html_node/Backtraces.html -->
@ -842,30 +627,6 @@
<not-bool/> <not-bool/>
</arg> </arg>
</function> </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 --> <!-- https://linux.die.net/man/3/ecvt_r -->
<!-- int ecvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); --> <!-- int ecvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="ecvt_r"> <function name="ecvt_r">
@ -980,23 +741,21 @@
<warn severity="style" reason="Obsolescent" alternatives="sprintf"/> <warn severity="style" reason="Obsolescent" alternatives="sprintf"/>
</function> </function>
<!-- https://www.gnu.org/software/gnulib/manual/html_node/c_002dstrcasestr.html --> <!-- 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"> <function name="strcasestr">
<use-retval/> <use-retval/>
<returnValue type="char *"/> <returnValue type="size_t"/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<pure/> <pure/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
<strz/>
</arg> </arg>
</function> </function>
<!-- http://linux.die.net/man/2/getresuid --> <!-- http://linux.die.net/man/2/getresuid -->
@ -1076,7 +835,6 @@
<arg nr="1"> <arg nr="1">
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
<arg nr="2"> <arg nr="2">
<not-null/> <not-null/>
@ -1091,7 +849,6 @@
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<not-bool/> <not-bool/>
<strz/>
</arg> </arg>
<leak-ignore/> <leak-ignore/>
</function> </function>
@ -1143,7 +900,6 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
<arg nr="3" direction="out"> <arg nr="3" direction="out">
<not-null/> <not-null/>
@ -1182,7 +938,6 @@
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-bool/> <not-bool/>
<strz/>
</arg> </arg>
</function> </function>
<!-- https://linux.die.net/man/3/execvpe --> <!-- https://linux.die.net/man/3/execvpe -->
@ -1194,7 +949,6 @@
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
@ -1273,7 +1027,6 @@
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<minsize type="argvalue" arg="3"/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
@ -1303,37 +1056,12 @@
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </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 --> <!-- http://man7.org/linux/man-pages/man3/ffs.3.html -->
<!-- int ffsl(long int i); <!-- int ffsl(long int i);
int ffsll(long long int i); --> int ffsll(long long int i); -->
<function name="ffsl,ffsll"> <function name="ffsl,ffsll">
<use-retval/> <use-retval/>
<!-- It returns the position of the first bit set, or 0 if no bits are set in i. --> <returnValue type="int"/>
<returnValue type="int">arg1==0 &amp;0</returnValue>
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
@ -1488,7 +1216,6 @@
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<minsize type="argvalue" arg="2"/> <minsize type="argvalue" arg="2"/>
<strz/>
</arg> </arg>
<arg nr="2"> <arg nr="2">
<not-uninit/> <not-uninit/>
@ -1553,7 +1280,6 @@
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
@ -1656,7 +1382,6 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="out"> <arg nr="3" direction="out">
<not-null/> <not-null/>
@ -1682,7 +1407,6 @@
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="4" direction="out"> <arg nr="4" direction="out">
<not-null/> <not-null/>
@ -1693,17 +1417,6 @@
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </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 allocation ########## -->
<resource> <resource>
<alloc init="true">mkostemp</alloc> <alloc init="true">mkostemp</alloc>
@ -1731,6 +1444,4 @@
<define name="STDIN_FILENO" value="0"/> <define name="STDIN_FILENO" value="0"/>
<define name="STDOUT_FILENO" value="1"/> <define name="STDOUT_FILENO" value="1"/>
<define name="STDERR_FILENO" value="2"/> <define name="STDERR_FILENO" value="2"/>
<entrypoint name="_init"/>
<entrypoint name="_fini"/>
</def> </def>

View File

@ -1,29 +1,29 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<def format="2"> <def format="2">
<!-- see https://github.com/google/googletest/blob/main/docs/primer.md --> <!-- see https://github.com/google/googletest/blob/master/googletest/docs/primer.md -->
<define name="ASSERT_TRUE(cond)" value="{if (!(cond)) throw false;}"/> <define name="ASSERT_TRUE(cond)" value="assert(cond)"/>
<define name="EXPECT_TRUE(cond)" value="(void)(cond)"/> <define name="EXPECT_TRUE(cond)" value="(void)(cond)"/>
<define name="ASSERT_FALSE(cond)" value="{if (cond) throw false;}"/> <define name="ASSERT_FALSE(cond)" value="assert(!(cond))"/>
<define name="EXPECT_FALSE(cond)" value="(void)(cond)"/> <define name="EXPECT_FALSE(cond)" value="(void)(cond)"/>
<define name="ASSERT_EQ(val1,val2)" value="{if (!((val1) == (val2))) throw false;}"/> <define name="ASSERT_EQ(val1,val2)" value="assert((val1)==(val2))"/>
<define name="EXPECT_EQ(val1,val2)" value="(void)((val1)==(val2))"/> <define name="EXPECT_EQ(val1,val2)" value="(void)((val1)==(val2))"/>
<define name="ASSERT_NE(val1,val2)" value="{if (!((val1) != (val2))) throw false;}"/> <define name="ASSERT_NE(val1,val2)" value="assert((val1)!=(val2))"/>
<define name="EXPECT_NE(val1,val2)" value="(void)((val1)!=(val2))"/> <define name="EXPECT_NE(val1,val2)" value="(void)((val1)!=(val2))"/>
<define name="ASSERT_LT(val1,val2)" value="{if (!((val1) &lt; (val2))) throw false;}"/> <define name="ASSERT_LT(val1,val2)" value="assert((val1)&lt;(val2))"/>
<define name="EXPECT_LT(val1,val2)" value="(void)((val1)&lt;(val2))"/> <define name="EXPECT_LT(val1,val2)" value="(void)((val1)&lt;(val2))"/>
<define name="ASSERT_LE(val1,val2)" value="{if (!((val1) &lt;= (val2))) throw false;}"/> <define name="ASSERT_LE(val1,val2)" value="assert((val1)&lt;=(val2))"/>
<define name="EXPECT_LE(val1,val2)" value="(void)((val1)&lt;=(val2))"/> <define name="EXPECT_LE(val1,val2)" value="(void)((val1)&lt;=(val2))"/>
<define name="ASSERT_GT(val1,val2)" value="{if (!((val1) &gt; (val2))) throw false;}"/> <define name="ASSERT_GT(val1,val2)" value="assert((val1)&gt;(val2))"/>
<define name="EXPECT_GT(val1,val2)" value="(void)((val1)&gt;(val2))"/> <define name="EXPECT_GT(val1,val2)" value="(void)((val1)&gt;(val2))"/>
<define name="ASSERT_GE(val1,val2)" value="{if (!((val1) &gt;= (val2))) throw false;}"/> <define name="ASSERT_GE(val1,val2)" value="assert((val1)&gt;=(val2))"/>
<define name="EXPECT_GE(val1,val2)" value="(void)((val1)&gt;=(val2))"/> <define name="EXPECT_GE(val1,val2)" value="(void)((val1)&gt;=(val2))"/>
<define name="ASSERT_STREQ(str1,str2)" value="{if (!(strcmp(str1, str2) == 0)) throw false;}"/> <define name="ASSERT_STREQ(str1,str2)" value="assert(strcmp(str1, str2) == 0)"/>
<define name="EXPECT_STREQ(str1,str2)" value="(void)(*(str1)==*(str2))"/> <define name="EXPECT_STREQ(str1,str2)" value="(void)(*(str1)==*(str2))"/>
<define name="ASSERT_STRNE(str1,str2)" value="{if (!(strcmp(str1, str2) != 0)) throw false;}"/> <define name="ASSERT_STRNE(str1,str2)" value="assert(strcmp(str1, str2) != 0)"/>
<define name="EXPECT_STRNE(str1,str2)" value="(void)(*(str1)!=*(str2))"/> <define name="EXPECT_STRNE(str1,str2)" value="(void)(*(str1)!=*(str2))"/>
<define name="ASSERT_STRCASEEQ(str1,str2)" value="{if (!(stricmp(str1, str2) == 0)) throw false;}"/> <define name="ASSERT_STRCASEEQ(str1,str2)" value="assert(stricmp(str1, str2) == 0)"/>
<define name="EXPECT_STRCASEEQ(str1,str2)" value="(void)(*(str1)==*(str2))"/> <define name="EXPECT_STRCASEEQ(str1,str2)" value="(void)(*(str1)==*(str2))"/>
<define name="ASSERT_STRCASENE(str1,str2)" value="{if (!(stricmp(str1, str2) != 0)) throw false;}"/> <define name="ASSERT_STRCASENE(str1,str2)" value="assert(stricmp(str1, str2) != 0)"/>
<define name="EXPECT_STRCASENE(str1,str2)" value="(void)(*(str1)!=*(str2))"/> <define name="EXPECT_STRCASENE(str1,str2)" value="(void)(*(str1)!=*(str2))"/>
<define name="ASSERT_THROW(code, e)" value="try{code;}catch(e){}"/> <define name="ASSERT_THROW(code, e)" value="try{code;}catch(e){}"/>
<define name="EXPECT_THROW(code, e)" value="try{code;}catch(e){}"/> <define name="EXPECT_THROW(code, e)" value="try{code;}catch(e){}"/>

View File

@ -36,22 +36,13 @@
<define name="G_STRINGIFY_ARG(contents)" value="#contents"/> <define name="G_STRINGIFY_ARG(contents)" value="#contents"/>
<define name="G_STRLOC" value="__FILE__ &quot;:&quot; G_STRINGIFY (__LINE__)"/> <define name="G_STRLOC" value="__FILE__ &quot;:&quot; G_STRINGIFY (__LINE__)"/>
<define name="G_STRFUNC" value="((const char*) (__FUNCTION__))"/> <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_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_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(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_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_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(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_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_ADD_PRIVATE(TypeName)" value=""/>
<define name="G_PRIVATE_OFFSET(TypeName, field)" value=""/> <define name="G_PRIVATE_OFFSET(TypeName, field)" value=""/>
<define name="G_PRIVATE_FIELD(TypeName, inst, field_type, field_name)" 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_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_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_)" value=""/>
<define name="G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)" 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="MAX(a, b)" value="(((a) &gt; (b)) ? (a) : (b))"/>
<define name="MIN(a, b)" value="(((a) &lt; (b)) ? (a) : (b))"/> <define name="MIN(a, b)" value="(((a) &lt; (b)) ? (a) : (b))"/>
<define name="ABS(a)" value="(((a) &lt; 0) ? -(a) : (a))"/> <define name="ABS(a)" value="(((a) &lt; 0) ? -(a) : (a))"/>
@ -2889,18 +2877,6 @@
<leak-ignore/> <leak-ignore/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
</function> </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, ...); --> <!-- gint g_fprintf (FILE *file, gchar const *format, ...); -->
<function name="g_fprintf"> <function name="g_fprintf">
<leak-ignore/> <leak-ignore/>

View File

@ -253,19 +253,4 @@
<define name="ON_THREAD_MESSAGE(x,y)" value=""/> <define name="ON_THREAD_MESSAGE(x,y)" value=""/>
<define name="ON_REGISTERED_THREAD_MESSAGE(x,y)" value=""/> <define name="ON_REGISTERED_THREAD_MESSAGE(x,y)" value=""/>
<define name="END_MESSAGE_MAP()" 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> </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 --> <!-- 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="BEGIN_COM_MAP(x)" value=""/>
<define name="END_COM_MAP()" 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_ENTRY(x)" value=""/>
<define name="COM_INTERFACE_ENTRY2(x, x2)" value=""/> <define name="COM_INTERFACE_ENTRY2(x, x2)" value=""/>
<define name="COM_INTERFACE_ENTRY_IID(iid, x)" value=""/> <define name="COM_INTERFACE_ENTRY_IID(iid, x)" value=""/>
@ -25,16 +20,8 @@
<define name="COM_INTERFACE_ENTRY_NOINTERFACE(x)" value=""/> <define name="COM_INTERFACE_ENTRY_NOINTERFACE(x)" value=""/>
<define name="DECLARE_LIBID(libid)" value=""/> <define name="DECLARE_LIBID(libid)" value=""/>
<define name="DECLARE_NO_REGISTRY()" 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(class,pid,vpid,nid,flags)" value=""/>
<define name="DECLARE_REGISTRY_APPID_RESOURCEID(resid,appid)" value=""/> <define name="DECLARE_REGISTRY_APPID_RESOURCEID(resid,appid)" value=""/>
<define name="DECLARE_REGISTRY_RESOURCE(x)" value=""/> <define name="DECLARE_REGISTRY_RESOURCE(x)" value=""/>
<define name="DECLARE_REGISTRY_RESOURCEID(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> </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 --> <!-- 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"> <function name="connect,QObject::connect">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
@ -415,7 +414,6 @@
<!-- bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) // static --> <!-- bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) // static -->
<function name="disconnect,QObject::disconnect"> <function name="disconnect,QObject::disconnect">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <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, 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, Functor functor, const QKeySequence &shortcut = ...) -->
<!-- QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0) --> <!-- 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"> <function name="QMenu::addAction">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="QAction *"/> <returnValue type="QAction *"/>
<leak-ignore/> <arg nr="1" direction="in">
<arg nr="1">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
</arg> </arg>
@ -766,7 +762,7 @@
<function name="QList::append,QStringList::append"> <function name="QList::append,QStringList::append">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="void"/> <returnValue type="void"/>
<arg nr="1" direction="in"> <arg nr="1">
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </function>
@ -886,6 +882,21 @@
<use-retval/> <use-retval/>
<const/> <const/>
</function> </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 --> <!-- QStandardItem *QStandardItem::child(int row, int column = 0) const -->
<function name="QStandardItem::child"> <function name="QStandardItem::child">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -920,6 +931,10 @@
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </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(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(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::compare(const QString &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/> <not-uninit/>
</arg> </arg>
</function> </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 --> <!-- const Key QMap::key(const T &value, const Key &defaultKey = Key()) const -->
<function name="QMap::key"> <function name="QMap::key">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -1097,6 +1120,33 @@
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </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) --> <!-- void QList::insert(int i, const T &value) -->
<!-- iterator QList::insert(iterator before, const T &value) --> <!-- iterator QList::insert(iterator before, const T &value) -->
<!-- QStringList inherits from QList --> <!-- QStringList inherits from QList -->
@ -3992,6 +4042,11 @@
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </function>
<!-- void QVector::clear() -->
<function name="QVector::clear,QStack::clear">
<noreturn>false</noreturn>
<returnValue type="void"/>
</function>
<!-- bool QVector::contains(const T &value) const --> <!-- bool QVector::contains(const T &value) const -->
<function name="QVector::contains,QStack::contains"> <function name="QVector::contains,QStack::contains">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -4015,6 +4070,19 @@
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </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 --> <!-- bool QVector::endsWith(const T &value) const -->
<function name="QVector::endsWith,QStack::endsWith"> <function name="QVector::endsWith,QStack::endsWith">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -4066,6 +4134,13 @@
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </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 --> <!-- int QVector::lastIndexOf(const T &value, int from = ...) const -->
<function name="QVector::lastIndexOf,QStack::lastIndexOf"> <function name="QVector::lastIndexOf,QStack::lastIndexOf">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -4081,6 +4156,13 @@
<not-bool/> <not-bool/>
</arg> </arg>
</function> </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(const T &value) -->
<!-- void QVector::push_back(T &&value) --> <!-- void QVector::push_back(T &&value) -->
<function name="QVector::push_back,QStack::push_back"> <function name="QVector::push_back,QStack::push_back">
@ -4962,7 +5044,6 @@
<function name="back" yields="item"/> <function name="back" yields="item"/>
<function name="last" yields="item"/> <function name="last" yields="item"/>
<function name="data" yields="buffer"/> <function name="data" yields="buffer"/>
<function name="constData" yields="buffer-nt"/>
<function name="rbegin" yields="start-iterator"/> <function name="rbegin" yields="start-iterator"/>
<function name="crbegin" yields="start-iterator"/> <function name="crbegin" yields="start-iterator"/>
<function name="rend" yields="end-iterator"/> <function name="rend" yields="end-iterator"/>
@ -5017,26 +5098,12 @@
<function name="at" yields="at_index"/> <function name="at" yields="at_index"/>
<function name="front" yields="item"/> <function name="front" yields="item"/>
<function name="back" 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="rbegin" yields="start-iterator"/>
<function name="crbegin" yields="start-iterator"/> <function name="crbegin" yields="start-iterator"/>
<function name="rend" yields="end-iterator"/> <function name="rend" yields="end-iterator"/>
<function name="crend" yields="end-iterator"/> <function name="crend" yields="end-iterator"/>
</access> </access>
</container> </container>
<type-checks>
<unusedvar>
<suppress>QApplication</suppress>
<suppress>QMutexLocker</suppress>
</unusedvar>
<operatorEqVarError>
<suppress>QMutex</suppress>
<suppress>QRecursiveMutex</suppress>
<suppress>QSemaphore</suppress>
<suppress>QReadWriteLock</suppress>
</operatorEqVarError>
</type-checks>
<!-- Treat QStringList as QList<QString> since we can't remove the template parameter when we inherit. --> <!-- Treat QStringList as QList<QString> since we can't remove the template parameter when we inherit. -->
<define name="QStringList" value="QList&lt;QString&gt;"/> <define name="QStringList" value="QList&lt;QString&gt;"/>
<define name="Q_ARG(type, data)" value="QArgument&lt;type &gt;(#type, data)"/> <define name="Q_ARG(type, data)" value="QArgument&lt;type &gt;(#type, data)"/>
@ -5069,7 +5136,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_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_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_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_ENUM(X)" value=""/>
<define name="Q_ENUMS(X)" value=""/> <define name="Q_ENUMS(X)" value=""/>
<define name="Q_ENUM_NS(X)" value=""/> <define name="Q_ENUM_NS(X)" value=""/>
@ -5081,15 +5147,13 @@
<define name="Q_LIKELY(expr)" value="expr"/> <define name="Q_LIKELY(expr)" value="expr"/>
<define name="Q_NAMESPACE" value=""/> <define name="Q_NAMESPACE" value=""/>
<define name="Q_NULLPTR" value="NULL"/> <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_PRIVATE_SLOT(d, signature)" value=""/>
<define name="Q_SLOTS" value=""/> <define name="Q_PROPERTY(X)" value=""/>
<!-- Treat as variadic macro to avoid preprocessorErrorDirective -->
<define name="Q_PROPERTY(...)" value=""/>
<define name="Q_Q(Class)" value="Class * const q = q_func()"/> <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_RETURN_ARG(type, data)" value="QReturnArgument&lt;type &gt;(#type, data)"/>
<define name="Q_UNLIKELY(expr)" value="expr"/> <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_BEGIN_NAMESPACE" value=""/>
<define name="QT_END_NAMESPACE" value=""/> <define name="QT_END_NAMESPACE" value=""/>
<define name="QT_TR_NOOP(x)" value="x"/> <define name="QT_TR_NOOP(x)" value="x"/>
@ -5098,20 +5162,17 @@
<define name="QT_TRANSLATE_NOOP_UTF8(scope, x)" value="x"/> <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(scope, x, comment)" value="{x, comment}"/>
<define name="QT_TRANSLATE_NOOP3_UTF8(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="QCOMPARE(actual, expected)" value="(void)((actual)==(expected))"/>
<define name="QVERIFY(condition)" value="(void)(condition)"/> <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_ONCE" value=""/>
<define name="QBENCHMARK" value=""/> <define name="QBENCHMARK" value=""/>
<define name="QTRY_COMPARE(actual, expected)" value="(void)((actual)==(expected))"/> <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_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_VERIFY(condition)" value="(void)(condition)"/>
<define name="QTRY_VERIFY2_WITH_TIMEOUT(condition, message, timeout)" value="(void)(condition),(void)(message),(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),(void)(timeout)"/> <define name="QTRY_VERIFY_WITH_TIMEOUT(condition, timeout)" value="(void)(condition)"/>
<define name="QTEST_GUILESS_MAIN(testclass)" value=""/> <define name="QTEST_GUILESS_MAIN(testclass)" value=""/>
<define name="QTEST_APPLESS_MAIN(testclass)" value=""/> <define name="QTEST_APPLESS_MAIN(testclass)" value=""/>
<define name="QTEST_MAIN(testclass)" value=""/> <define name="QTEST_MAIN(testclass)" value=""/>
@ -5120,10 +5181,7 @@
<define name="Q_FOREACH(A,B)" value="for(A:B)"/> <define name="Q_FOREACH(A,B)" value="for(A:B)"/>
<define name="foreach(A,B)" value="for(A:B)"/> <define name="foreach(A,B)" value="for(A:B)"/>
<define name="forever" value="for (;;)"/> <define name="forever" value="for (;;)"/>
<define name="emit" value=""/> <define name="emit(X)" value="(X)"/>
<define name="slots" value=""/>
<define name="signals" value="protected"/>
<define name="Q_SIGNALS" value="protected"/>
<define name="Q_OVERRIDE(x)" value=""/> <define name="Q_OVERRIDE(x)" value=""/>
<define name="Q_PLUGIN_METADATA(x)" value=""/> <define name="Q_PLUGIN_METADATA(x)" value=""/>
<define name="Q_ASSERT(condition)" value="assert(condition)"/> <define name="Q_ASSERT(condition)" value="assert(condition)"/>
@ -5142,7 +5200,6 @@
<define name="QT_FORWARD_DECLARE_STRUCT(name)" value="struct name;"/> <define name="QT_FORWARD_DECLARE_STRUCT(name)" value="struct name;"/>
<!-- https://doc.qt.io/qt-5/qstring.html#QStringLiteral --> <!-- https://doc.qt.io/qt-5/qstring.html#QStringLiteral -->
<define name="QStringLiteral(str)" value="QString::fromUtf8(str, sizeof(str) - 1)"/> <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 --> <!-- https://doc.qt.io/qt-5/qtglobal.html#qreal-typedef -->
<define name="qreal" value="double"/> <define name="qreal" value="double"/>
<podtype name="qint8" sign="s" size="1"/> <podtype name="qint8" sign="s" size="1"/>

File diff suppressed because it is too large Load Diff

View File

@ -1203,12 +1203,6 @@
<dealloc>ExFreePool</dealloc> <dealloc>ExFreePool</dealloc>
<dealloc>ExFreePoolWithTag</dealloc> <dealloc>ExFreePoolWithTag</dealloc>
</memory> </memory>
<memory>
<alloc init="false" arg="1">_dupenv_s</alloc>
<alloc init="false" arg="1">_wdupenv_s</alloc>
<alloc init="false" arg="1">_tdupenv_s</alloc>
<dealloc>free</dealloc>
</memory>
<memory> <memory>
<alloc buffer-size="malloc:3">HeapAlloc</alloc> <alloc buffer-size="malloc:3">HeapAlloc</alloc>
<alloc>HeapReAlloc</alloc> <alloc>HeapReAlloc</alloc>
@ -1355,23 +1349,6 @@
<not-bool/> <not-bool/>
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function>
<!-- errno_t _access_s(const char *path, int mode); -->
<!-- errno_t _waccess_s(const wchar_t *path, int mode); -->
<function name="_access_s,_waccess_s,_taccess_s">
<use-retval/>
<returnValue type="errno_t"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
<strz/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function> </function>
<!--VOID RtlCopyBytes( <!--VOID RtlCopyBytes(
_Out_ PVOID Destination, _Out_ PVOID Destination,
@ -1507,7 +1484,6 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int fprintf_s(FILE *stream, const char *format [, argument ]...); --> <!-- int fprintf_s(FILE *stream, const char *format [, argument ]...); -->
@ -1520,7 +1496,6 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int fwprintf_s(FILE *stream, const wchar_t *format [, argument ]...); --> <!-- int fwprintf_s(FILE *stream, const wchar_t *format [, argument ]...); -->
@ -1533,7 +1508,6 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int _snprintf_s(char *buffer, size_t sizeOfBuffer, size_t count, const char *format [, argument] ...); --> <!-- int _snprintf_s(char *buffer, size_t sizeOfBuffer, size_t count, const char *format [, argument] ...); -->
@ -1634,24 +1608,6 @@
</arg> </arg>
<arg nr="4"/> <arg nr="4"/>
</function> </function>
<!-- errno_t _dupenv_s(char **buffer, size_t *numberOfElements, const char *varname);
errno_t _wdupenv_s(wchar_t **buffer, size_t *numberOfElements, const wchar_t *varname); -->
<function name="_dupenv_s,_wdupenv_s,_tdupenv_s">
<noreturn>false</noreturn>
<returnValue type="errno_t"/>
<arg nr="1" direction="out">
<not-null/>
<minsize type="argvalue" arg="2"/>
</arg>
<arg nr="2" direction="out">
<not-null/>
</arg>
<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); --> <!-- ULONG vDbgPrintExWithPrefix(PCCH Prefix, ULONG ComponentId, ULONG Level, PCCH Format, va_list arglist); -->
<function name="vDbgPrintExWithPrefix"> <function name="vDbgPrintExWithPrefix">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -1676,7 +1632,6 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int wscanf_s(const wchar_t *format [, argument]...); --> <!-- int wscanf_s(const wchar_t *format [, argument]...); -->
@ -1688,7 +1643,6 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int sscanf_s(const char *buffer, const char *format [, argument ] ...); --> <!-- int sscanf_s(const char *buffer, const char *format [, argument ] ...); -->
@ -1703,7 +1657,6 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int fscanf_s(FILE *stream, const char *format [, argument ]...); --> <!-- int fscanf_s(FILE *stream, const char *format [, argument ]...); -->
@ -1715,7 +1668,6 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int fwscanf_s(FILE *stream, const wchar_t *format [, argument ]...); --> <!-- int fwscanf_s(FILE *stream, const wchar_t *format [, argument ]...); -->
@ -1727,7 +1679,6 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int swscanf_s(const wchar_t *buffer, const wchar_t *format [, argument ] ...); --> <!-- int swscanf_s(const wchar_t *buffer, const wchar_t *format [, argument ] ...); -->
@ -1742,14 +1693,13 @@
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- BOOL WINAPI CloseHandle(_In_ HANDLE hObject); --> <!-- BOOL WINAPI CloseHandle(_In_ HANDLE hObject); -->
<function name="CloseHandle"> <function name="CloseHandle">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </function>
@ -1782,38 +1732,6 @@
<returnValue type="LPWSTR"/> <returnValue type="LPWSTR"/>
<use-retval/> <use-retval/>
</function> </function>
<!-- LPWSTR lstrcpyW( LPWSTR lpString1, LPCWSTR lpString2); -->
<function name="lstrcpyW">
<returnValue type="LPWSTR">arg1</returnValue>
<noreturn>false</noreturn>
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" strlen-arg="2"/>
<leak-ignore/>
<arg nr="1" direction="out">
<not-null/>
<minsize type="strlen" arg="2"/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
</function>
<!-- LPSTR lstrcpyA(LPSTR lpString1, LPCSTR lpString2); -->
<function name="lstrcpyA">
<returnValue type="LPSTR">arg1</returnValue>
<noreturn>false</noreturn>
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" strlen-arg="2"/>
<leak-ignore/>
<arg nr="1" direction="out">
<not-null/>
<minsize type="strlen" arg="2"/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<strz/>
</arg>
</function>
<!-- LPWSTR lstrcpynW(LPWSTR destination, LPCWSTR source, int iMaxLength);--> <!-- LPWSTR lstrcpynW(LPWSTR destination, LPCWSTR source, int iMaxLength);-->
<function name="lstrcpynW"> <function name="lstrcpynW">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -2122,7 +2040,6 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="inout"> <arg nr="3" direction="inout">
<not-null/> <not-null/>
@ -2145,7 +2062,6 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="inout"> <arg nr="3" direction="inout">
<not-null/> <not-null/>
@ -2176,7 +2092,7 @@
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="HRESULT"/> <returnValue type="HRESULT"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
@ -2236,12 +2152,10 @@
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-uninit/> <not-uninit/>
@ -2260,12 +2174,10 @@
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
<strz/>
</arg> </arg>
</function> </function>
<!-- DWORD WINAPI GetFileAttributes(_In_ LPCTSTR lpFileName);--> <!-- DWORD WINAPI GetFileAttributes(_In_ LPCTSTR lpFileName);-->
@ -2346,7 +2258,6 @@
<formatstr/> <formatstr/>
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="4" direction="in"> <arg nr="4" direction="in">
<not-uninit/> <not-uninit/>
@ -2451,7 +2362,6 @@ HFONT CreateFont(
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="4"/> <arg nr="4"/>
</function> </function>
@ -2473,7 +2383,6 @@ HFONT CreateFont(
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="4" direction="in"> <arg nr="4" direction="in">
<not-uninit/> <not-uninit/>
@ -2502,7 +2411,6 @@ HFONT CreateFont(
<arg nr="4" direction="in"> <arg nr="4" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="5"/> <arg nr="5"/>
</function> </function>
@ -2610,7 +2518,7 @@ HFONT CreateFont(
<use-retval/> <use-retval/>
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="int">strcmp(arg1,arg2)</returnValue> <returnValue type="int"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
@ -2623,25 +2531,6 @@ HFONT CreateFont(
<strz/> <strz/>
</arg> </arg>
</function> </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 _snprintf(char *s, size_t n, const char *format, ...);
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format, ...);--> int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format, ...);-->
<function name="_snprintf,_snwprintf,_sntprintf"> <function name="_snprintf,_snwprintf,_sntprintf">
@ -2758,8 +2647,6 @@ HFONT CreateFont(
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-uninit/> <not-uninit/>
<not-bool/>
<valid>0:2</valid>
</arg> </arg>
</function> </function>
<!-- __int64 _ftelli64(FILE *stream); <!-- __int64 _ftelli64(FILE *stream);
@ -2960,7 +2847,7 @@ HFONT CreateFont(
<arg nr="1" direction="out"> <arg nr="1" direction="out">
<not-null/> <not-null/>
</arg> </arg>
<arg nr="2"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
@ -2985,7 +2872,7 @@ HFONT CreateFont(
<arg nr="1" direction="out"> <arg nr="1" direction="out">
<not-null/> <not-null/>
</arg> </arg>
<arg nr="2"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
@ -3023,7 +2910,7 @@ HFONT CreateFont(
_In_ LPARAM lParam); --> _In_ LPARAM lParam); -->
<function name="SendMessage,SendMessageA,SendMessageW"> <function name="SendMessage,SendMessageA,SendMessageW">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<arg nr="1"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
</arg> </arg>
@ -3044,7 +2931,7 @@ HFONT CreateFont(
_In_ LPARAM lParam); --> _In_ LPARAM lParam); -->
<function name="PostMessage,PostMessageA,PostMessageW"> <function name="PostMessage,PostMessageA,PostMessageW">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
@ -3306,7 +3193,7 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="LPVOID"/> <returnValue type="LPVOID"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-null/> <not-null/>
</arg> </arg>
</function> </function>
@ -3315,10 +3202,10 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="HGLOBAL"/> <returnValue type="HGLOBAL"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </function>
@ -3327,7 +3214,7 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
</arg> </arg>
@ -3339,55 +3226,14 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
</function>
<!-- int _stricmp(const char *str1, const char *str2); -->
<!-- int _wcsicmp(const wchar_t *str1, const wchar_t *str2) -->
<!-- int _mbsicmp(const unsigned char *str1, const unsigned char *str2) -->
<function name="_stricmp,_wcsicmp,_mbsicmp,_tcsicmp">
<use-retval/>
<pure/>
<returnValue type="int"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int _stricmp_l(const char *str1, const char *str2, _locale_t locale); -->
<!-- int _wcsicmp_l(const wchar_t *str1, const wchar_t *str2, _locale_t locale) -->
<!-- int _mbsicmp_l(const unsigned char *str1, const unsigned char *str2, _locale_t locale) -->
<function name="_stricmp_l,_wcsicmp_l,_mbsicmp_l,_tcsicmp_l">
<use-retval/>
<pure/>
<returnValue type="int"/>
<noreturn>false</noreturn>
<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>
<!-- HWND WINAPI CreateWindow( <!-- HWND WINAPI CreateWindow(
_In_opt_ LPCTSTR lpClassName, _In_opt_ LPCTSTR lpClassName,
_In_opt_ LPCTSTR lpWindowName, _In_opt_ LPCTSTR lpWindowName,
@ -3432,7 +3278,7 @@ HFONT CreateFont(
<arg nr="9" direction="in"> <arg nr="9" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="10"> <arg nr="10" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="11" direction="in"> <arg nr="11" direction="in">
@ -3487,7 +3333,7 @@ HFONT CreateFont(
<arg nr="10" direction="in"> <arg nr="10" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="11"> <arg nr="11" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="12" direction="in"> <arg nr="12" direction="in">
@ -3501,7 +3347,7 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
</arg> </arg>
@ -3699,7 +3545,7 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="DWORD"/> <returnValue type="DWORD"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
@ -3746,7 +3592,7 @@ HFONT CreateFont(
<use-retval/> <use-retval/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="HRSRC"/> <returnValue type="HRSRC"/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
@ -3901,7 +3747,7 @@ HFONT CreateFont(
<not-uninit/> <not-uninit/>
<not-null/> <not-null/>
</arg> </arg>
<arg nr="4"> <arg nr="4" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="5" direction="in"> <arg nr="5" direction="in">
@ -4568,18 +4414,6 @@ HFONT CreateFont(
<not-bool/> <not-bool/>
</arg> </arg>
</function> </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 _localtime32_s( struct tm* _tm, const __time32_t *time);
errno_t _localtime64_s( struct tm* _tm, const __time64_t *time); --> errno_t _localtime64_s( struct tm* _tm, const __time64_t *time); -->
<function name="_localtime32_s,_localtime64_s"> <function name="_localtime32_s,_localtime64_s">
@ -4726,7 +4560,7 @@ HFONT CreateFont(
<returnValue type="HMODULE"/> <returnValue type="HMODULE"/>
<use-retval/> <use-retval/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<strz/> <strz/>
</arg> </arg>
@ -4772,7 +4606,7 @@ HFONT CreateFont(
<function name="FreeLibrary"> <function name="FreeLibrary">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
</arg> </arg>
@ -4791,7 +4625,7 @@ HFONT CreateFont(
</function> </function>
<!--BOOL WINAPI FlushConsoleInputBuffer(_In_ HANDLE hConsoleInput);--> <!--BOOL WINAPI FlushConsoleInputBuffer(_In_ HANDLE hConsoleInput);-->
<function name="FlushConsoleInputBuffer"> <function name="FlushConsoleInputBuffer">
<noreturn>false</noreturn> <noreturn>true</noreturn>
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
@ -4800,33 +4634,13 @@ HFONT CreateFont(
<not-bool/> <not-bool/>
</arg> </arg>
</function> </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( <!--VOID WINAPI FreeLibraryAndExitThread(
_In_ HMODULE hModule, _In_ HMODULE hModule,
_In_ DWORD dwExitCode);--> _In_ DWORD dwExitCode);-->
<function name="FreeLibraryAndExitThread"> <function name="FreeLibraryAndExitThread">
<noreturn>true</noreturn> <noreturn>true</noreturn>
<returnValue type="VOID"/> <returnValue type="VOID"/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
</arg> </arg>
@ -4841,11 +4655,11 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<returnValue type="DWORD"/> <returnValue type="DWORD"/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
</arg> </arg>
<arg nr="2" direction="out"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
<strz/> <strz/>
<minsize type="argvalue" arg="3"/> <minsize type="argvalue" arg="3"/>
@ -4904,7 +4718,7 @@ HFONT CreateFont(
<returnValue type="FARPROC"/> <returnValue type="FARPROC"/>
<use-retval/> <use-retval/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
<not-null/> <not-null/>
@ -4991,7 +4805,7 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
</arg> </arg>
@ -5384,12 +5198,13 @@ HFONT CreateFont(
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
</arg> </arg>
</function> </function>
<!--void *_malloca(size_t size);--> <!--void *_malloca(
size_t size);-->
<function name="_malloca"> <function name="_malloca">
<returnValue type="void *"/> <returnValue type="void *"/>
<use-retval/> <use-retval/>
@ -5399,7 +5214,8 @@ HFONT CreateFont(
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </function>
<!--void *_alloca(size_t size);--> <!--void *_alloca(
size_t size);-->
<function name="_alloca"> <function name="_alloca">
<returnValue type="void *"/> <returnValue type="void *"/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -5408,9 +5224,9 @@ HFONT CreateFont(
<not-uninit/> <not-uninit/>
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
<warn severity="style" alternatives="_malloca">This function is deprecated because a more secure version is available '_malloca'.</warn>
</function> </function>
<!--void _freea(void *memblock);--> <!--void _freea(
void *memblock);-->
<function name="_freea"> <function name="_freea">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="void"/> <returnValue type="void"/>
@ -5666,7 +5482,7 @@ HFONT CreateFont(
<returnValue type="int"/> <returnValue type="int"/>
<leak-ignore/> <leak-ignore/>
<!-- The function does nothing (useful) if arg1 is nullptr or arg2 is nullptr or arg3 is 0 --> <!-- 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/> <not-null/>
</arg> </arg>
<arg nr="2" direction="out"> <arg nr="2" direction="out">
@ -6344,7 +6160,7 @@ HFONT CreateFont(
<function name="LocalFree"> <function name="LocalFree">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="HLOCAL"/> <returnValue type="HLOCAL"/>
<arg nr="1"> <arg nr="1" direction="in">
<not-bool/> <not-bool/>
</arg> </arg>
</function> </function>
@ -6811,7 +6627,7 @@ HFONT CreateFont(
<returnValue type="HWND"/> <returnValue type="HWND"/>
<use-retval/> <use-retval/>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
@ -6821,7 +6637,7 @@ HFONT CreateFont(
</function> </function>
<!-- int _atoi_l(const char *str, _locale_t locale); --> <!-- int _atoi_l(const char *str, _locale_t locale); -->
<!-- int _wtoi_l(const wchar_t *str, _locale_t locale); --> <!-- int _wtoi_l(const wchar_t *str, _locale_t locale); -->
<function name="_atoi_l,_wtoi_l"> <function name="_atol_l,_wtol_l">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="int"/> <returnValue type="int"/>
<use-retval/> <use-retval/>
@ -7024,8 +6840,6 @@ HFONT CreateFont(
<define name="STDMETHODCALLTYPE" value="__stdcall"/> <define name="STDMETHODCALLTYPE" value="__stdcall"/>
<define name="STDMETHODIMP" value="HRESULT STDMETHODCALLTYPE"/> <define name="STDMETHODIMP" value="HRESULT STDMETHODCALLTYPE"/>
<define name="STDMETHODIMP_(type)" value="type 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. --> <!-- 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="__pragma(x)" value=""/>
<define name="_countof(_Array)" value="(sizeof(_Array) / sizeof(_Array[0]))"/> <define name="_countof(_Array)" value="(sizeof(_Array) / sizeof(_Array[0]))"/>
@ -17954,21 +17768,4 @@ HFONT CreateFont(
<define name="TYPE_E_CANTLOADLIBRARY" value="0x80029C4A"/> <define name="TYPE_E_CANTLOADLIBRARY" value="0x80029C4A"/>
<define name="TYPE_E_INCONSISTENTPROPFUNCS" value="0x80029C83"/> <define name="TYPE_E_INCONSISTENTPROPFUNCS" value="0x80029C83"/>
<define name="TYPE_E_CIRCULARTYPE" value="0x80029C84"/> <define name="TYPE_E_CIRCULARTYPE" value="0x80029C84"/>
<!-- winnt.h -->
<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> </def>

View File

@ -276,7 +276,6 @@
<define name="EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id,func)" value=""/> <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_LEFT_CLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_LABEL_RIGHT_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_RIGHT_DCLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_CHANGE(id,func)" value=""/> <define name="EVT_GRID_CMD_CELL_CHANGE(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_CHANGED(id,func)" value=""/> <define name="EVT_GRID_CMD_CELL_CHANGED(id,func)" value=""/>
@ -4134,7 +4133,7 @@
<define name="wxDL_MODULE" value="1"/> <define name="wxDL_MODULE" value="1"/>
<define name="wxDL_PLUGIN_GUI" value="0"/> <define name="wxDL_PLUGIN_GUI" value="0"/>
<define name="wxDL_PLUGIN_BASE" value="1"/> <define name="wxDL_PLUGIN_BASE" value="1"/>
<define name="wxDL_INIT_FUNC(pfx, name, dynlib)" value="pfx ## name = static_cast &gt; name ## _t &lt;((dynlib).RawGetSymbol(#name))"/> <define name="wxDL_INIT_FUNC(pfx, name, dynlib)" value="pfx ## name = (name ## _t)(dynlib).RawGetSymbol(#name)"/>
<define name="wxKEY_NONE" value="0"/> <define name="wxKEY_NONE" value="0"/>
<define name="wxKEY_INTEGER" value="1"/> <define name="wxKEY_INTEGER" value="1"/>
<define name="wxKEY_STRING" value="2"/> <define name="wxKEY_STRING" value="2"/>
@ -5256,10 +5255,10 @@
<function name="clear" action="clear"/> <function name="clear" action="clear"/>
<function name="Clear" action="clear"/> <function name="Clear" action="clear"/>
<function name="Empty" action="clear"/> <function name="Empty" action="clear"/>
<function name="size" yields="size" returnType="std::size_t"/> <function name="size" yields="size"/>
<function name="length" yields="size" returnType="std::size_t"/> <function name="length" yields="size"/>
<function name="Length" yields="size" returnType="std::size_t"/> <function name="Length" yields="size"/>
<function name="Len" yields="size" returnType="std::size_t"/> <function name="Len" yields="size"/>
<function name="empty" yields="empty"/> <function name="empty" yields="empty"/>
<function name="IsEmpty" yields="empty"/> <function name="IsEmpty" yields="empty"/>
<function name="IsNull" yields="empty"/> <function name="IsNull" yields="empty"/>
@ -5324,7 +5323,7 @@
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"/> <arg nr="1" direction="in"/>
<arg nr="2" direction="in"/> <arg nr="2" direction="in"/>
<arg nr="3" direction="in" default="true"> <arg nr="3" direction="in" default="bool">
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </function>
@ -5482,6 +5481,16 @@
<use-retval/> <use-retval/>
<warn severity="style">This is a wxWidgets 1.xx compatibility function; you should not use it in new code.</warn> <warn severity="style">This is a wxWidgets 1.xx compatibility function; you should not use it in new code.</warn>
</function> </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 --> <!-- wxUniChar wxString::Last () const -->
<!-- wxUniCharRef wxString::Last () const --> <!-- wxUniCharRef wxString::Last () const -->
<function name="wxString::Last"> <function name="wxString::Last">
@ -6539,7 +6548,9 @@
<function name="wxControl::SetLabel,wxButton::SetLabel,wxRadioBox::SetLabel,wxStaticBox::SetLabel"> <function name="wxControl::SetLabel,wxButton::SetLabel,wxRadioBox::SetLabel,wxStaticBox::SetLabel">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"/> <arg nr="1" direction="in">
<not-uninit/>
</arg>
</function> </function>
<!-- http://docs.wxwidgets.org/trunk/classwx_colour.html --> <!-- http://docs.wxwidgets.org/trunk/classwx_colour.html -->
<!-- virtual unsigned char Alpha () const --> <!-- virtual unsigned char Alpha () const -->
@ -6820,7 +6831,7 @@
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<returnValue type="wxSizerItem*"/> <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-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/> <not-uninit/>
</arg> </arg>
@ -7071,245 +7082,17 @@
<function name="wxApp::MacOpenFile"> <function name="wxApp::MacOpenFile">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<warn severity="style">This function is deprecated and kept mostly for backwards compatibility. Please override 'wxApp::MacOpenFiles' method instead in any new code.</warn> <warn severity="style">This function is deprecated and kept mostly for backwards compatibility. Please override 'wxApp::MacOpenFiles' method instead in any new code.</warn>
</function> </function>
<!-- wxArchitecture wxPlatformInfo::GetArchitecture ( ) const --> <!-- http://docs.wxwidgets.org/trunk/classwx_art_provider.html#ae6090f32579d782205dd247006e4c7de -->
<function name="wxPlatformInfo::GetArchitecture">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<returnValue type="wxArchitecture"/>
<warn severity="style">This function is deprecated, use 'wxPlatformInfo::GetBitness()' instead.</warn>
</function>
<!-- virtual size_t wxMBConv::MB2WC ( wchar_t * out, const char * in, size_t outLen) const -->
<function name="wwxMBConv::MB2WC">
<noreturn>false</noreturn>
<const/>
<leak-ignore/>
<returnValue type="size_t"/>
<arg nr="1" direction="out"/>
<arg nr="2" direction="in"/>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated, please use 'ToWChar()' instead.</warn>
</function>
<!-- virtual size_t wxMBConv::WC2MB( char * buf, const wchar_t * psz, size_t n ) const -->
<function name="wwxMBConv::WC2MB">
<noreturn>false</noreturn>
<const/>
<leak-ignore/>
<returnValue type="size_t"/>
<arg nr="1" direction="out"/>
<arg nr="2" direction="in"/>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated, please use 'FromWChar()' instead.</warn>
</function>
<!-- void wxMenuBar::SetLabelTop(int id, const wxString &label) -->
<function name="wxMenuBar::SetLabelTop">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in"/>
<warn severity="style">This function has been deprecated in favour of 'wxMenuBar::SetMenuLabel()'.</warn>
</function>
<!-- virtual wxString wxLogFormatter::FormatTime(time_t time ) const -->
<function name="wxLogFormatter::FormatTime">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<returnValue type="wxString"/>
<warn severity="style">This function only exists for compatibility, please override FormatTimeMS() in the new code.</warn>
</function>
<!-- wxString wxMenuBar::GetLabelTop (size_t pos) const -->
<function name="wxMenuBar::GetLabelTop">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<returnValue type="wxString"/>
<warn severity="style">This function is deprecated. Please use 'wxMenuItem::GetMenuLabel()' or 'wxMenuItem::GetMenuLabelText()' instead.</warn>
</function>
<!-- virtual wxString wxMenuItem::GetName (void) const -->
<function name="wxMenuItem::GetName">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<returnValue type="wxString"/>
<warn severity="style">This function is deprecated. Please use 'wxMenuItem::GetItemLabel()' or 'wxMenuItem::GetItemLabelText()' instead.</warn>
</function>
<!-- const wxString& wxMenuItem::GetText (void) const -->
<function name="wxMenuItem::GetText">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<returnValue type="wxString&amp;"/>
<warn severity="style">This function is deprecated in favour of 'wxMenuItem::GetItemLabel()'.</warn>
</function>
<!-- static wxArchitecture wxPlatformInfo::GetArch (const wxString &arch ) -->
<function name="wxPlatformInfo::GetArch">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<pure/>
<arg nr="1" direction="in"/>
<returnValue type="wxArchitecture"/>
<warn severity="style">This function is deprecated, use 'wxPlatformInfo::GetBitness()' instead.</warn>
</function>
<!-- void wxPGProperty::AddChild ( wxPGProperty * prop) -->
<function name="wxPGProperty::AddChild">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
</arg>
<returnValue type="void"/>
<warn severity="style">This function is deprecated, use 'wxPGProperty::AddPrivateChild()' instead.</warn>
</function>
<!-- wxWindowID wxNewId() -->
<function name="wxNewId">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="wxWindowID"/>
<warn severity="style">This function is deprecated. Ids generated by it can conflict with the Ids defined by the user code, use wxID_ANY to assign ids which are guaranteed to not conflict with the user-defined ids for the controls and menu items you create instead of using this function.</warn>
</function>
<!-- wxString wxPGProperty::GetValueString ( int argFlags = 0 ) const -->
<function name="wxPGProperty::GetValueString">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<arg nr="1" direction="in" default="0">
<not-uninit/>
</arg>
<returnValue type="wxString"/>
<warn severity="style">This function is deprecated, use 'wxPGProperty::GetValueAsString()' instead.</warn>
</function>
<!-- wxString wxPlatformInfo::GetArchName ( ) const -->
<!-- Not possible to configure both functions:
static wxString wxPlatformInfo::GetArchName ( wxArchitecture arch) -->
<function name="wxPlatformInfo::GetArchName">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<returnValue type="wxString"/>
<warn severity="style">This function is deprecated, use 'wxPlatformInfo::GetBitnessName()' instead.</warn>
</function>
<!-- void wxPlatformInfo::SetArchitecture(wxArchitecture n) -->
<function name="wxPlatformInfo::SetArchitecture">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in"/>
<warn severity="style">This function is deprecated, use 'wxPlatformInfo::SetBitness()' instead.</warn>
</function>
<!-- virtual void wxMenuItem::SetText( const wxString & text ) -->
<function name="wxMenuItem::SetText">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in"/>
<warn severity="style">This function is deprecated in favour of 'wxMenuItem::SetItemLabel()'.</warn>
</function>
<!-- void wxSplitPath(const wxString & fullname, wxString * path, wxString * name, wxString * ext) -->
<function name="wxSplitPath">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in"/>
<arg nr="2" direction="out"/>
<arg nr="3" direction="out"/>
<arg nr="4" direction="out"/>
<warn severity="style">This function is deprecated, please use 'wxFileName::SplitPath()' instead.</warn>
</function>
<!-- virtual void wxToolBar::OnRightClick(int toolId, long x, long y) -->
<function name="wxToolBar::OnRightClick">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated. This is the old way of detecting tool right clicks, although it will still work, you should use the EVT_TOOL_RCLICKED() macro instead.</warn>
</function>
<!-- void wxPrintDialogData::SetSetupDialog(bool flag) -->
<function name="wxPrintDialogData::SetSetupDialog">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<warn severity="style">The setup dialog is deprecated, though retained for backward compatibility.</warn>
</function>
<!-- void wxPostDelete(wxObject * obj) -->
<function name="wxPostDelete">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
<warn severity="style">This function has been deprecated, use 'wxWindow::Close()' instead.</warn>
</function>
<!-- virtual bool wxPrinter::Setup(wxWindow * parent) -->
<function name="wxPrinter::Setup">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
<arg nr="1" direction="in">
<not-null/>
</arg>
<warn severity="style">The setup dialog is deprecated, though retained for backward compatibility.</warn>
</function>
<!-- wxThreadError wxThreadHelper::Create (unsigned int stackSize = 0) -->
<function name="wxThreadHelper::Create">
<noreturn>false</noreturn>
<use-retval/>
<leak-ignore/>
<returnValue type="wxThreadError"/>
<arg nr="1" direction="in" default="0">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated use 'CreateThread()' instead.</warn>
</function>
<!-- bool wxShowEvent::GetShow( ) const -->
<function name="wxShowEvent::GetShow">
<noreturn>false</noreturn>
<use-retval/>
<leak-ignore/>
<returnValue type="bool"/>
<warn severity="style">This function is deprecated in favour of 'IsShown()'.</warn>
</function>
<!-- static void wxArtProvider::Insert(wxArtProvider * provider)--> <!-- static void wxArtProvider::Insert(wxArtProvider * provider)-->
<function name="wxArtProvider::Insert"> <function name="wxArtProvider::Insert">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<returnValue type="void"/> <arg nr="1" direction="in">
<arg nr="1">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
</arg> </arg>
@ -7320,123 +7103,11 @@
<function name="wxCalendarCtrl::EnableYearChange"> <function name="wxCalendarCtrl::EnableYearChange">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in" default="true"> <arg nr="1" direction="in" default="true">
<not-uninit/> <not-uninit/>
</arg> </arg>
<warn severity="style">This function should be used instead of changing 'wxCAL_NO_YEAR_CHANGE' style bit directly. It allows or disallows the user to change the year interactively. Only in generic 'wxCalendarCtrl'.</warn> <warn severity="style">This function should be used instead of changing 'wxCAL_NO_YEAR_CHANGE' style bit directly. It allows or disallows the user to change the year interactively. Only in generic 'wxCalendarCtrl'.</warn>
</function> </function>
<!-- void wxUnix2DosFilename (wxChar * s )-->
<function name="wxUnix2DosFilename">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
<warn severity="style">This function is deprecated. Construct a wxFileName with wxPATH_UNIX and then use wxFileName::GetFullPath(wxPATH_DOS) instead.</warn>
</function>
<!-- void wxStyledTextCtrl::SetStyleBits(int bits )-->
<function name="wxStyledTextCtrl::SetStyleBits">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated.</warn>
</function>
<!-- wxUint32 wxSocketBase::LastCount() const -->
<function name="wxSocketBase::LastCount">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<returnValue type="wxUint32"/>
<warn severity="style">This function is kept mostly for backwards compatibility. Use 'LastReadCount()' or 'LastWriteCount()' instead. 'LastCount()' is still needed for use with less commonly used functions: 'Discard()', 'Peek()', and 'Unread()'.</warn>
</function>
<!-- int wxStyledTextCtrl::GetStyleBits()const -->
<!-- int wxStyledTextCtrl::GetStyleBitsNeeded()const -->
<function name="wxStyledTextCtrl::GetStyleBitsNeeded,wxStyledTextCtrl::GetStyleBits">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<const/>
<returnValue type="int"/>
<warn severity="style">This function is deprecated.</warn>
</function>
<!-- wxStreamBase* wxStreamBuffer::Stream() -->
<function name="wxStreamBuffer::Stream">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="wxStreamBase*"/>
<warn severity="style">This function is deprecated, use GetStream() instead</warn>
</function>
<!-- void wxUsleep (unsigned long milliseconds) -->
<function name="wxUsleep">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated because its name is misleading: notice that the argument is in milliseconds, not microseconds. Please use either 'wxMilliSleep()' or 'wxMicroSleep()' depending on the resolution you need.</warn>
</function>
<!-- static bool wxWebViewIE::MSWSetModernEmulationLevel(bool modernLevel = true) -->
<function name="wxWebViewIE::MSWSetModernEmulationLevel">
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<returnValue type="bool"/>
<arg nr="1" direction="in" default="true">
<not-uninit/>
</arg>
<warn severity="style">This function is kept mostly for backwards compatibility.</warn>
</function>
<!-- virtual void wxWindow::SetInitialBestSize(const wxSize & size)-->
<function name="wxWindow::SetInitialBestSize">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in"/>
<warn severity="style">This function is deprecated, use 'wxWindow::SetInitialSize' instead.</warn>
</function>
<!-- wxString wxTextInputStream::ReadString() -->
<function name="wxTextInputStream::ReadString">
<noreturn>false</noreturn>
<use-retval/>
<leak-ignore/>
<returnValue type="wxString"/>
<warn severity="style">This function is deprecated, use 'wxTextInputStream::ReadLine()' or 'wxTextInputStream::ReadWord()' instead.</warn>
</function>
<!-- wxString wxStyledTextEvent::GetDragText() -->
<!-- wxString wxStyledTextEvent::GetText() -->
<function name="wxTextInputStream::ReadString,wxStyledTextEvent::GetDragText">
<noreturn>false</noreturn>
<use-retval/>
<leak-ignore/>
<returnValue type="wxString"/>
<warn severity="style">Use 'wxStyledTextEvent::GetString()' instead.</warn>
</function>
<!-- void wxStyledTextEvent::SetText(const wxString & t) -->
<!-- void wxStyledTextEvent::SetDragText(const wxString & val) -->
<function name="wxStyledTextEvent::SetText,wxStyledTextEvent::SetDragText">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in"/>
<warn severity="style">This function is deprecated.</warn>
</function>
<!-- void wxWindow::SetPalette(const wxPalette & pal) -->
<function name="wxWindow::SetPalette">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in"/>
<warn severity="style">This function is deprecated, use 'wxDC::SetPalette' instead.</warn>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_combo_ctrl.html#ae38353a81954d02af302ba103e984cb73 --> <!-- http://docs.wxwidgets.org/trunk/classwx_combo_ctrl.html#ae38353a81954d02af302ba103e984cb73 -->
<!-- wxCoord wxComboCtrl::GetTextIndent( ) const--> <!-- wxCoord wxComboCtrl::GetTextIndent( ) const-->
<function name="wxComboCtrl::GetTextIndent"> <function name="wxComboCtrl::GetTextIndent">
@ -7618,26 +7289,6 @@
</arg> </arg>
<warn severity="style">This function is deprecated.</warn> <warn severity="style">This function is deprecated.</warn>
</function> </function>
<!-- void wxSizer::Remove(int index) -->
<!-- void wxSizer::Remove(wxWindow * window)-->
<!-- void wxSizer::Remove(wxWindow * window)-->
<function name="wxSizer::Remove">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
</function>
<!-- void wxSizer::SetVirtualSizeHints(wxWindow * window)-->
<function name="wxSizer::SetVirtualSizeHints">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="inout">
<not-uninit/>
<not-null/>
</arg>
<warn severity="style">This function is deprecated. This is exactly the same as 'FitInside()' in wxWidgets 2.9 and later, please replace calls to it with 'FitInside()'.</warn>
</function>
<!-- void wxSizerItem::SetSizer(wxSizer * sizer)--> <!-- void wxSizerItem::SetSizer(wxSizer * sizer)-->
<function name="wxSizerItem::SetSizer"> <function name="wxSizerItem::SetSizer">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -7846,7 +7497,7 @@
</arg> </arg>
</function> </function>
<!-- http://docs.wxwidgets.org/trunk/classwx_sizer_item.html#a83baa6835015e9ccd71ba290883db4f5--> <!-- http://docs.wxwidgets.org/trunk/classwx_sizer_item.html#a83baa6835015e9ccd71ba290883db4f5-->
<!-- void wxSizerItem::SetSpacer(const wxSize & size) --> <!-- void wxSizerItem::SetSpacer(const wxSize & size)-->
<function name="wxSizerItem::SetSpacer"> <function name="wxSizerItem::SetSpacer">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
@ -7855,57 +7506,6 @@
</arg> </arg>
<warn severity="style">This function is deprecated. This function does not free the old sizer which may result in memory leaks, use 'wxSizerItem::AssignSpacer' which does free it instead.</warn> <warn severity="style">This function is deprecated. This function does not free the old sizer which may result in memory leaks, use 'wxSizerItem::AssignSpacer' which does free it instead.</warn>
</function> </function>
<!-- virtual bool wxHelpControllerBase::DisplayBlock(long blockNo) -->
<function name="wxHelpControllerBase::DisplayBlock">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is for backward compatibility only, and applications should use 'wxHelpControllerBase::DisplaySection()' instead.</warn>
</function>
<!-- int wxHtmlTag::GetBeginPos( ) const -->
<!-- int wxHtmlTag::GetEndPos1( ) const -->
<!-- int wxHtmlTag::GetEndPos2( ) const -->
<function name="wxHtmlTag::GetBeginPos,wxHtmlTag::GetEndPos1,wxHtmlTag::GetEndPos2">
<noreturn>false</noreturn>
<leak-ignore/>
<const/>
<use-retval/>
<returnValue type="int"/>
<warn severity="style">This function is deprecated.</warn>
</function>
<!-- bool wxIconizeEvent::Iconized() const -->
<function name="wxIconizeEvent::Iconized">
<noreturn>false</noreturn>
<leak-ignore/>
<const/>
<use-retval/>
<returnValue type="bool"/>
<warn severity="style">This function is deprecated in favour of 'wxIconizeEvent::IsIconized()'.</warn>
</function>
<!-- int wxList< T >::Number() const -->
<function name="wxList::Number">
<noreturn>false</noreturn>
<leak-ignore/>
<const/>
<use-retval/>
<returnValue type="int"/>
<warn severity="style">This function is deprecated, use 'wxList::GetCount()' instead. Returns the number of elements in the list.</warn>
</function>
<!-- void wxIcon::SetWidth (int width ) -->
<!-- void wxIcon::SetHeight (int width ) -->
<!-- void wxIcon::SetDepth (int width ) -->
<function name="wxIcon::SetWidth,wxIcon::SetHeight,wxIcon::SetDepth">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated since version 3.1.2, dimensions and depth can only be set at construction time.</warn>
</function>
<!-- virtual void wxWindow::SetExtraStyle (long exStyle) --> <!-- virtual void wxWindow::SetExtraStyle (long exStyle) -->
<!-- virtual void wxPropertyGridManager::SetExtraStyle(long exStyle) --> <!-- virtual void wxPropertyGridManager::SetExtraStyle(long exStyle) -->
<function name="wxWindow::SetExtraStyle,wxPropertyGridManager::SetExtraStyle"> <function name="wxWindow::SetExtraStyle,wxPropertyGridManager::SetExtraStyle">
@ -7972,108 +7572,7 @@
<arg nr="3" direction="in" default="false"/> <arg nr="3" direction="in" default="false"/>
<arg nr="4" direction="in" default="wxNullBitmap"/> <arg nr="4" direction="in" default="wxNullBitmap"/>
</function> </function>
<!-- wxWindow* wxFindWindowByLabel(const wxString & name, wxWindow * parent = NULL) --> <!-- http://docs.wxwidgets.org/trunk/classwx_grid.html#a83774c9cbf840641cc6ffba25ce32059-->
<function name="wxFindWindowByLabel">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="wxWindow *"/>
<arg nr="1" direction="in"/>
<arg nr="2" direction="out" default="NULL"/>
<warn severity="style">This function is deprecated, please use 'wxWindow::FindWindowByLabel()' instead.</warn>
</function>
<!-- wxWindow* wxFindWindowByName(const wxString & name, wxWindow * parent = NULL) -->
<function name="wxFindWindowByName">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="wxWindow *"/>
<arg nr="1" direction="in"/>
<arg nr="2" direction="out" default="NULL"/>
<warn severity="style">This function is deprecated, please use 'wxWindow::FindWindowByName()' instead.</warn>
</function>
<!-- char* wxGetTempFileName(const wxString & prefix, char * buf = NULL) -->
<function name="wxGetTempFileName">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="char *"/>
<arg nr="1" direction="in"/>
<arg nr="2" direction="out" default="NULL"/>
<warn severity="style">This function is deprecated, please use 'wxFileName::CreateTempFileName()' instead.</warn>
</function>
<!-- bool wxGetUserId(char * buf, int sz) -->
<function name="wxGetUserId">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="bool"/>
<arg nr="1" direction="out">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated, use 'wxGetUserId()' with no arguments instead.</warn>
</function>
<!-- bool wxGetEmailAddress(char * buf, int sz) -->
<function name="wxGetEmailAddress">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="bool"/>
<arg nr="1" direction="out">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated, use 'wxGetEmailAddress()' with no arguments instead.</warn>
</function>
<!-- bool wxGetHostName(char * buf, int sz) -->
<function name="wxGetHostName">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="bool"/>
<arg nr="1" direction="out">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated, use 'wxGetHostName()' with no arguments instead.</warn>
</function>
<!-- bool wxGetUserName(char * buf, int sz) -->
<function name="wxGetUserName">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="bool"/>
<arg nr="1" direction="out">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<warn severity="style">This function is deprecated, use 'wxGetUserName()' with no arguments instead.</warn>
</function>
<!-- wxString wxGetWorkingDirectory(char * buf = NULL, int sz = 1000) -->
<function name="wxGetWorkingDirectory">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="wxString"/>
<arg nr="1" direction="in" default="NULL">
<not-uninit/>
<not-bool/>
</arg>
<arg nr="2" direction="in" default="1000">
<not-uninit/>
<not-bool/>
</arg>
<warn severity="style">This function is deprecated, use 'wxGetCwd()' instead.</warn>
</function>
<!-- void wxGrid::SetCellAlignment(int align, int row, int col) --> <!-- void wxGrid::SetCellAlignment(int align, int row, int col) -->
<function name="wxGrid::SetCellAlignment"> <function name="wxGrid::SetCellAlignment">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -9164,7 +8663,7 @@
<leak-ignore/> <leak-ignore/>
<const/> <const/>
<returnValue type="bool"/> <returnValue type="bool"/>
<arg nr="1" direction="out"> <arg nr="1" direction="in">
<not-null/> <not-null/>
</arg> </arg>
</function> </function>
@ -9375,7 +8874,7 @@
<!-- virtual void wxPGSpinCtrlEditor::OnFocus (wxPGProperty *property, wxWindow *wnd) const--> <!-- virtual void wxPGSpinCtrlEditor::OnFocus (wxPGProperty *property, wxWindow *wnd) const-->
<!-- virtual void wxPGTextCtrlEditor::OnFocus (wxPGProperty *property, wxWindow *wnd) const--> <!-- virtual void wxPGTextCtrlEditor::OnFocus (wxPGProperty *property, wxWindow *wnd) const-->
<!-- virtual void wxPGTextCtrlAndButtonEditor::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> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<const/> <const/>
@ -9427,26 +8926,6 @@
<not-bool/> <not-bool/>
</arg> </arg>
</function> </function>
<!-- void wxFocusEvent::SetWindow(wxWindow * win) -->
<function name="wxFocusEvent::SetWindow">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<!-- virtual void wxFileHistory::RemoveFileFromHistory(size_t i) -->
<function name="wxFileHistory::RemoveFileFromHistory">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<!-- void wxPGProperty::SetValue(wxVariant value, wxVariant * pList = NULL, int flags = wxPG_SETVAL_REFRESH_EDITOR) --> <!-- void wxPGProperty::SetValue(wxVariant value, wxVariant * pList = NULL, int flags = wxPG_SETVAL_REFRESH_EDITOR) -->
<function name="wxPGProperty::SetValue"> <function name="wxPGProperty::SetValue">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -9975,16 +9454,6 @@
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </function>
<!-- void wxMenuBar::SetLabel(int id, const wxString &label) -->
<function name="wxMenuBar::SetLabel">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in"/>
</function>
<!-- virtual void wxListBox::SetSelection(int n) --> <!-- virtual void wxListBox::SetSelection(int n) -->
<function name="wxListBox::SetSelection"> <function name="wxListBox::SetSelection">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -10668,21 +10137,6 @@
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </function>
<!-- virtual bool wxTextCtrl::EnableProofCheck ( const wxTextProofOptions & options = wxTextProofOptions::Default() ) -->
<function name="wxTextCtrl::EnableProofCheck">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
<arg nr="1" default="wxTextProofOptions::Default()" direction="in"/>
</function>
<!-- const wxColour& wxTextAttr::GetTextColour() const-->
<function name="wxTextAttr::GetTextColour">
<noreturn>false</noreturn>
<returnValue type="const wxColour &amp;"/>
<use-retval/>
<const/>
<leak-ignore/>
</function>
<!-- virtual void wxTextCtrl::SetMaxLength(unsigned long len)--> <!-- virtual void wxTextCtrl::SetMaxLength(unsigned long len)-->
<function name="wxTextEntry::SetMaxLength,wxTextCtrl::SetMaxLength"> <function name="wxTextEntry::SetMaxLength,wxTextCtrl::SetMaxLength">
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -10707,8 +10161,8 @@
<returnValue type="void"/> <returnValue type="void"/>
<leak-ignore/> <leak-ignore/>
</function> </function>
<!-- wxTextAttr::SetTextColour-->
<!-- void wxTextCtrl::SetEditable( bool edit) --> <!-- void wxTextCtrl::SetEditable( bool edit) -->
<!-- void wxTextEntry::SetEditable( bool edit) -->
<function name="wxTextEntry::SetEditable,wxTextCtrl::SetEditable"> <function name="wxTextEntry::SetEditable,wxTextCtrl::SetEditable">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="void"/> <returnValue type="void"/>
@ -13670,8 +13124,8 @@ wxItemKind kind = wxITEM_NORMAL) -->
<const/> <const/>
<use-retval/> <use-retval/>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="out"/> <arg nr="1" direction="in"/>
<arg nr="2" default="0" direction="out"> <arg nr="2" default="0" direction="in">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
</arg> </arg>
@ -14209,7 +13663,7 @@ wxItemKind kind = wxITEM_NORMAL) -->
<arg nr="2" direction="in" default="0"> <arg nr="2" direction="in" default="0">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="3" direction="in" default="wxString::npos"> <arg nr="3" direction="in" default="std::wxString::npos">
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </function>
@ -14877,10 +14331,10 @@ wxItemKind kind = wxITEM_NORMAL) -->
<returnValue type="void"/> <returnValue type="void"/>
<leak-ignore/> <leak-ignore/>
<const/> <const/>
<arg nr="1" direction="out"> <arg nr="1" direction="in">
<not-null/> <not-null/>
</arg> </arg>
<arg nr="2" direction="out"> <arg nr="2" direction="in">
<not-null/> <not-null/>
</arg> </arg>
</function> </function>
@ -14908,11 +14362,9 @@ wxItemKind kind = wxITEM_NORMAL) -->
<returnValue type="bool"/> <returnValue type="bool"/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<valid>0:</valid>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
<valid>1:</valid>
</arg> </arg>
<arg nr="3" direction="in"/> <arg nr="3" direction="in"/>
</function> </function>
@ -16154,58 +15606,6 @@ wxItemKind kind = wxITEM_NORMAL) -->
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </function>
<!-- virtual wxTextPos wxTextEntry::GetLastPosition ( ) const -->
<!-- virtual wxTextPos wxStyledTextCtrl::GetLastPosition ( ) const -->
<!-- virtual wxTextPos wxComboCtrl::GetLastPosition ( ) const -->
<function name="wxTextEntry::GetLastPosition,wxStyledTextCtrl::GetLastPosition,wxComboCtrl::GetLastPosition">
<noreturn>false</noreturn>
<returnValue type="wxTextPos"/>
<use-retval/>
<const/>
<leak-ignore/>
</function>
<!-- virtual wxString wxTextEntry::GetStringSelection ( ) const -->
<!-- virtual wxString wxTextEntry::GetValue ( ) const -->
<!-- virtual wxString wxTextCtrl::GetStringSelection ( ) const -->
<!-- virtual wxString wxTextCtrl::GetValue ( ) const -->
<function name="wxTextEntry::GetStringSelection,wxTextEntry::GetValue,wxTextCtrl::GetStringSelection,wxTextCtrl::GetValue">
<noreturn>false</noreturn>
<returnValue type="wxString"/>
<use-retval/>
<const/>
<leak-ignore/>
</function>
<!-- virtual wxString wxTextCtrl::GetRange( long from, long to ) const -->
<!-- virtual wxString wxTextEntry::GetRange( long from, long to ) const -->
<function name="wxTextEntry::GetRange,wxTextCtrl::GetRange">
<noreturn>false</noreturn>
<returnValue type="wxString"/>
<use-retval/>
<const/>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-bool/>
<valid>1:</valid>
</arg>
</function>
<!-- virtual bool wxTextCtrl::GetStyle (long position, wxTextAttr & style) -->
<function name="wxTextCtrl::GetStyle">
<noreturn>false</noreturn>
<returnValue type="bool"/>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="out"/>
</function>
<!-- void wxRichTextAttr:SetFlags(long flags); --> <!-- void wxRichTextAttr:SetFlags(long flags); -->
<function name="wxRichTextAttr::SetFlags"> <function name="wxRichTextAttr::SetFlags">
<noreturn>false</noreturn> <noreturn>false</noreturn>

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

@ -1,51 +1,28 @@
include_directories(${PROJECT_SOURCE_DIR}/lib/)
if(USE_BUNDLED_TINYXML2)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml2/)
endif()
include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/)
file(GLOB hdrs "*.h") file(GLOB hdrs "*.h")
file(GLOB srcs "*.cpp") file(GLOB srcs "*.cpp")
file(GLOB mainfile "main.cpp") file(GLOB mainfile "main.cpp")
list(REMOVE_ITEM srcs ${mainfile}) list(REMOVE_ITEM srcs ${mainfile})
add_library(cli_objs OBJECT ${hdrs} ${srcs}) add_library(cli_objs OBJECT ${hdrs} ${srcs})
target_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/lib/)
list(APPEND cppcheck_SOURCES ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:simplecpp_objs>)
if(USE_BUNDLED_TINYXML2) if(USE_BUNDLED_TINYXML2)
target_include_directories(cli_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/tinyxml2/) list(APPEND cppcheck_SOURCES $<TARGET_OBJECTS:tinyxml2_objs>)
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)
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)
endif() endif()
add_executable(cppcheck ${cppcheck_SOURCES}) 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) if (HAVE_RULES)
target_link_libraries(cppcheck ${PCRE_LIBRARY}) target_link_libraries(cppcheck ${PCRE_LIBRARY})
endif() endif()
if (USE_Z3)
target_link_libraries(cppcheck ${Z3_LIBRARIES})
endif()
if (WIN32 AND NOT BORLAND) if (WIN32 AND NOT BORLAND)
if(NOT MINGW) if(NOT MINGW)
target_link_libraries(cppcheck Shlwapi.lib) target_link_libraries(cppcheck Shlwapi.lib)
@ -54,19 +31,11 @@ if (WIN32 AND NOT BORLAND)
endif() endif()
endif() endif()
if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2) if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
target_link_libraries(cppcheck ${tinyxml2_LIBRARIES}) target_link_libraries(cppcheck tinyxml2)
endif()
target_link_libraries(cppcheck ${CMAKE_THREAD_LIBS_INIT})
if (BUILD_CORE_DLL)
target_link_libraries(cppcheck cppcheck-core)
endif() endif()
add_dependencies(cppcheck copy_cfg) add_dependencies(cppcheck copy_cfg)
add_dependencies(cppcheck copy_addons) add_dependencies(cppcheck copy_addons)
add_dependencies(cppcheck copy_platforms)
if (NOT DISABLE_DMAKE)
add_dependencies(cppcheck run-dmake)
endif()
install(TARGETS cppcheck install(TARGETS cppcheck
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}

View File

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

View File

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

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 * Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2023 Cppcheck team. * Copyright (C) 2007-2020 Cppcheck team.
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -19,19 +19,10 @@
#ifndef CMDLINE_PARSER_H #ifndef CMDLINE_PARSER_H
#define CMDLINE_PARSER_H #define CMDLINE_PARSER_H
#include <cstddef>
#include <list>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "cmdlinelogger.h"
#include "filesettings.h"
#include "utils.h"
class Settings; class Settings;
class Suppressions;
class Library;
/// @addtogroup CLI /// @addtogroup CLI
/// @{ /// @{
@ -49,31 +40,30 @@ class CmdLineParser {
public: public:
/** /**
* The constructor. * The constructor.
* @param logger The logger instance to log messages through
* @param settings Settings instance that will be modified according to * @param settings Settings instance that will be modified according to
* options user has given. * 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); explicit CmdLineParser(Settings *settings);
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[]);
/** /**
* Parse given command line. * Parse given command line.
* @return true if command line was ok, false if there was an error. * @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. * 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 { bool getShowHelp() const {
return mFiles; 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 { bool exitAfterPrinting() const {
return mFileSettings; return mExitAfterPrint;
} }
/** /**
@ -108,59 +98,22 @@ protected:
/** /**
* Print help text to the console. * Print help text to the console.
*/ */
void printHelp() const; static void printHelp();
/**
* Print message (to console?).
*/
static void printMessage(const std::string &message);
static void printMessage(const char* message);
private: 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::vector<std::string> mPathNames;
std::list<std::pair<std::string, std::size_t>> mFiles;
std::list<FileSettings> mFileSettings;
std::vector<std::string> mIgnoredPaths; std::vector<std::string> mIgnoredPaths;
Settings &mSettings; Settings *mSettings;
Suppressions &mSuppressions; bool mShowHelp;
Suppressions &mSuppressionsNoFail; bool mShowVersion;
bool mShowErrorMessages;
bool mExitAfterPrint;
std::string mVSConfig; std::string mVSConfig;
}; };

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