Compare commits
4 Commits
amigaos
...
revert-267
Author | SHA1 | Date |
---|---|---|
orbitcowboy | d80e8ba705 | |
Armin Müller | 20ade435c6 | |
orbitcowboy | b589a8fa16 | |
versat | d89e1e6904 |
|
@ -0,0 +1,20 @@
|
|||
##############################################################
|
||||
# Documentation is available from #
|
||||
# http://astyle.sourceforge.net/astyle.html #
|
||||
##############################################################
|
||||
|
||||
### Options ###
|
||||
--pad-header
|
||||
--unpad-paren
|
||||
--suffix=none
|
||||
--convert-tabs
|
||||
--attach-inlines
|
||||
--attach-classes
|
||||
--attach-namespaces
|
||||
|
||||
### Settings ###
|
||||
--style=kr
|
||||
--indent=spaces=4
|
||||
--indent-namespaces
|
||||
--lineend=linux
|
||||
--min-conditional-indent=0
|
77
.clang-tidy
77
.clang-tidy
|
@ -1,78 +1,5 @@
|
|||
---
|
||||
Checks: >
|
||||
*,
|
||||
-abseil-*,
|
||||
-altera-*,
|
||||
-android-*,
|
||||
-boost-*,
|
||||
-cert-*,
|
||||
-cppcoreguidelines-*,
|
||||
-darwin-*,
|
||||
-fuchsia-*,
|
||||
-google-*,
|
||||
-hicpp-*,
|
||||
-linuxkernel-*,
|
||||
-llvm-*,
|
||||
-llvmlibc-*,
|
||||
-mpi-*,
|
||||
-objc-*,
|
||||
-openmp-*,
|
||||
-zircon-*,
|
||||
cert-err34-c,
|
||||
google-explicit-constructor,
|
||||
cppcoreguidelines-rvalue-reference-param-not-moved,
|
||||
-bugprone-assignment-in-if-condition,
|
||||
-bugprone-branch-clone,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-bugprone-empty-catch,
|
||||
-bugprone-macro-parentheses,
|
||||
-bugprone-narrowing-conversions,
|
||||
-bugprone-signed-char-misuse,
|
||||
-bugprone-switch-missing-default-case,
|
||||
-bugprone-unchecked-optional-access,
|
||||
-clang-analyzer-*,
|
||||
-concurrency-mt-unsafe,
|
||||
-misc-const-correctness,
|
||||
-misc-no-recursion,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
-misc-throw-by-value-catch-by-reference,
|
||||
-misc-use-anonymous-namespace,
|
||||
-modernize-avoid-c-arrays,
|
||||
-modernize-deprecated-ios-base-aliases,
|
||||
-modernize-use-nullptr,
|
||||
-misc-include-cleaner,
|
||||
-misc-unused-using-decls,
|
||||
-modernize-loop-convert,
|
||||
-modernize-macro-to-enum,
|
||||
-modernize-raw-string-literal,
|
||||
-modernize-replace-auto-ptr,
|
||||
-modernize-return-braced-init-list,
|
||||
-modernize-type-traits,
|
||||
-modernize-use-auto,
|
||||
-modernize-use-nodiscard,
|
||||
-modernize-use-trailing-return-type,
|
||||
-performance-avoid-endl,
|
||||
-performance-inefficient-string-concatenation,
|
||||
-performance-no-automatic-move,
|
||||
-performance-noexcept-swap,
|
||||
-portability-simd-intrinsics,
|
||||
-portability-std-allocator-const,
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-readability-braces-around-statements,
|
||||
-readability-container-data-pointer,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-function-size,
|
||||
-readability-identifier-length,
|
||||
-readability-identifier-naming,
|
||||
-readability-implicit-bool-conversion,
|
||||
-readability-isolate-declaration,
|
||||
-readability-magic-numbers,
|
||||
-readability-suspicious-call-argument,
|
||||
-readability-uppercase-literal-suffix
|
||||
WarningsAsErrors: '*'
|
||||
HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h'
|
||||
Checks: '*,-abseil-*,-android-*,-cert-*,-cppcoreguidelines-*,-fuchsia-*,-google-*,-hicpp-*,-llvm-*,-linuxkernel-*,-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,-modernize-use-using,-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,-readability-static-accessed-through-instance,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-performance-for-range-copy,-misc-throw-by-value-catch-by-reference,-modernize-use-bool-literals,-readability-avoid-const-params-in-decls,-readability-redundant-control-flow,-bugprone-argument-comment,-readability-redundant-string-cstr,-readability-non-const-parameter,-misc-non-private-member-variables-in-classes,-performance-unnecessary-copy-initialization,-readability-redundant-string-init,-bugprone-suspicious-string-compare,-bugprone-use-after-move,-readability-misleading-indentation,-misc-unused-parameters-,-clang-analyzer-*,-bugprone-signed-char-misuse,-readability-make-member-function-const'
|
||||
CheckOptions:
|
||||
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
|
||||
value: '1'
|
||||
- key: readability-simplify-boolean-expr.SimplifyDeMorgan
|
||||
value: '0'
|
||||
value: '1'
|
|
@ -4,5 +4,7 @@ exclude_paths:
|
|||
- htmlreport/example.cc
|
||||
- samples/**/bad.c
|
||||
- samples/**/bad.cpp
|
||||
- test/test.cxx
|
||||
- test/cfg/*.c
|
||||
- test/cfg/*.cpp
|
||||
- test/synthetic/*.c
|
||||
|
|
|
@ -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
|
|
@ -1,58 +0,0 @@
|
|||
# Some convenient links:
|
||||
# - https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md
|
||||
#
|
||||
|
||||
name: CI-cygwin
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'releases/**'
|
||||
tags:
|
||||
- '2.*'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: cmd
|
||||
|
||||
jobs:
|
||||
build_cygwin:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-2022]
|
||||
arch: [x64]
|
||||
include:
|
||||
- platform: 'x86_64'
|
||||
packages: |
|
||||
gcc-g++
|
||||
python3
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Cygwin
|
||||
uses: cygwin/cygwin-install-action@master
|
||||
with:
|
||||
platform: ${{ matrix.arch }}
|
||||
packages: ${{ matrix.packages }}
|
||||
|
||||
# Cygwin will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries.
|
||||
- name: Build all and run test
|
||||
run: |
|
||||
C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j2 check
|
||||
|
||||
- name: Extra test for misra
|
||||
run: |
|
||||
cd %GITHUB_WORKSPACE%\addons\test
|
||||
..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64
|
||||
python3 ..\misra.py -verify misra\misra-test.c.dump
|
||||
..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c
|
||||
|
|
@ -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
|
|
@ -1,179 +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: CI-unixish-docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'releases/**'
|
||||
tags:
|
||||
- '2.*'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build_cmake:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
|
||||
include:
|
||||
- build_gui: false
|
||||
- image: "ubuntu:23.10"
|
||||
build_gui: true
|
||||
fail-fast: false # Prefer quick result
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
# TODO: is this actually applied to the guest?
|
||||
env:
|
||||
# TODO: figure out why there are cache misses with PCH enabled
|
||||
CCACHE_SLOPPINESS: pch_defines,time_macros
|
||||
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install missing software on CentOS 7
|
||||
if: matrix.image == 'centos:7'
|
||||
run: |
|
||||
yum install -y cmake gcc-c++ make pcre-devel
|
||||
yum --enablerepo=extras install -y epel-release
|
||||
yum install -y ccache
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
if: contains(matrix.image, 'ubuntu')
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y cmake g++ make libxml2-utils libpcre3-dev
|
||||
|
||||
- name: Install missing software (gui) on latest ubuntu
|
||||
if: matrix.build_gui
|
||||
run: |
|
||||
apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev
|
||||
|
||||
# needs to be called after the package installation since
|
||||
# - it doesn't call "apt-get update"
|
||||
# - it doesn't support centos
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ matrix.image }}
|
||||
|
||||
# tests require CMake 3.9 - no ccache available
|
||||
- name: CMake build (no tests / no ccache)
|
||||
if: matrix.image == 'ubuntu:14.04'
|
||||
run: |
|
||||
mkdir cmake.output
|
||||
cd cmake.output
|
||||
cmake -G "Unix Makefiles" -DHAVE_RULES=On ..
|
||||
cmake --build . -- -j$(nproc)
|
||||
|
||||
# tests require CMake 3.9 - ccache available
|
||||
- name: CMake build (no tests)
|
||||
if: matrix.image == 'centos:7' || matrix.image == 'ubuntu:16.04'
|
||||
run: |
|
||||
mkdir cmake.output
|
||||
cd cmake.output
|
||||
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
|
||||
cmake --build . -- -j$(nproc)
|
||||
|
||||
- name: CMake build
|
||||
if: ${{ !matrix.build_gui && matrix.image != '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
|
||||
run: |
|
||||
# "/usr/lib64" for centos / "/usr/lib" for ubuntu
|
||||
export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w"
|
||||
|
||||
- name: Build test
|
||||
run: |
|
||||
# "/usr/lib64" for centos / "/usr/lib" for ubuntu
|
||||
export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w"
|
||||
|
||||
- name: Run test
|
||||
run: |
|
||||
make -j$(nproc) check HAVE_RULES=yes
|
||||
|
||||
# requires python3
|
||||
- name: Run extra tests
|
||||
run: |
|
||||
tools/generate_and_run_more_tests.sh
|
||||
|
||||
# requires which
|
||||
- name: Validate
|
||||
run: |
|
||||
make -j$(nproc) checkCWEEntries validateXML
|
||||
|
||||
- name: Test addons
|
||||
run: |
|
||||
./cppcheck --addon=threadsafety addons/test/threadsafety
|
||||
./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
|
||||
|
||||
- name: Generate Qt help file on ubuntu 18.04
|
||||
if: false # matrix.os == 'ubuntu-18.04'
|
||||
run: |
|
||||
pushd gui/help
|
||||
qcollectiongenerator online-help.qhcp -o online-help.qhc
|
||||
|
|
@ -2,517 +2,61 @@
|
|||
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
||||
name: CI-unixish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'releases/**'
|
||||
tags:
|
||||
- '2.*'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build_cmake_tinyxml2:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
|
||||
include:
|
||||
- use_qt6: On
|
||||
- os: ubuntu-20.04
|
||||
use_qt6: Off
|
||||
fail-fast: false # Prefer quick result
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
env:
|
||||
# TODO: figure out why there are cache misses with PCH enabled
|
||||
CCACHE_SLOPPINESS: pch_defines,time_macros
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libxml2-utils libtinyxml2-dev qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
# qt6-tools-dev-tools for lprodump
|
||||
# qt6-l10n-tools for lupdate
|
||||
sudo apt-get install libxml2-utils 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
|
||||
if: contains(matrix.os, 'macos')
|
||||
run: |
|
||||
# pcre was removed from runner images in November 2022
|
||||
brew install coreutils qt@6 tinyxml2 pcre
|
||||
|
||||
- name: CMake build on ubuntu (with GUI / system tinyxml2)
|
||||
if: contains(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
cmake -S . -B cmake.output.tinyxml2 -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:
|
||||
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libxml2-utils qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
|
||||
|
||||
# TODO: move latest compiler to separate step
|
||||
# TODO: bail out on warnings with latest GCC
|
||||
- name: Set up GCC
|
||||
uses: egor-tensin/setup-gcc@v1
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
with:
|
||||
version: 13
|
||||
platform: x64
|
||||
|
||||
- name: Select compiler
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
run: |
|
||||
echo "CXX=g++-13" >> $GITHUB_ENV
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
# qt6-tools-dev-tools for lprodump
|
||||
# qt6-l10n-tools for lupdate
|
||||
sudo apt-get install libxml2-utils qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev
|
||||
|
||||
# coreutils contains "nproc"
|
||||
- name: Install missing software on macos
|
||||
if: contains(matrix.os, 'macos')
|
||||
run: |
|
||||
# pcre was removed from runner images in November 2022
|
||||
brew install coreutils qt@6 pcre
|
||||
|
||||
- name: CMake build on ubuntu (with GUI)
|
||||
if: contains(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=${{ matrix.use_qt6 }} -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
cmake --build cmake.output -- -j$(nproc)
|
||||
|
||||
- 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
|
||||
|
||||
- name: Test with Unsigned char
|
||||
run: |
|
||||
./testrunner TestSymbolDatabase
|
||||
|
||||
build_mathlib:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
|
||||
fail-fast: false # Prefer quick result
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
||||
|
||||
# coreutils contains "nproc"
|
||||
- name: Install missing software on macos
|
||||
if: contains(matrix.os, 'macos')
|
||||
run: |
|
||||
brew install coreutils
|
||||
|
||||
- name: Build with TEST_MATHLIB_VALUE
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all
|
||||
|
||||
- name: Test with TEST_MATHLIB_VALUE
|
||||
run: |
|
||||
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE check
|
||||
|
||||
check_nonneg:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
|
||||
fail-fast: false # Prefer quick result
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# coreutils contains "g++" (default is "c++") and "nproc"
|
||||
- name: Install missing software on macos
|
||||
if: contains(matrix.os, 'macos')
|
||||
run: |
|
||||
brew install coreutils
|
||||
|
||||
- name: Check syntax with NONNEG
|
||||
run: |
|
||||
ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
|
||||
|
||||
build_qmake:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
# no longer build with qmake on MacOS as brew might lack pre-built Qt5 packages causing the step to run for hours
|
||||
os: [ubuntu-20.04, ubuntu-22.04]
|
||||
fail-fast: false # Prefer quick result
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
if: contains(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
|
||||
|
||||
# coreutils contains "nproc"
|
||||
- name: Install missing software on macos
|
||||
if: contains(matrix.os, 'macos')
|
||||
run: |
|
||||
brew install coreutils qt@5
|
||||
# expose qmake
|
||||
brew link qt@5 --force
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
||||
|
||||
- name: Build GUI
|
||||
run: |
|
||||
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
pushd gui
|
||||
qmake CONFIG+=debug CONFIG+=ccache HAVE_QCHART=yes
|
||||
make -j$(nproc)
|
||||
|
||||
# TODO: binaries are in a different location on macos
|
||||
- name: Build and Run GUI tests
|
||||
if: contains(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
pushd gui/test/cppchecklibrarydata
|
||||
qmake CONFIG+=debug CONFIG+=ccache
|
||||
make -j$(nproc)
|
||||
./test-cppchecklibrarydata
|
||||
popd
|
||||
pushd gui/test/filelist
|
||||
qmake CONFIG+=debug CONFIG+=ccache
|
||||
make -j$(nproc)
|
||||
./test-filelist
|
||||
popd
|
||||
pushd gui/test/projectfile
|
||||
qmake CONFIG+=debug CONFIG+=ccache
|
||||
make -j$(nproc)
|
||||
./test-projectfile
|
||||
popd
|
||||
pushd gui/test/translationhandler
|
||||
qmake CONFIG+=debug CONFIG+=ccache
|
||||
make -j$(nproc)
|
||||
# TODO: requires X session because of QApplication dependency in translationhandler.cpp
|
||||
#./test-translationhandler
|
||||
popd
|
||||
pushd gui/test/xmlreportv2
|
||||
qmake CONFIG+=debug CONFIG+=ccache
|
||||
make -j$(nproc)
|
||||
./test-xmlreportv2
|
||||
|
||||
- name: Generate Qt help file
|
||||
run: |
|
||||
pushd gui/help
|
||||
qhelpgenerator online-help.qhcp -o online-help.qhc
|
||||
|
||||
- name: Build triage
|
||||
run: |
|
||||
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
pushd tools/triage
|
||||
qmake CONFIG+=debug CONFIG+=ccache
|
||||
make -j$(nproc)
|
||||
|
||||
build:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
|
||||
fail-fast: false # Prefer quick result
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
fail-fast: false # not worthwhile...
|
||||
|
||||
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 }}
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
if: contains(matrix.os, 'ubuntu')
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libxml2-utils
|
||||
sudo apt-get install z3 libz3-dev
|
||||
cp externals/z3_version_old.h externals/z3_version.h
|
||||
|
||||
# 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')
|
||||
if: matrix.os == 'macos-latest'
|
||||
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
|
||||
brew install z3
|
||||
|
||||
- name: Install Qt
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
uses: jurplel/install-qt-action@v2
|
||||
with:
|
||||
modules: 'qtcharts'
|
||||
|
||||
- name: Build cppcheck
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
make -j$(nproc) HAVE_RULES=yes
|
||||
cp externals/z3_version_old.h externals/z3_version.h
|
||||
make -j2 USE_Z3=yes HAVE_RULES=yes
|
||||
|
||||
- name: Build test
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
make -j$(nproc) testrunner HAVE_RULES=yes
|
||||
make -j2 testrunner USE_Z3=yes HAVE_RULES=yes
|
||||
|
||||
- name: Run test
|
||||
run: |
|
||||
make -j$(nproc) check HAVE_RULES=yes
|
||||
|
||||
# requires "gnu-sed" installed on macos
|
||||
- name: Run extra tests
|
||||
run: |
|
||||
tools/generate_and_run_more_tests.sh
|
||||
|
||||
# do not use pushd in this step since we go below the working directory
|
||||
- name: Run test/cli
|
||||
run: |
|
||||
cd test/cli
|
||||
python3 -m pytest -Werror --strict-markers -vv test-*.py
|
||||
cd ../../..
|
||||
ln -s cppcheck 'cpp check'
|
||||
cd 'cpp check/test/cli'
|
||||
python3 -m pytest -Werror --strict-markers -vv test-*.py
|
||||
|
||||
- name: Run cfg tests
|
||||
if: matrix.os != 'ubuntu-22.04'
|
||||
run: |
|
||||
make -j$(nproc) checkcfg
|
||||
|
||||
- name: Run cfg tests (strict)
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
run: |
|
||||
make -j$(nproc) checkcfg
|
||||
env:
|
||||
STRICT: 1
|
||||
|
||||
- name: Run --dump test
|
||||
run: |
|
||||
./cppcheck test/testpreprocessor.cpp --dump
|
||||
xmllint --noout test/testpreprocessor.cpp.dump
|
||||
make -j2 check USE_Z3=yes HAVE_RULES=yes
|
||||
|
||||
- name: Validate
|
||||
run: |
|
||||
make -j$(nproc) checkCWEEntries validateXML
|
||||
|
||||
# TODO: move to scriptcheck.yml so these are tested with all Python versions?
|
||||
- name: Test addons
|
||||
run: |
|
||||
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety addons/test/threadsafety
|
||||
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety --std=c++03 addons/test/threadsafety
|
||||
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra addons/test/misra/crash*.c
|
||||
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra --enable=information addons/test/misra/config*.c
|
||||
|
||||
./cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
|
||||
pushd addons/test
|
||||
# We'll force C89 standard to enable an additional verification for
|
||||
# rules 5.4 and 5.5 which have standard-dependent options.
|
||||
../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64
|
||||
python3 ../misra.py -verify misra/misra-test.c.dump
|
||||
# TODO: do we need to verify something here?
|
||||
../../cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.h
|
||||
../../cppcheck --dump misra/misra-test.cpp
|
||||
python3 ../misra.py -verify misra/misra-test.cpp.dump
|
||||
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_ascii.txt -verify misra/misra-test.cpp.dump
|
||||
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_utf8.txt -verify misra/misra-test.cpp.dump
|
||||
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_windows1250.txt -verify misra/misra-test.cpp.dump
|
||||
../../cppcheck --addon=misra --enable=style --platform=avr8 --error-exitcode=1 misra/misra-test-avr8.c
|
||||
../../cppcheck --dump misc-test.cpp
|
||||
python3 ../misc.py -verify misc-test.cpp.dump
|
||||
../../cppcheck --dump naming_test.c
|
||||
python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
|
||||
../../cppcheck --dump naming_test.cpp
|
||||
python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
|
||||
../../cppcheck --dump namingng_test.c
|
||||
python3 ../namingng.py --configfile ../naming.json --verify namingng_test.c.dump
|
||||
|
||||
- name: Build democlient
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
run: |
|
||||
warnings="-pedantic -Wall -Wextra -Wcast-qual -Wno-deprecated-declarations -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar"
|
||||
g++ $warnings -c -Ilib -Iexternals/tinyxml2 democlient/democlient.cpp
|
||||
|
||||
selfcheck:
|
||||
needs: build # wait for all tests to be successful first
|
||||
|
||||
runs-on: ubuntu-22.04 # run on the latest image only
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev libboost-container-dev
|
||||
|
||||
- name: Self check (build)
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
# compile with verification and ast matchers
|
||||
make -j$(nproc) -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
|
||||
|
||||
- name: Self check
|
||||
run: |
|
||||
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5_summary -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings --check-level=exhaustive"
|
||||
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
|
||||
ec=0
|
||||
make validateCFG
|
||||
make validatePlatforms
|
||||
|
||||
# TODO: add --check-config
|
||||
|
||||
# early exit
|
||||
if [ $ec -eq 1 ]; then
|
||||
exit $ec
|
||||
fi
|
||||
|
||||
# self check simplecpp
|
||||
./cppcheck $selfcheck_options externals/simplecpp || ec=1
|
||||
# self check lib/cli
|
||||
mkdir b1
|
||||
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json cli lib || ec=1
|
||||
# check gui with qt settings
|
||||
mkdir b2
|
||||
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b2 -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui || ec=1
|
||||
# self check test and tools
|
||||
./cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1
|
||||
# triage
|
||||
./cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage || ec=1
|
||||
exit $ec
|
||||
- name: Build GUI on ubuntu
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
pushd gui
|
||||
qmake HAVE_QCHART=yes
|
||||
make -j2
|
||||
|
|
|
@ -4,204 +4,123 @@
|
|||
|
||||
name: CI-windows
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'releases/**'
|
||||
tags:
|
||||
- '2.*'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
on: [push,pull_request]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: cmd
|
||||
|
||||
# TODO: choose/add a step to bail out on compiler warnings (maybe even the release build)
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
build_qt:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-2019, windows-2022]
|
||||
qt_ver: [5.15.2, 6.6.0]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Visual Studio environment
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Install Qt ${{ matrix.qt_ver }}
|
||||
uses: jurplel/install-qt-action@v3
|
||||
with:
|
||||
version: ${{ matrix.qt_ver }}
|
||||
modules: 'qtcharts'
|
||||
cache: true
|
||||
|
||||
- name: Build GUI release (qmake)
|
||||
if: startsWith(matrix.qt_ver, '5')
|
||||
run: |
|
||||
cd gui || exit /b !errorlevel!
|
||||
qmake HAVE_QCHART=yes || exit /b !errorlevel!
|
||||
nmake release || exit /b !errorlevel!
|
||||
env:
|
||||
CL: /MP
|
||||
|
||||
- name: Deploy GUI
|
||||
if: startsWith(matrix.qt_ver, '5')
|
||||
run: |
|
||||
windeployqt Build\gui || exit /b !errorlevel!
|
||||
del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel!
|
||||
del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel!
|
||||
|
||||
- name: Build GUI release (CMake)
|
||||
if: startsWith(matrix.qt_ver, '6')
|
||||
run: |
|
||||
cmake -S . -B build -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On || exit /b !errorlevel!
|
||||
cmake --build build --target cppcheck-gui || exit /b !errorlevel!
|
||||
|
||||
# TODO: deploy with CMake/Qt6
|
||||
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-2019, windows-2022]
|
||||
config: [debug, release]
|
||||
fail-fast: false
|
||||
# windows 2016 should default to VS 2017. Not supported by setup-msbuild
|
||||
os: [windows-2019]
|
||||
fail-fast: true
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
env:
|
||||
# see https://www.pcre.org/original/changelog.txt
|
||||
PCRE_VERSION: 8.45
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python 3.12
|
||||
if: matrix.config == 'release'
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
check-latest: true
|
||||
|
||||
- name: Set up Visual Studio environment
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Cache PCRE
|
||||
id: cache-pcre
|
||||
uses: actions/cache@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!
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup msbuild.exe
|
||||
uses: microsoft/setup-msbuild@v1.0.0
|
||||
|
||||
- name: Install PCRE
|
||||
if: steps.cache-pcre.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
|
||||
cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
|
||||
cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off || exit /b !errorlevel!
|
||||
nmake || exit /b !errorlevel!
|
||||
copy pcre.h ..\externals || exit /b !errorlevel!
|
||||
copy pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
|
||||
env:
|
||||
CL: /MP
|
||||
curl -fsSL https://ftp.pcre.org/pub/pcre/pcre-8.44.zip -o pcre-8.44.zip
|
||||
7z x pcre-8.44.zip
|
||||
cd pcre-8.44
|
||||
cmake . -G "Visual Studio 16 2019" -A x64
|
||||
msbuild -m PCRE.sln /p:Configuration=Release /p:Platform=x64
|
||||
dir
|
||||
dir Release
|
||||
dir x64
|
||||
dir x64\Release
|
||||
copy pcre.h ..\externals
|
||||
copy Release\pcre.lib ..\externals\pcre64.lib
|
||||
|
||||
- name: Install missing Python packages
|
||||
if: matrix.config == 'release'
|
||||
- name: Install Z3 library
|
||||
run: |
|
||||
python -m pip install pip --upgrade || exit /b !errorlevel!
|
||||
python -m pip install pytest || exit /b !errorlevel!
|
||||
python -m pip install pytest-custom_exit_code || exit /b !errorlevel!
|
||||
python -m pip install pytest-timeout || exit /b !errorlevel!
|
||||
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
|
||||
7z x z3-4.8.7-win.zip -oexternals -r -y
|
||||
move externals\z3-4.8.7-x64-win externals\z3
|
||||
|
||||
- name: Run CMake
|
||||
if: false # TODO: enable
|
||||
run: |
|
||||
cmake -S . -B build -DBUILD_TESTS=On || exit /b !errorlevel!
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
with:
|
||||
modules: 'qtcharts'
|
||||
|
||||
- name: Build CLI debug configuration using MSBuild
|
||||
if: matrix.config == 'debug'
|
||||
- name: Build GUI x64 release
|
||||
run: |
|
||||
:: cmake --build build --target check --config Debug || exit /b !errorlevel!
|
||||
msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel!
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||
cd gui
|
||||
qmake HAVE_QCHART=yes
|
||||
nmake release
|
||||
|
||||
- name: Deploy GUI
|
||||
run: |
|
||||
dir Build
|
||||
dir Build\gui
|
||||
windeployqt Build\gui
|
||||
dir Build\gui
|
||||
del Build\gui\cppcheck-gui.ilk
|
||||
del Build\gui\cppcheck-gui.pdb
|
||||
|
||||
- name: Build CLI x64 debug configuration using MSBuild
|
||||
run: msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE /p:Platform=x64
|
||||
|
||||
- name: Run Debug test
|
||||
if: matrix.config == 'debug'
|
||||
run: .\bin\debug\testrunner.exe || exit /b !errorlevel!
|
||||
run: .\bin\debug\testrunner.exe
|
||||
|
||||
- name: Build CLI release configuration using MSBuild
|
||||
if: matrix.config == 'release'
|
||||
run: |
|
||||
:: cmake --build build --target check --config Release || exit /b !errorlevel!
|
||||
msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel!
|
||||
- name: Build x64 release configuration using MSBuild
|
||||
run: msbuild -m cppcheck.sln /p:Configuration=Release-PCRE /p:Platform=x64
|
||||
|
||||
- name: Run Release test
|
||||
if: matrix.config == 'release'
|
||||
run: .\bin\testrunner.exe || exit /b !errorlevel!
|
||||
|
||||
- name: Run test/cli
|
||||
if: matrix.config == 'release'
|
||||
run: |
|
||||
:: since FILESDIR is not set copy the binary to the root so the addons are found
|
||||
:: copy .\build\bin\Release\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
|
||||
copy .\bin\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
|
||||
copy .\bin\cppcheck-core.dll .\cppcheck-core.dll || exit /b !errorlevel!
|
||||
cd test/cli || exit /b !errorlevel!
|
||||
:: python -m pytest -Werror --strict-markers -vv --suppress-no-test-exit-code test-clang-import.py || exit /b !errorlevel!
|
||||
python -m pytest -Werror --strict-markers -vv test-helloworld.py || exit /b !errorlevel!
|
||||
python -m pytest -Werror --strict-markers -vv test-inline-suppress.py || exit /b !errorlevel!
|
||||
python -m pytest -Werror --strict-markers -vv test-more-projects.py || exit /b !errorlevel!
|
||||
python -m pytest -Werror --strict-markers -vv test-other.py || exit /b !errorlevel!
|
||||
python -m pytest -Werror --strict-markers -vv test-proj2.py || exit /b !errorlevel!
|
||||
python -m pytest -Werror --strict-markers -vv test-suppress-syntaxError.py || exit /b !errorlevel!
|
||||
|
||||
- name: Test addons
|
||||
if: matrix.config == 'release'
|
||||
run: |
|
||||
.\cppcheck --addon=threadsafety addons\test\threadsafety || exit /b !errorlevel!
|
||||
.\cppcheck --addon=threadsafety --std=c++03 addons\test\threadsafety || exit /b !errorlevel!
|
||||
.\cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c || exit /b !errorlevel!
|
||||
cd addons\test
|
||||
rem We'll force C89 standard to enable an additional verification for
|
||||
rem rules 5.4 and 5.5 which have standard-dependent options.
|
||||
..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 || exit /b !errorlevel!
|
||||
python3 ..\misra.py -verify misra\misra-test.c.dump || exit /b !errorlevel!
|
||||
rem TODO: do we need to verify something here?
|
||||
..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra\misra-test.h || exit /b !errorlevel!
|
||||
..\..\cppcheck --dump misra\misra-test.cpp || exit /b !errorlevel!
|
||||
python3 ..\misra.py -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
|
||||
python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_ascii.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
|
||||
python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_utf8.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
|
||||
python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_windows1250.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
|
||||
..\..\cppcheck --addon=misra --enable=style --platform=avr8 --error-exitcode=1 misra\misra-test-avr8.c || exit /b !errorlevel!
|
||||
..\..\cppcheck --dump misc-test.cpp || exit /b !errorlevel!
|
||||
python3 ..\misc.py -verify misc-test.cpp.dump || exit /b !errorlevel!
|
||||
..\..\cppcheck --dump naming_test.c || exit /b !errorlevel!
|
||||
rem TODO: fix this - does not fail on Linux
|
||||
rem python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump || exit /b !errorlevel!
|
||||
..\..\cppcheck --dump naming_test.cpp || exit /b !errorlevel!
|
||||
python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump || exit /b !errorlevel!
|
||||
..\..\cppcheck --dump namingng_test.c || exit /b !errorlevel!
|
||||
python3 ..\namingng.py --configfile ..\naming.json --verify namingng_test.c.dump || exit /b !errorlevel!
|
||||
|
||||
run: .\bin\testrunner.exe
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_gui
|
||||
path: Build\gui
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_gui
|
||||
path: ./**/cfg/*.cfg
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_gui
|
||||
path: ./**/platforms/*.xml
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_gui
|
||||
path: externals\z3\bin\*.dll
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_cli
|
||||
path: ./bin/cppcheck.exe
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_cli
|
||||
path: ./bin/cppcheck-core.dll
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_cli
|
||||
path: externals\z3\bin\*.dll
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_cli
|
||||
path: ./**/cfg/*.cfg
|
||||
|
||||
- uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: cppcheck_cli
|
||||
path: ./**/platforms/*.xml
|
||||
|
|
|
@ -1,123 +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: address 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
|
||||
ASAN_OPTIONS: detect_stack_use_after_return=1
|
||||
# TODO: figure out why there are cache misses with PCH enabled
|
||||
CCACHE_SLOPPINESS: pch_defines,time_macros
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- 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
|
||||
|
||||
# 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:
|
||||
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: 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
|
|
@ -1,58 +0,0 @@
|
|||
name: Build manual
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'releases/**'
|
||||
tags:
|
||||
- '2.*'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
convert_via_pandoc:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- run: |
|
||||
mkdir output
|
||||
|
||||
- uses: docker://pandoc/latex:2.9
|
||||
with:
|
||||
args: --output=output/manual.html man/manual.md
|
||||
|
||||
- uses: docker://pandoc/latex:2.9
|
||||
with:
|
||||
args: --output=output/manual.pdf man/manual.md
|
||||
|
||||
- uses: docker://pandoc/latex:2.9
|
||||
with:
|
||||
args: --output=output/manual-premium.pdf man/manual-premium.md
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: output
|
||||
path: output
|
||||
|
||||
manpage:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y xsltproc docbook-xsl
|
||||
|
||||
- name: build manpage
|
||||
run: |
|
||||
make man
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cppcheck.1
|
||||
path: cppcheck.1
|
|
@ -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
|
|
@ -1,73 +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: clang-tidy
|
||||
|
||||
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 -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-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
|
||||
run: |
|
||||
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off
|
||||
env:
|
||||
CC: clang-17
|
||||
CXX: clang++-17
|
||||
|
||||
- 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
|
||||
run: |
|
||||
cmake --build cmake.output --target run-clang-tidy 2> /dev/null
|
|
@ -1,54 +0,0 @@
|
|||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'releases/**'
|
||||
tags:
|
||||
- '2.*'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Override automatic language detection by changing the below list
|
||||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
|
||||
language: ['cpp', 'python']
|
||||
# Learn more...
|
||||
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libxml2-utils
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
setup-python-dependencies: false
|
||||
|
||||
- run: |
|
||||
make -j$(nproc) HAVE_RULES=yes cppcheck
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
|
@ -2,64 +2,45 @@
|
|||
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
||||
name: Coverage
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'releases/**'
|
||||
tags:
|
||||
- '2.*'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ runner.os }}
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libxml2-utils lcov
|
||||
|
||||
- name: Install missing Python packages on ubuntu
|
||||
run: |
|
||||
python -m pip install pip --upgrade
|
||||
python -m pip install lcov_cobertura
|
||||
sudo apt-get install libxml2-utils
|
||||
sudo apt-get install z3 libz3-dev
|
||||
sudo apt-get install lcov
|
||||
pip install lcov_cobertura
|
||||
|
||||
- name: Compile instrumented
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
make -j$(nproc) all CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes
|
||||
|
||||
- name: Run instrumented tests
|
||||
run: |
|
||||
./testrunner
|
||||
test/cfg/runtests.sh
|
||||
|
||||
cp externals/z3_version_old.h externals/z3_version.h
|
||||
make test CXXFLAGS="-g -fprofile-arcs -ftest-coverage" USE_Z3=yes HAVE_RULES=yes -j$(nproc)
|
||||
|
||||
- name: Generate coverage report
|
||||
run: |
|
||||
rm -rf coverage_report
|
||||
./testrunner
|
||||
test/cfg/runtests.sh
|
||||
gcov lib/*.cpp -o lib/
|
||||
lcov --directory ./ --capture --output-file lcov_tmp.info -b ./
|
||||
lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info
|
||||
genhtml lcov.info -o coverage_report --frame --legend --demangle-cpp
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Coverage results
|
||||
path: coverage_report
|
||||
|
||||
- uses: codecov/codecov-action@v3
|
||||
- uses: codecov/codecov-action@v1
|
||||
with:
|
||||
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|
||||
# file: ./coverage.xml # optional
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,33 @@
|
|||
name: "IRC Push Notification"
|
||||
on: [push, pull_request, create]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
if: github.repository == 'danmar/cppcheck'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: irc push
|
||||
uses: rectalogic/notify-irc@v1
|
||||
if: github.event_name == 'push'
|
||||
with:
|
||||
channel: "#cppcheck"
|
||||
nickname: cppcheck-github-notifier
|
||||
message: |
|
||||
${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }}
|
||||
${{ join(github.event.commits.*.message) }}
|
||||
- name: irc pull request
|
||||
uses: rectalogic/notify-irc@v1
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
channel: "#cppcheck"
|
||||
nickname: cppcheck-github-notifier
|
||||
message: |
|
||||
${{ github.actor }} opened PR ${{ github.event.html_url }}
|
||||
- name: irc tag created
|
||||
uses: rectalogic/notify-irc@v1
|
||||
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||
with:
|
||||
channel: "#cppcheck"
|
||||
nickname: cppcheck-github-notifier
|
||||
message: |
|
||||
${{ github.actor }} tagged ${{ github.repository }} ${{ github.event.ref }}
|
|
@ -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
|
|
@ -7,13 +7,9 @@ name: release-windows
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- '2.*'
|
||||
- '2.*'
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
defaults:
|
||||
run:
|
||||
|
@ -23,147 +19,73 @@ jobs:
|
|||
|
||||
build:
|
||||
|
||||
runs-on: windows-2022
|
||||
|
||||
env:
|
||||
# see https://www.pcre.org/original/changelog.txt
|
||||
PCRE_VERSION: 8.45
|
||||
QT_VERSION: 5.15.2
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Visual Studio environment
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- 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: Setup msbuild.exe
|
||||
uses: microsoft/setup-msbuild@v1.0.0
|
||||
|
||||
- name: Install PCRE
|
||||
if: steps.cache-pcre.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
|
||||
cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
|
||||
cmake . -G "Visual Studio 17 2022" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF || exit /b !errorlevel!
|
||||
msbuild -m PCRE.sln -p:Configuration=Release -p:Platform=x64 || exit /b !errorlevel!
|
||||
copy pcre.h ..\externals || exit /b !errorlevel!
|
||||
copy Release\pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
|
||||
curl -fsSL https://ftp.pcre.org/pub/pcre/pcre-8.44.zip -o pcre-8.44.zip
|
||||
7z x pcre-8.44.zip
|
||||
cd pcre-8.44
|
||||
cmake . -G "Visual Studio 16 2019" -A x64
|
||||
msbuild -m PCRE.sln /p:Configuration=Release /p:Platform=x64
|
||||
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
|
||||
# available tools: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-tools
|
||||
- name: Install Qt ${{ env.QT_VERSION }}
|
||||
uses: jurplel/install-qt-action@v3
|
||||
- name: Install Z3 library
|
||||
run: |
|
||||
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
|
||||
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:
|
||||
version: ${{ env.QT_VERSION }}
|
||||
modules: 'qtcharts'
|
||||
tools: 'tools_opensslv3_x64'
|
||||
cache: true
|
||||
|
||||
- name: Create .qm
|
||||
run: |
|
||||
cd gui || exit /b !errorlevel!
|
||||
lupdate gui.pro -no-obsolete || exit /b !errorlevel!
|
||||
lrelease gui.pro -removeidentical || exit /b !errorlevel!
|
||||
cd gui
|
||||
lupdate gui.pro
|
||||
lrelease gui.pro -removeidentical
|
||||
|
||||
- name: Matchcompiler
|
||||
run: python tools\matchcompiler.py --write-dir lib || exit /b !errorlevel!
|
||||
run: python tools\matchcompiler.py --write-dir lib
|
||||
|
||||
- name: Build x64 release GUI
|
||||
run: |
|
||||
cd gui || exit /b !errorlevel!
|
||||
qmake HAVE_QCHART=yes || exit /b !errorlevel!
|
||||
nmake release || exit /b !errorlevel!
|
||||
env:
|
||||
CL: /MP
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||
cd gui
|
||||
qmake HAVE_QCHART=yes
|
||||
nmake release
|
||||
|
||||
- name: Deploy app
|
||||
run: |
|
||||
windeployqt Build\gui || exit /b !errorlevel!
|
||||
del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel!
|
||||
del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel!
|
||||
windeployqt Build\gui
|
||||
del Build\gui\cppcheck-gui.ilk
|
||||
del Build\gui\cppcheck-gui.pdb
|
||||
|
||||
# TODO: build with boost enabled
|
||||
- name: Build CLI x64 release configuration using MSBuild
|
||||
run: msbuild -m cppcheck.sln -t:cli -p:Configuration=Release-PCRE -p:Platform=x64 || exit /b !errorlevel!
|
||||
|
||||
- name: Compile misra.py executable
|
||||
run: |
|
||||
pip install -U pyinstaller || exit /b !errorlevel!
|
||||
cd addons || exit /b !errorlevel!
|
||||
pyinstaller --hidden-import xml --hidden-import xml.etree --hidden-import xml.etree.ElementTree misra.py || exit /b !errorlevel!
|
||||
del *.spec || exit /b !errorlevel!
|
||||
|
||||
- name: Collect files
|
||||
run: |
|
||||
move Build\gui win_installer\files || exit /b !errorlevel!
|
||||
mkdir win_installer\files\addons || exit /b !errorlevel!
|
||||
copy addons\*.* win_installer\files\addons || exit /b !errorlevel!
|
||||
copy addons\dist\misra\*.* win_installer\files\addons || exit /b !errorlevel!
|
||||
mkdir win_installer\files\cfg || exit /b !errorlevel!
|
||||
copy cfg\*.cfg win_installer\files\cfg || exit /b !errorlevel!
|
||||
:: "platforms" is a folder used by Qt as well so it already exists
|
||||
:: mkdir win_installer\files\platforms || exit /b !errorlevel!
|
||||
copy platforms\*.xml win_installer\files\platforms || exit /b !errorlevel!
|
||||
copy bin\cppcheck.exe win_installer\files || exit /b !errorlevel!
|
||||
copy bin\cppcheck-core.dll win_installer\files || exit /b !errorlevel!
|
||||
mkdir win_installer\files\help || exit /b !errorlevel!
|
||||
xcopy /s gui\help win_installer\files\help || exit /b !errorlevel!
|
||||
del win_installer\files\translations\*.qm || exit /b !errorlevel!
|
||||
move gui\*.qm win_installer\files\translations || exit /b !errorlevel!
|
||||
:: copy libcrypto-3-x64.dll and libssl-3-x64.dll
|
||||
copy %RUNNER_WORKSPACE%\Qt\Tools\OpenSSLv3\Win_x64\bin\lib*.dll win_installer\files || exit /b !errorlevel!
|
||||
run: msbuild -m cppcheck.sln /t:cli /p:Configuration=Release-PCRE /p:Platform=x64
|
||||
|
||||
- name: Build Installer
|
||||
run: |
|
||||
cd win_installer || exit /b !errorlevel!
|
||||
REM Read ProductVersion
|
||||
for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a
|
||||
REM Remove double quotes
|
||||
set PRODUCTVER=%PRODUCTVER:"=%
|
||||
echo ProductVersion="%PRODUCTVER%" || exit /b !errorlevel!
|
||||
msbuild -m cppcheck.wixproj -p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }} || exit /b !errorlevel!
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||
mkdir bin
|
||||
xcopy /S Build\gui bin
|
||||
cd win_installer
|
||||
msbuild -m cppcheck.wixproj /p:Platform=x64,ProductVersion=2.0.${{ github.run_number }}
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: installer
|
||||
name: Build
|
||||
path: win_installer/Build/
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: deploy
|
||||
path: win_installer\files
|
||||
|
||||
- name: Clean up deploy
|
||||
run: |
|
||||
del win_installer\files\addons\*.dll || exit /b !errorlevel!
|
||||
del win_installer\files\addons\*.pyd || exit /b !errorlevel!
|
||||
del win_installer\files\addons\base_library.zip || exit /b !errorlevel!
|
||||
rmdir /s /q win_installer\files\bearer || exit /b !errorlevel!
|
||||
rmdir /s /q win_installer\files\help || exit /b !errorlevel!
|
||||
rmdir /s /q win_installer\files\iconengines || exit /b !errorlevel!
|
||||
rmdir /s /q win_installer\files\imageformats || exit /b !errorlevel!
|
||||
rmdir /s /q win_installer\files\printsupport || exit /b !errorlevel!
|
||||
rmdir /s /q win_installer\files\sqldrivers || exit /b !errorlevel!
|
||||
ren win_installer\files\translations lang || exit /b !errorlevel!
|
||||
del win_installer\files\d3dcompiler_47.dll || exit /b !errorlevel!
|
||||
del win_installer\files\libEGL.dll || exit /b !errorlevel!
|
||||
del win_installer\files\libGLESv2.dll || exit /b !errorlevel!
|
||||
del win_installer\files\opengl32sw.dll || exit /b !errorlevel!
|
||||
del win_installer\files\Qt5Svg.dll || exit /b !errorlevel!
|
||||
del win_installer\files\vc_redist.x64.exe || exit /b !errorlevel!
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: portable
|
||||
path: win_installer\files
|
||||
|
|
|
@ -1,200 +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: scriptcheck
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'releases/**'
|
||||
tags:
|
||||
- '2.*'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
# 'ubuntu-22.04' removes Python 2.7, 3.6 and 3.6 so keep the previous LTS version
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ runner.os }}
|
||||
|
||||
- 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
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
|
||||
include:
|
||||
- python-version: '3.12'
|
||||
python-latest: true
|
||||
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Restore Cppcheck
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: cppcheck
|
||||
key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }}
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
check-latest: true
|
||||
|
||||
- name: Install missing software on ubuntu
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install tidy libxml2-utils
|
||||
|
||||
- name: Install missing software on ubuntu (Python 2)
|
||||
if: matrix.python-version == '2.7'
|
||||
run: |
|
||||
python -m pip install pip --upgrade
|
||||
python -m pip install pathlib
|
||||
python -m pip install pytest
|
||||
python -m pip install pygments
|
||||
|
||||
- name: Install missing software on ubuntu (Python 3)
|
||||
if: matrix.python-version != '2.7'
|
||||
run: |
|
||||
# shellcheck cannot be installed via pip
|
||||
# ERROR: Could not find a version that satisfies the requirement shellcheck (from versions: none)
|
||||
# ERROR: No matching distribution found for shellcheck
|
||||
sudo apt-get install shellcheck
|
||||
python -m pip install pip --upgrade
|
||||
python -m pip install natsort
|
||||
python -m pip install pexpect
|
||||
python -m pip install pylint
|
||||
python -m pip install unittest2
|
||||
python -m pip install pytest
|
||||
python -m pip install pygments
|
||||
python -m pip install requests
|
||||
python -m pip install psutil
|
||||
|
||||
- name: run Shellcheck
|
||||
if: matrix.python-latest
|
||||
run: |
|
||||
find . -name "*.sh" | xargs shellcheck --exclude SC2002,SC2013,SC2034,SC2035,SC2043,SC2046,SC2086,SC2089,SC2090,SC2129,SC2211,SC2231
|
||||
|
||||
- name: run pylint
|
||||
if: matrix.python-latest
|
||||
run: |
|
||||
echo "FIXME pylint is disabled for now because it fails to import files:"
|
||||
echo "FIXME addons/runaddon.py:1:0: E0401: Unable to import 'cppcheckdata' (import-error)"
|
||||
echo "FIXME addons/runaddon.py:1:0: E0401: Unable to import 'cppcheck' (import-error)"
|
||||
# pylint --rcfile=pylintrc_travis --jobs $(nproc) addons/*.py htmlreport/cppcheck-htmlreport htmlreport/*.py tools/*.py
|
||||
|
||||
- name: check .json files
|
||||
if: matrix.python-latest
|
||||
run: |
|
||||
find . -name '*.json' | xargs -n 1 python -m json.tool > /dev/null
|
||||
|
||||
- name: Validate
|
||||
if: matrix.python-latest
|
||||
run: |
|
||||
make -j$(nproc) validateCFG validatePlatforms validateRules
|
||||
|
||||
- name: check python syntax
|
||||
if: matrix.python-version != '2.7'
|
||||
run: |
|
||||
python -m py_compile addons/*.py
|
||||
python -m py_compile htmlreport/cppcheck-htmlreport
|
||||
python -m py_compile htmlreport/*.py
|
||||
python -m py_compile tools/*.py
|
||||
|
||||
- name: compile addons
|
||||
run: |
|
||||
python -m compileall ./addons
|
||||
|
||||
- name: test matchcompiler
|
||||
run: |
|
||||
python tools/test_matchcompiler.py
|
||||
|
||||
# we cannot specify -Werror since xml/etree/ElementTree.py in Python 3.9/3.10 contains an unclosed file
|
||||
- name: test addons
|
||||
if: matrix.python-version == '3.9' || matrix.python-version == '3.10'
|
||||
run: |
|
||||
python -m pytest --strict-markers -vv addons/test/test-*.py
|
||||
env:
|
||||
PYTHONPATH: ./addons
|
||||
|
||||
- name: test addons
|
||||
if: matrix.python-version != '3.9' && matrix.python-version != '3.10'
|
||||
run: |
|
||||
python -m pytest -Werror --strict-markers -vv addons/test/test-*.py
|
||||
env:
|
||||
PYTHONPATH: ./addons
|
||||
|
||||
- name: test htmlreport
|
||||
run: |
|
||||
htmlreport/test_htmlreport.py
|
||||
cd htmlreport
|
||||
./check.sh
|
||||
|
||||
- name: test reduce
|
||||
run: |
|
||||
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: |
|
||||
git diff --exit-code
|
|
@ -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.*
|
|
@ -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
|
|
@ -1,119 +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: undefined behaviour sanitizers
|
||||
|
||||
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
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:report_error_type=1
|
||||
# TODO: figure out why there are cache misses with PCH enabled
|
||||
CCACHE_SLOPPINESS: pch_defines,time_macros
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@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 }}
|
||||
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:
|
||||
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
|
||||
run: |
|
||||
# make sure auto-generated GUI files exist
|
||||
make -C cmake.output autogen
|
||||
make -C cmake.output gui-build-deps triage-build-ui-deps
|
||||
|
||||
# TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError
|
||||
- name: Self check
|
||||
run: |
|
||||
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5_summary -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings --check-level=exhaustive"
|
||||
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
|
||||
ec=0
|
||||
./cmake.output/bin/cppcheck $selfcheck_options externals/simplecpp || ec=1
|
||||
./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli lib || ec=1
|
||||
./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1
|
||||
./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1
|
||||
./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1
|
||||
exit $ec
|
|
@ -1,61 +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: valgrind
|
||||
|
||||
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: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ runner.os }}
|
||||
|
||||
- name: Install missing software
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libxml2-utils
|
||||
sudo apt-get install valgrind
|
||||
sudo apt-get install libboost-container-dev
|
||||
sudo apt-get install debuginfod
|
||||
|
||||
- name: Build cppcheck
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) HAVE_RULES=yes MATCHCOMPILER=yes
|
||||
|
||||
- name: Build test
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
CXXFLAGS="-O1 -g -w -DHAVE_BOOST" make -j$(nproc) testrunner HAVE_RULES=yes MATCHCOMPILER=yes
|
||||
|
||||
- name: Run valgrind
|
||||
run: |
|
||||
ec=0
|
||||
valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate 9>memcheck.log || ec=1
|
||||
cat memcheck.log
|
||||
exit $ec
|
||||
env:
|
||||
DEBUGINFOD_URLS: https://debuginfod.ubuntu.com
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: Logs
|
||||
path: ./*.log
|
|
@ -2,16 +2,15 @@
|
|||
*.gcno
|
||||
*.o
|
||||
*.pyc
|
||||
/cppcheck
|
||||
/cppcheck.exe
|
||||
cppcheck-core.dll
|
||||
/dmake
|
||||
/dmake.exe
|
||||
cppcheck
|
||||
cppcheck.exe
|
||||
dmake
|
||||
dmake.exe
|
||||
reduce
|
||||
reduce.exe
|
||||
tags
|
||||
/testrunner
|
||||
/testrunner.exe
|
||||
testrunner
|
||||
testrunner.exe
|
||||
tools/daca2*.html
|
||||
tools/dmake
|
||||
tools/errmsg
|
||||
|
@ -20,9 +19,6 @@ tools/extracttests
|
|||
# dump files generated by Cppcheck
|
||||
*.*.dump
|
||||
|
||||
# CTU info files generated by Cppcheck
|
||||
*.*.ctu-info
|
||||
|
||||
# VS generated files
|
||||
*.aps
|
||||
*.idb
|
||||
|
@ -34,17 +30,16 @@ tools/extracttests
|
|||
*.sdf
|
||||
*.suo
|
||||
*.user
|
||||
/.vs/
|
||||
UpgradeLog*.htm
|
||||
.vs/
|
||||
|
||||
# VS build folders
|
||||
bin/
|
||||
Build/
|
||||
BuildTmp/
|
||||
/cli/temp/
|
||||
cli/temp/
|
||||
ipch/
|
||||
/lib/temp/
|
||||
/test/temp/
|
||||
lib/temp/
|
||||
test/temp/
|
||||
|
||||
# XCode build folders and files
|
||||
*.mode[0-9]v[0-9]
|
||||
|
@ -52,33 +47,30 @@ ipch/
|
|||
build/
|
||||
|
||||
# GUI build folders
|
||||
/gui/debug/
|
||||
/gui/release/
|
||||
/gui/temp/
|
||||
/triage/temp
|
||||
gui/debug/
|
||||
gui/release/
|
||||
gui/temp/
|
||||
|
||||
# Other (generated) GUI files
|
||||
/gui/*.qm
|
||||
/gui/cppcheck-gui
|
||||
/gui/cppcheck-gui.exe
|
||||
/gui/gui.sln
|
||||
/gui/gui.vcproj
|
||||
/gui/help/online-help.qch
|
||||
/gui/help/online-help.qhc
|
||||
/gui/Makefile
|
||||
/gui/Makefile.debug
|
||||
/gui/Makefile.release
|
||||
/gui/qrc_gui.cpp
|
||||
/gui/test/Makefile
|
||||
/gui/test/*/Makefile
|
||||
/gui/test/*/*/Makefile
|
||||
/gui/test/benchmark/simple/benchmark-simple
|
||||
/gui/test/cppchecklibrarydata/qrc_resources.cpp
|
||||
/gui/test/cppchecklibrarydata/test-cppchecklibrarydata
|
||||
/gui/test/filelist/test-filelist
|
||||
/gui/test/projectfile/test-projectfile
|
||||
/gui/test/translationhandler/test-translationhandler
|
||||
/gui/test/xmlreportv2/test-xmlreportv2
|
||||
gui/*.qm
|
||||
gui/cppcheck-gui
|
||||
gui/cppcheck-gui.exe
|
||||
gui/gui.sln
|
||||
gui/gui.vcproj
|
||||
gui/Makefile
|
||||
gui/Makefile.debug
|
||||
gui/Makefile.release
|
||||
gui/qrc_gui.cpp
|
||||
gui/test/Makefile
|
||||
gui/test/*/Makefile
|
||||
gui/test/*/*/Makefile
|
||||
gui/test/benchmark/simple/benchmark-simple
|
||||
gui/test/filelist/test-filelist
|
||||
gui/test/projectfile/test-projectfile
|
||||
gui/test/translationhandler/test-translationhandler
|
||||
gui/test/xmlreport/test-xmlreport
|
||||
gui/test/xmlreportv1/test-xmlreportv1
|
||||
gui/test/xmlreportv2/test-xmlreportv2
|
||||
|
||||
# Doxygen output folder
|
||||
doxyoutput/
|
||||
|
@ -95,7 +87,7 @@ htmlreport/MANIFEST
|
|||
*.kdev4
|
||||
|
||||
# Common cmake build directories
|
||||
build**/
|
||||
build*
|
||||
|
||||
# Temporal files
|
||||
*.swp
|
||||
|
@ -106,33 +98,13 @@ prime
|
|||
parts
|
||||
stage
|
||||
*.snap
|
||||
/snap/.snapcraft
|
||||
snap/.snapcraft
|
||||
|
||||
# Manual folder
|
||||
/man/manual.log
|
||||
/man/manual.tex
|
||||
/man/*.pdf
|
||||
/man/*.html
|
||||
man/manual.log
|
||||
man/manual.tex
|
||||
|
||||
# CLion
|
||||
/.idea
|
||||
.idea
|
||||
/.metadata/
|
||||
/cmake-build-*
|
||||
/.run
|
||||
|
||||
# clang tooling temporary files
|
||||
.clangd/
|
||||
.cache/
|
||||
compile_commands.json
|
||||
|
||||
# qmake
|
||||
.qmake.stash
|
||||
|
||||
#vs code
|
||||
/.vscode
|
||||
|
||||
#debian build system
|
||||
/debian
|
||||
|
||||
/release_files
|
||||
*.lha
|
||||
cmake-*
|
||||
|
|
|
@ -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
|
|
@ -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
|
252
.travis.yml
252
.travis.yml
|
@ -7,10 +7,12 @@ compiler:
|
|||
|
||||
env:
|
||||
global:
|
||||
- ORIGINAL_CXXFLAGS="-pedantic -Wall -Wextra -Wcast-qual -Wno-deprecated-declarations -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar -D_GLIBCXX_DEBUG -g"
|
||||
- ORIGINAL_CXXFLAGS="-pedantic -Wall -Wextra -Wcast-qual -Wno-deprecated-declarations -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar -D_GLIBCXX_DEBUG -g "
|
||||
# unfortunately we need this to stay within 50min timelimit given by travis.
|
||||
- CXXFLAGS="${ORIGINAL_CXXFLAGS} -O2 -march=native -Wstrict-aliasing=2 -Werror=strict-aliasing"
|
||||
- CPPCHECK=${TRAVIS_BUILD_DIR}/cppcheck
|
||||
- ASAN_OPTIONS=detect_stack_use_after_return=1
|
||||
- UBSAN_OPTIONS=print_stacktrace=1
|
||||
matrix:
|
||||
- CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL"
|
||||
- CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL" MAKEFLAGS="HAVE_RULES=yes" MATCHCOMPILER=yes VERIFY=1
|
||||
|
@ -18,19 +20,84 @@ env:
|
|||
before_install:
|
||||
# install needed deps
|
||||
- travis_retry sudo apt-get update -qq
|
||||
- travis_retry sudo apt-get install -qq libxml2-utils libpcre3 gdb unzip wx-common xmlstarlet liblua5.3-dev libcurl3 libcairo2-dev libsigc++-2.0-dev tidy libopencv-dev
|
||||
- travis_retry sudo apt-get install -qq python3-pip qt5-default qt5-qmake qtbase5-dev qtcreator 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 pylint
|
||||
- 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 pylint
|
||||
- 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 sudo python3 -m pip install demjson # installs jsonlint => sudo required
|
||||
- travis_retry python3 -m pip install --user natsort
|
||||
- cp externals/z3_version_old.h externals/z3_version.h # because travis z3 version is old
|
||||
|
||||
matrix:
|
||||
# do notify immediately about it when a job of a build fails.
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- name: "rerun dmake?"
|
||||
compiler: clang
|
||||
- name: "make ubuntu 14.04 trusty"
|
||||
# defined extra jobs that run besides what is configured in the build matrix
|
||||
include:
|
||||
# -fsanitize=undefined
|
||||
- name: "undefined behaviour sanitizers"
|
||||
compiler: gcc
|
||||
script:
|
||||
- CXXFLAGS="-fsanitize=undefined -fno-sanitize-recover=all -Og -g3" make cppcheck check checkcfg -j 2 -s
|
||||
# -fsanitize=address
|
||||
- name: "address sanitizers"
|
||||
compiler: gcc
|
||||
script:
|
||||
- CXXFLAGS="-fsanitize=address -Og -g3" make cppcheck check checkcfg -j 2 -s
|
||||
|
||||
# bug hunting
|
||||
- name: "bug hunting"
|
||||
compiler: gcc
|
||||
script:
|
||||
- make clean
|
||||
- make USE_Z3=yes -j2 all
|
||||
- ./testrunner TestExprEngine
|
||||
- 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
|
||||
|
||||
# check a lot of stuff that only needs to be checked in a single configuration
|
||||
- name: "misc"
|
||||
compiler: clang
|
||||
script:
|
||||
- make -j$(nproc) -s
|
||||
- make -j 2 -s
|
||||
# run extra tests
|
||||
- tools/generate_and_run_more_tests.sh
|
||||
# check for missing CWE entries
|
||||
- make checkCWEEntries
|
||||
# check cfg files
|
||||
- make checkcfg
|
||||
# check platform files
|
||||
- make validatePlatforms
|
||||
# Validate Result XML
|
||||
- make validateXML
|
||||
# Validate rule files
|
||||
- make validateRules
|
||||
# check htmlreport stuff
|
||||
- ./htmlreport/test_htmlreport.py
|
||||
- cd htmlreport
|
||||
- ./check.sh
|
||||
- cd ../
|
||||
# check if DESTDIR works TODO: actually execute this
|
||||
- mkdir install_test
|
||||
- echo $CXXFLAGS
|
||||
|
@ -39,5 +106,182 @@ matrix:
|
|||
- git clean -dfx
|
||||
# check what happens if we want to install it to some other dir,
|
||||
- echo $CXXFLAGS
|
||||
- make -s MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck -j$(nproc)
|
||||
- make -s MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck -j 2
|
||||
- sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck install
|
||||
# check if it actually works:
|
||||
- /usr/bin/cppcheck ./cli
|
||||
# check if showtime=top5 works
|
||||
- ./tools/test_showtimetop5.sh
|
||||
# check matchcompiler
|
||||
- python2 tools/test_matchcompiler.py
|
||||
- python3 tools/test_matchcompiler.py
|
||||
# check --dump
|
||||
- ${CPPCHECK} test/testpreprocessor.cpp --dump
|
||||
- xmllint --noout test/testpreprocessor.cpp.dump
|
||||
# check python syntax by compiling all addon scripts
|
||||
- python -m compileall ./addons
|
||||
- python3 -m compileall ./addons
|
||||
# run pylint
|
||||
- pylint --rcfile=pylintrc_travis addons/*.py
|
||||
- pylint --rcfile=pylintrc_travis htmlreport/cppcheck-htmlreport
|
||||
- pylint --rcfile=pylintrc_travis htmlreport/*.py
|
||||
- pylint --rcfile=pylintrc_travis --ignore=donate-cpu-server.py --ignore=donate-cpu.py --ignore=donate_cpu_lib.py --ignore=test-my-pr.py tools/*.py
|
||||
- python3 -m pylint --rcfile=pylintrc_travis addons/*.py
|
||||
- python3 -m pylint --rcfile=pylintrc_travis htmlreport/cppcheck-htmlreport
|
||||
- python3 -m pylint --rcfile=pylintrc_travis htmlreport/*.py
|
||||
- python3 -m pylint --rcfile=pylintrc_travis tools/*.py
|
||||
# check python syntax by compiling some selected scripts
|
||||
- python3 -m py_compile ./tools/donate-cpu.py
|
||||
- python3 -m py_compile ./tools/donate-cpu-server.py
|
||||
# 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 --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.c
|
||||
- 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 ../..
|
||||
# try CMake
|
||||
- mkdir cmake.output
|
||||
- cd cmake.output
|
||||
- cmake -G "Unix Makefiles" -DBUILD_TESTS=On ..
|
||||
- make -s -j2 check
|
||||
- cd ..
|
||||
# -funsigned-char
|
||||
- make clean
|
||||
- make -s -j2 CXXFLAGS=-funsigned-char testrunner
|
||||
- ./testrunner TestSymbolDatabase
|
||||
# check .json files
|
||||
- find . -name '*.json' -not -path '*/\.*' | xargs jsonlint -s
|
||||
# build fuzz client
|
||||
- make -s -j2 CXXFLAGS="-fsanitize=address" -C oss-fuzz fuzz-client
|
||||
|
||||
# check if dmake needs to be rerun (this job may fail)
|
||||
- name: "rerun dmake?"
|
||||
compiler: clang
|
||||
# we don't need to install any deps for dmake so skip it explicitly
|
||||
before_install:
|
||||
- true
|
||||
script:
|
||||
- echo "If the following command fails, run 'make dmake; make run-dmake' and commit the resulting change."
|
||||
- make -s dmake -j2
|
||||
- make -s run-dmake
|
||||
- git diff --exit-code
|
||||
# check if cppcheck builds on trusty
|
||||
- name: "make ubuntu 14.04 trusty"
|
||||
compiler: gcc
|
||||
dist: trusty
|
||||
before_install:
|
||||
- travis_retry sudo apt-get update -qq
|
||||
- travis_retry sudo apt-get install libxml2-utils libpcre3
|
||||
script:
|
||||
- CXX=g++ CXXFLAGS="${ORIGINAL_CXXFLAGS}" make cppcheck check -j 2 -s
|
||||
- make clean
|
||||
- CXX=clang++ CXXFLAGS="${ORIGINAL_CXXFLAGS}" make cppcheck check -j 2 -s
|
||||
# check if cppcheck builds on osx
|
||||
- name: "make osx"
|
||||
os: osx
|
||||
before_install:
|
||||
- true
|
||||
script:
|
||||
- CXX=g++ CXXFLAGS="${ORIGINAL_CXXFLAGS}" make cppcheck check -j 2 -s
|
||||
- make clean
|
||||
- CXX=clang++ CXXFLAGS="${ORIGINAL_CXXFLAGS}" make cppcheck check -j 2 -s
|
||||
|
||||
script:
|
||||
# fail the entire job as soon as one of the subcommands exits non-zero to save time and resources
|
||||
- set -e
|
||||
# Determine CPU count. As of January 2019 it seems to be 2 - so use this for job count in suitable calls to make or cppcheck
|
||||
- cat /proc/cpuinfo
|
||||
# check with TEST_MATHLIB_VALUE enabled
|
||||
- touch lib/mathlib.cpp test/testmathlib.cpp
|
||||
- echo $CXXFLAGS
|
||||
- make -s check -j2 CPPFLAGS=-DTEST_MATHLIB_VALUE
|
||||
- touch lib/mathlib.cpp test/testmathlib.cpp
|
||||
# syntax checking of cppcheck source code with -DNONNEG
|
||||
- ls lib/*.cpp | xargs -n 1 -P 2 g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/simplecpp -Iexternals/tinyxml -DNONNEG
|
||||
# compile cppcheck, default build
|
||||
- echo $CXXFLAGS
|
||||
- make -s check -j2
|
||||
# compile gui
|
||||
- cd gui
|
||||
- qmake
|
||||
- echo $CXXFLAGS
|
||||
- make -s -j2
|
||||
# building gui generates some more files that cppcheck can check, so check the repo *after* building gui
|
||||
- cd ../
|
||||
# self check lib/cli
|
||||
- mkdir b1
|
||||
- ${CPPCHECK} -q -j2 --template=gcc --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/tinyxml/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling cli lib
|
||||
# check gui with qt settings
|
||||
- mkdir b2
|
||||
- ${CPPCHECK} -q -j2 --template=gcc --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/tinyxml/ --enable=style,performance,portability,warning,internal --exception-handling gui/*.cpp
|
||||
# self check test and tools
|
||||
- ${CPPCHECK} -q -j2 --template=gcc -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling test/*.cpp tools
|
||||
# Build gui
|
||||
- cd ./gui
|
||||
# clean rebuild
|
||||
- git clean -dfx .
|
||||
# can't set this as env flags, so try again with HAVE_RULES=yes
|
||||
- qmake HAVE_RULES=yes
|
||||
- echo $CXXFLAGS
|
||||
- make -s -j2
|
||||
- cd ../
|
||||
# Build gui/test
|
||||
- cd gui/test/projectfile
|
||||
- qmake && make -s -j2 && ./test-projectfile
|
||||
- cd -
|
||||
# Build triage
|
||||
- cd ./tools/triage
|
||||
- git clean -dfx .
|
||||
- qmake
|
||||
- make -s -j2
|
||||
- cd ../../
|
||||
# Testing cli
|
||||
- cp -R . ../cppcheck\ 2
|
||||
- cd ../cppcheck\ 2/test/cli # path with space
|
||||
- python -m pytest test-*.py
|
||||
- cd -
|
||||
# Testing addons
|
||||
- python -m pytest addons/test/test-*.py
|
||||
- PYTHONPATH=./addons python3 -m pytest addons/test/test-*.py
|
||||
|
||||
notifications:
|
||||
irc:
|
||||
channels:
|
||||
- "irc.freenode.org#cppcheck"
|
||||
template:
|
||||
- "[%{commit} : %{author}] %{message}"
|
||||
- "%{build_url}"
|
||||
skip_join: true
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
unreadVariable
|
||||
shadowVar
|
||||
shadowFunction
|
||||
unusedStructMember
|
||||
nullPointer
|
||||
uninitvar
|
||||
noExplicitConstructor
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
unusedPrivateFunction:test/testbufferoverrun.cpp
|
||||
unusedPrivateFunction:test/testcmdlineparser.cpp
|
||||
redundantNextPrevious:test/testtoken.cpp
|
||||
simplePatternError:test/testtoken.cpp
|
||||
noValidConfiguration
|
||||
shadowFunction
|
||||
functionConst
|
||||
functionStatic
|
||||
bitwiseOnBoolean
|
||||
hidingInheritedPublic
|
||||
|
||||
# temporary suppressions - fix the warnings!
|
||||
duplicateBranch:lib/checkunusedvar.cpp
|
||||
duplicateBranch:lib/tokenize.cpp
|
||||
missingOverride
|
||||
redundantAssignment:lib/tokenlist.cpp
|
||||
unreachableCode:lib/checkbufferoverrun.cpp
|
||||
unreachableCode:lib/checkclass.cpp
|
||||
unreachableCode:test/testother.cpp
|
||||
unusedPrivateFunction:lib/checkbufferoverrun.h
|
||||
unusedPrivateFunction:test/test*.cpp
|
||||
useStlAlgorithm
|
||||
|
||||
*:gui/test/*
|
||||
*:test/test.cxx
|
||||
*:test/cfg/*
|
||||
*:externals/*/*
|
3128
.uncrustify.cfg
3128
.uncrustify.cfg
File diff suppressed because it is too large
Load Diff
107
AUTHORS
107
AUTHORS
|
@ -1,6 +1,5 @@
|
|||
The cppcheck team, in alphabetical order:
|
||||
|
||||
Abhijit Sawant
|
||||
Abhishek Bharadwaj
|
||||
Abigail Buccaneer
|
||||
Adam J Richter
|
||||
|
@ -12,33 +11,24 @@ Albert Aribaud
|
|||
Aleksandr Pikalev
|
||||
Aleksey Palazhchenko
|
||||
Alexander Alekseev
|
||||
Alexander Festini
|
||||
Alexander Gushchin
|
||||
Alexander Mai
|
||||
Alexander Tkachev
|
||||
Alexandre Chouvellon
|
||||
Alexey Eryomenko
|
||||
Alexey Zhikhartsev
|
||||
Alfi Maulana
|
||||
Ali Can Demiralp
|
||||
Alon Alexander
|
||||
Alon Liberman
|
||||
Ameen Ali
|
||||
Andreas Bacher
|
||||
Andreas Bießmann
|
||||
Andreas Grob
|
||||
Andreas Pokorny
|
||||
Andreas Rönnquist
|
||||
Andreas Vollenweider
|
||||
Andrei Karas
|
||||
Andrew C Aitchison
|
||||
Andrew C. Martin
|
||||
Andrew D. Bancroft
|
||||
Andy Holmes
|
||||
Andy Maloney
|
||||
Aneesh Azhakesan S
|
||||
Ankita Gupta
|
||||
Anton Lindqvist
|
||||
Antti Tuppurainen
|
||||
Anurag Garg
|
||||
Armin Müller
|
||||
|
@ -47,7 +37,6 @@ August Sodora
|
|||
Ayaz Salikhov
|
||||
Balázs Tóth
|
||||
Baris Demiray
|
||||
Bart vdr. Meulen
|
||||
Bartlomiej Grzeskowiak
|
||||
bbennetts
|
||||
Benjamin Bannier
|
||||
|
@ -57,46 +46,34 @@ Benjamin Kramer
|
|||
Benjamin Woester
|
||||
Benjamin Wolsey
|
||||
Ben T
|
||||
Bernd Buschinski
|
||||
Bill Egert
|
||||
Björge Dijkstra
|
||||
Bo Rydberg
|
||||
booga
|
||||
Boris Barbulovski
|
||||
Boris Egorov
|
||||
Boussaffa Walid
|
||||
Bo Rydberg
|
||||
bzgec
|
||||
Carl Michael Grüner Monzón
|
||||
Carl Morgan
|
||||
Carl-Oskar Larsson
|
||||
Carlo Marcelo Arenas Belón
|
||||
Carlos Gomes Martinho
|
||||
Carl-Oskar Larsson
|
||||
Cary R
|
||||
Changkyoon Kim
|
||||
Chris Lalancette
|
||||
Christian Ehrlicher
|
||||
Christian Franke
|
||||
Christoph Grüninger
|
||||
Christoph Schmidt
|
||||
Christoph Strehle
|
||||
Chuck Larson
|
||||
Cilyan Olowen
|
||||
Claus Jensby Madsen
|
||||
Colomban Wendling
|
||||
Conrado Gouvea
|
||||
daisuke-chiba
|
||||
Daniel Friedrich
|
||||
David Korczynski
|
||||
Daniel Marjamäki
|
||||
David Hallas
|
||||
David Korth
|
||||
Dávid Slivka
|
||||
Debrard Sebastien
|
||||
Deepak Gupta
|
||||
dencat
|
||||
Diego de las Heras
|
||||
Dirk Jagdmann
|
||||
Dirk Mueller
|
||||
Dmitriy
|
||||
Dmitry Marakasov
|
||||
Dmitry-Me
|
||||
|
@ -105,133 +82,96 @@ Edoardo Prezioso
|
|||
Eivind Tagseth
|
||||
Elbert Pol
|
||||
Emmanuel Blot
|
||||
Eric Lemanissier
|
||||
Eric Malenfant
|
||||
Eric Sesterhenn
|
||||
Erik Hovland
|
||||
Erik Lax
|
||||
Ettl Martin
|
||||
Even Rouault
|
||||
Evgeny Mandrikov
|
||||
Felipe Pena
|
||||
Felix Geyer
|
||||
Felix Passenberg
|
||||
Felix Wolff
|
||||
Florin Iucha
|
||||
Francesc Elies
|
||||
Frank Zingsheim
|
||||
Frederik Schwarzer
|
||||
fu7mu4
|
||||
Galimov Albert
|
||||
Garrett Bodily
|
||||
Gary Leutheuser
|
||||
gaurav kaushik
|
||||
Gennady Feldman
|
||||
Georgi D. Sotirov
|
||||
Georgy Komarov
|
||||
Gerbo Engels
|
||||
Gerhard Zlabinger
|
||||
Gerik Rhoden
|
||||
Gianfranco Costamagna
|
||||
Gianluca Scacco
|
||||
Gleydson Soares
|
||||
Goran Džaferi
|
||||
Graham Whitted
|
||||
Greg Hewgill
|
||||
Guillaume A.
|
||||
Guillaume Chauvel
|
||||
Guillaume Miossec
|
||||
Gustav Palmqvist
|
||||
Günther Makulik
|
||||
Haowei Hsu
|
||||
Harald Scheidl
|
||||
Heiko Bauke
|
||||
Heiko Eißfeldt
|
||||
Heinrich Schuchardt
|
||||
Henrik Nilsson
|
||||
He Yuqi
|
||||
Hoang Tuan Su
|
||||
Igor Rondarev
|
||||
Igor Zhukov
|
||||
Ivan Maidanski
|
||||
Iván Matellanes
|
||||
Ivan Ryabov
|
||||
Ivar Bonsaksen
|
||||
Jakub Melka
|
||||
Jan Egil Ruud
|
||||
Jan Hellwig
|
||||
János Maros
|
||||
Jay Sigbrandt
|
||||
Jedrzej Klocek
|
||||
Jens Bäckman
|
||||
Jens Yllman
|
||||
Jérémy Lefaure
|
||||
Jes Ramsing
|
||||
Jesse Boswell
|
||||
Jim Kuhn
|
||||
Jim Zhou
|
||||
jlguardi
|
||||
Johan Bertrand
|
||||
Johan Samuelson
|
||||
John Marshall
|
||||
John-Paul Ore
|
||||
John Smits
|
||||
Jonathan Clohessy
|
||||
Jonathan Haehne
|
||||
Jonathan Neuschäfer
|
||||
Jonathan Thackray
|
||||
José Martins
|
||||
Jose Roquette
|
||||
Joshua Beck
|
||||
Joshua Rogers
|
||||
Julian Santander
|
||||
Julien Marrec
|
||||
Julien Peyregne
|
||||
Jure Menart
|
||||
Jussi Lehtola
|
||||
Jørgen Kvalsvik
|
||||
Kamil Dudka
|
||||
Kartik Bajaj
|
||||
keinflue
|
||||
Ken-Patrick Lehrmann
|
||||
Ketil Skjerve
|
||||
Kevin Christian
|
||||
Kevin Kendzia
|
||||
Kimmo Varis
|
||||
Kleber Tarcísio
|
||||
Konrad Grochowski
|
||||
Konrad Windszus
|
||||
Kumar Ashwani
|
||||
Kushal Chandar
|
||||
Kyle Chisholm
|
||||
Lars Even Almaas
|
||||
Kumar Ashwani
|
||||
larudwer
|
||||
Lau bakman
|
||||
Lauri Nurmi
|
||||
Leandro Lisboa Penz
|
||||
Leila F. Rahman
|
||||
Lena Herscheid
|
||||
Leon De Andrade
|
||||
Lieven de Cock
|
||||
lioncash
|
||||
Lionel Gimbert
|
||||
Lucas Manuel Rodriguez
|
||||
Luis Díaz Más
|
||||
Lukas Grützmacher
|
||||
Lukasz Czajczyk
|
||||
Łukasz Jankowski
|
||||
Luxon Jean-Pierre
|
||||
Maksim Derbasov
|
||||
Malcolm Parsons
|
||||
Marc-Antoine Perennou
|
||||
Marcel Raad
|
||||
Marco Trevisan
|
||||
Marek Zmysłowski
|
||||
Marian Klymov
|
||||
Mark de Wever
|
||||
Mark Hermeling
|
||||
Markus Elfring
|
||||
Martin Delille
|
||||
Martin Ettl
|
||||
Martin Exner
|
||||
Martin Güthle
|
||||
|
@ -239,23 +179,19 @@ Martin Herren
|
|||
Márton Csordás
|
||||
Masafumi Koba
|
||||
Massimo Paladin
|
||||
Mateusz Michalak
|
||||
Mateusz Pusz
|
||||
Mathias De Maré
|
||||
Mathias Schmid
|
||||
Matthias Krüger
|
||||
Matthias Kuhn
|
||||
Matthias Schmieder
|
||||
Mathias Schmid
|
||||
Matt Johnson
|
||||
Maurice Gilden
|
||||
Mavik
|
||||
Michael Drake
|
||||
Michael Løiten
|
||||
Miika-Petteri Matikainen
|
||||
Mika Attila
|
||||
Mike Tzou
|
||||
Milhan Kim
|
||||
Mil Tolstoy
|
||||
Milhan Kim
|
||||
Mischa Aster Alff
|
||||
Mohit Mate
|
||||
Monika Lukow
|
||||
|
@ -275,31 +211,20 @@ Oleksandr Redko
|
|||
Oliver Schode
|
||||
Oliver Stöneberg
|
||||
Olivier Croquette
|
||||
Patrick Oppenlander
|
||||
Paul Aitken
|
||||
Paul Bersee
|
||||
Paul Fultz II
|
||||
Pavel Bibergal
|
||||
Pavel Pimenov
|
||||
Pavel Roschin
|
||||
Pavel Skipenes
|
||||
Pavel Šimovec
|
||||
Pavol Misik
|
||||
Pete Johns
|
||||
Peter Pentchev
|
||||
Peter Schops
|
||||
Philipp Kloke
|
||||
Pierre Schweitzer
|
||||
Pino Toscano
|
||||
Pranav Khanna
|
||||
Radek Jarecki
|
||||
Rainer Wiesenfarth
|
||||
Ramzan Bekbulatov
|
||||
Raphael Geissert
|
||||
Razvan Ioan Alexe
|
||||
Reijo Tomperi
|
||||
Rainer Wiesenfarth
|
||||
Riccardo Ghetta
|
||||
Richard A. Smith
|
||||
Richard Quirk
|
||||
Rick van der Sluijs
|
||||
|
@ -311,39 +236,28 @@ Roberto Martelloni
|
|||
Robert Reif
|
||||
rofl0r
|
||||
Roman Zaytsev Borisovich
|
||||
Ronald Hiemstra
|
||||
root
|
||||
Rosen Penev
|
||||
Rudi Danner
|
||||
Rudolf Grauberger
|
||||
Ryan M. Lederman
|
||||
Ryan Pavlik
|
||||
Samir Aguiar
|
||||
Sam Truscott
|
||||
Samuel Degrande
|
||||
Samuel Poláček
|
||||
Sandeep Dutta
|
||||
Savvas Etairidis
|
||||
Scott Furry
|
||||
Sebastian Held
|
||||
Sebastian Matuschka
|
||||
Sébastien Debrard
|
||||
Sergei Chernykh
|
||||
Sergei Trofimovich
|
||||
Sergey Burgsdorf
|
||||
Shane Tapp
|
||||
Shohei YOSHIDA
|
||||
Simon Cornell
|
||||
Simon Kagstrom
|
||||
Simon Large
|
||||
Simon Martin
|
||||
Simon Shanks
|
||||
Slava Semushin
|
||||
Stas Cymbalov
|
||||
Stefan Beller
|
||||
Stefan Hagen
|
||||
Stefan Naewe
|
||||
Stefan van Kessel
|
||||
Stefan Weil
|
||||
Stéphane Michel
|
||||
Steve Browne
|
||||
|
@ -357,43 +271,34 @@ Sylvain Joubert
|
|||
Tam Do Thanh
|
||||
Teddy Didé
|
||||
Thomas Arnhold
|
||||
Tomasz Edward Posluszny
|
||||
Thomas Jarosch
|
||||
Thomas Niederberger
|
||||
Thomas Otto
|
||||
Thomas P. K. Healy
|
||||
Thomas Sondergaard
|
||||
Thorsten Sick
|
||||
Tim Blume
|
||||
Tim Gerundt
|
||||
tititiou36
|
||||
Tobias Weibel
|
||||
Tomasz Kłoczko
|
||||
Tom Pollok
|
||||
Tomo Dote
|
||||
Toralf Förster
|
||||
Troshin V.S.
|
||||
Tyson Nottingham
|
||||
Valentin Batz
|
||||
Valerii Lashmanov
|
||||
Vasily Maslyukov
|
||||
Veli-Matti Visuri
|
||||
WenChung Chiu
|
||||
Vesa Pikki
|
||||
Ville-Pekka Vahteala
|
||||
Ville Skyttä
|
||||
Vincent Le Garrec
|
||||
Wang Haoyu
|
||||
WenChung Chiu
|
||||
Wolfgang Stöggl
|
||||
x29a
|
||||
XhmikosR
|
||||
Xuecheng Zhang
|
||||
Yichen Yan
|
||||
Yurii Putin
|
||||
Zachary Blair
|
||||
Zhao Qifa
|
||||
Zhiyuan Zhang
|
||||
Zhu Lei
|
||||
Дмитрий Старцев
|
||||
|
||||
GUI graphics courtesy of Tango Desktop Project:
|
||||
|
|
|
@ -1,101 +1,37 @@
|
|||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(Cppcheck)
|
||||
|
||||
include(cmake/cxx11.cmake)
|
||||
use_cxx11()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
include(cmake/ccache.cmake)
|
||||
include(cmake/compilerCheck.cmake)
|
||||
include(cmake/versions.cmake)
|
||||
include(cmake/options.cmake)
|
||||
include(cmake/findDependencies.cmake)
|
||||
include(cmake/compileroptions.cmake)
|
||||
include(cmake/compilerDefinitions.cmake)
|
||||
include(cmake/buildFiles.cmake)
|
||||
include(cmake/printInfo.cmake)
|
||||
if(BUILD_GUI)
|
||||
include(cmake/qtCompat.cmake)
|
||||
endif()
|
||||
include(cmake/cxx11.cmake)
|
||||
|
||||
use_cxx11()
|
||||
|
||||
file(GLOB addons "addons/*.py")
|
||||
file(GLOB cfgs "cfg/*.cfg")
|
||||
file(GLOB platforms "platforms/*.xml")
|
||||
|
||||
if(LIBXML2_XMLLINT_EXECUTABLE)
|
||||
add_custom_target(validateCFG DEPENDS validateCFG-cmd)
|
||||
add_custom_command(OUTPUT validateCFG-cmd
|
||||
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng)
|
||||
foreach(cfg ${cfgs})
|
||||
add_custom_command(OUTPUT validateCFG-cmd APPEND
|
||||
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng ${cfg})
|
||||
endforeach()
|
||||
# this is a symbolic name for a build rule and not an output file
|
||||
set_source_files_properties(validateCFG-cmd PROPERTIES SYMBOLIC "true")
|
||||
|
||||
add_custom_target(validatePlatforms ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/platforms/cppcheck-platforms.rng)
|
||||
foreach(platform ${platforms})
|
||||
get_filename_component(platformname ${platform} NAME_WE)
|
||||
add_custom_target(validatePlatforms-${platformname} ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/platforms/cppcheck-platforms.rng ${platform})
|
||||
add_dependencies(validatePlatforms validatePlatforms-${platformname})
|
||||
endforeach()
|
||||
|
||||
add_custom_target(errorlist-xml $<TARGET_FILE:cppcheck> --errorlist > ${CMAKE_BINARY_DIR}/errorlist.xml
|
||||
DEPENDS cppcheck)
|
||||
|
||||
add_custom_target(example-xml $<TARGET_FILE:cppcheck> --xml --enable=all --inconclusive --max-configs=1 ${CMAKE_SOURCE_DIR}/samples 2> ${CMAKE_BINARY_DIR}/example.xml
|
||||
DEPENDS cppcheck)
|
||||
|
||||
add_custom_target(createXMLExamples DEPENDS errorlist-xml example-xml)
|
||||
|
||||
if(PYTHON_EXECUTABLE)
|
||||
add_custom_target(checkCWEEntries ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/listErrorsWithoutCWE.py -F ${CMAKE_BINARY_DIR}/errorlist.xml
|
||||
DEPENDS errorlist-xml)
|
||||
endif()
|
||||
|
||||
add_custom_target(validateXML ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng
|
||||
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng ${CMAKE_BINARY_DIR}/errorlist.xml
|
||||
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cppcheck-errors.rng ${CMAKE_BINARY_DIR}/example.xml
|
||||
DEPENDS createXMLExamples
|
||||
)
|
||||
|
||||
add_custom_target(validateRules ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/rules/*.xml)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTS)
|
||||
if (BUILD_TESTS)
|
||||
enable_testing()
|
||||
endif()
|
||||
|
||||
add_custom_target(copy_cfg ALL
|
||||
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/cfg"
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/cfg"
|
||||
COMMENT "Copying cfg files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
|
||||
|
||||
add_custom_target(copy_addons ALL
|
||||
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/addons"
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/addons"
|
||||
COMMENT "Copying addons files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
|
||||
|
||||
add_custom_target(copy_platforms ALL
|
||||
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/platforms"
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/platforms"
|
||||
COMMENT "Copying platforms files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}")
|
||||
|
||||
if(USE_BUNDLED_TINYXML2)
|
||||
message(STATUS "Using bundled version of tinyxml2")
|
||||
add_subdirectory(externals/tinyxml2)
|
||||
endif()
|
||||
add_subdirectory(externals/tinyxml)
|
||||
add_subdirectory(externals/simplecpp)
|
||||
add_subdirectory(lib) # CppCheck Library
|
||||
add_subdirectory(lib) # CppCheck Library
|
||||
add_subdirectory(cli) # Client application
|
||||
add_subdirectory(test) # Tests
|
||||
add_subdirectory(gui) # Graphical application
|
||||
add_subdirectory(tools/triage) # Triage tool
|
||||
add_subdirectory(oss-fuzz) # OSS-Fuzz clients
|
||||
add_subdirectory(tools)
|
||||
add_subdirectory(man)
|
||||
|
||||
include(cmake/printInfo.cmake)
|
||||
include(cmake/clang_tidy.cmake)
|
||||
|
|
918
Makefile.os4
918
Makefile.os4
|
@ -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
|
|
@ -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
|
||||
|
|
@ -4,62 +4,35 @@ Addons are scripts that analyses Cppcheck dump files to check compatibility with
|
|||
|
||||
## Supported addons
|
||||
|
||||
+ [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/).
|
||||
+ [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).
|
||||
+ [threadsafety.py](https://github.com/danmar/cppcheck/blob/main/addons/threadsafety.py)
|
||||
+ [cert.py](https://github.com/danmar/cppcheck/blob/master/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/master/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/master/addons/test/misra/).
|
||||
+ [y2038.py](https://github.com/danmar/cppcheck/blob/master/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/master/addons/doc/y2038.txt).
|
||||
+ [threadsafety.py](https://github.com/danmar/cppcheck/blob/master/addons/threadsafety.py)
|
||||
Analyse Cppcheck dump files to locate threadsafety issues like static local objects used by multiple threads.
|
||||
+ [naming.py](https://github.com/danmar/cppcheck/blob/main/addons/naming.py)
|
||||
Enforces naming conventions across the code.
|
||||
+ [namingng.py](https://github.com/danmar/cppcheck/blob/main/addons/namingng.py)
|
||||
Enforces naming conventions across the code. Enhanced version with support for type prefixes in variable and function names.
|
||||
+ [findcasts.py](https://github.com/danmar/cppcheck/blob/main/addons/findcasts.py)
|
||||
Locates casts in the code.
|
||||
+ [misc.py](https://github.com/danmar/cppcheck/blob/main/addons/misc.py)
|
||||
Performs miscellaneous checks.
|
||||
|
||||
### Other files
|
||||
|
||||
- doc
|
||||
Additional files for documentation generation.
|
||||
- tests
|
||||
Contains various unit tests for the addons.
|
||||
- cppcheck.py
|
||||
Internal helper used by Cppcheck binary to run the addons.
|
||||
- cppcheckdata.doxyfile
|
||||
Configuration file for documentation generation.
|
||||
- cppcheckdata.py
|
||||
Helper class for reading Cppcheck dump files within an addon.
|
||||
- misra_9.py
|
||||
Implementation of the MISRA 9.x rules used by `misra` addon.
|
||||
- naming.json
|
||||
Example configuration for `namingng` addon.
|
||||
- ROS_naming.json
|
||||
Example configuration for the `namingng` addon enforcing the [ROS naming convention for C++ ](http://wiki.ros.org/CppStyleGuide#Files).
|
||||
- runaddon.py
|
||||
Internal helper used by Cppcheck binary to run the addons.
|
||||
|
||||
## Usage
|
||||
|
||||
### Command line interface
|
||||
|
||||
```bash
|
||||
cppcheck --addon=misc src/test.c
|
||||
cppcheck --addon=cert --addon=y2038 src/test.c
|
||||
```
|
||||
|
||||
It is also possible to call scripts as follows:
|
||||
```bash
|
||||
cppcheck --dump --quiet src/test.c
|
||||
python misc.py src/test.c.dump
|
||||
python misra.py --rule-texts=~/misra_rules.txt src/test.c.dump
|
||||
python cert.py src/test.c.dump
|
||||
python misra.py --rules-texts=~/misra_rules.txt src/test.c.dump
|
||||
```
|
||||
|
||||
This allows you to add additional parameters when calling the script (for example, `--rule-texts` for `misra.py`). The full list of available parameters can be found by calling any script with the `--help` flag.
|
||||
This allows you to add additional parameters when calling the script (for example, `--rule-tests` for `misra.py`). The full list of available parameters can be found by calling any script with the `--help` flag.
|
||||
|
||||
### GUI
|
||||
|
||||
When using the graphical interface `cppcheck-gui`, the selection and configuration of addons is carried out on the tab `Addons and tools` in the project settings (`Edit Project File`):
|
||||
|
||||
![Screenshot](https://raw.githubusercontent.com/danmar/cppcheck/main/addons/doc/img/cppcheck-gui-addons.png)
|
||||
![Screenshot](https://raw.githubusercontent.com/danmar/cppcheck/master/addons/doc/img/cppcheck-gui-addons.png)
|
||||
|
||||
|
|
|
@ -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):
|
||||
for p in pattern.split(' '):
|
||||
if not token or token.str != p:
|
||||
return False
|
||||
token = token.next
|
||||
return True
|
||||
|
||||
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 = cppcheckdata.ArgumentParser()
|
||||
parser.add_argument("-verify", help=argparse.SUPPRESS, action="store_true")
|
||||
return parser.parse_args()
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = get_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)
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
import cppcheckdata, sys, os
|
||||
|
||||
__checkers__ = []
|
||||
|
||||
def checker(f):
|
||||
__checkers__.append(f)
|
||||
return f
|
||||
|
||||
|
||||
__errorid__ = ''
|
||||
__addon_name__ = ''
|
||||
def reportError(location, severity, message, errorId=None):
|
||||
cppcheckdata.reportError(location, severity, message, __addon_name__, errorId or __errorid__)
|
||||
|
||||
def runcheckers():
|
||||
# If there are no checkers then don't run
|
||||
if len(__checkers__) == 0:
|
||||
return
|
||||
global __addon_name__
|
||||
global __errorid__
|
||||
addon = sys.argv[0]
|
||||
parser = cppcheckdata.ArgumentParser()
|
||||
args = parser.parse_args()
|
||||
|
||||
__addon_name__ = os.path.splitext(os.path.basename(addon))[0]
|
||||
|
||||
for dumpfile in args.dumpfile:
|
||||
if not args.quiet:
|
||||
print('Checking %s...' % dumpfile)
|
||||
|
||||
data = cppcheckdata.CppcheckData(dumpfile)
|
||||
|
||||
for cfg in data.iterconfigurations():
|
||||
if not args.quiet:
|
||||
print('Checking %s, config %s...' % (dumpfile, cfg.name))
|
||||
for c in __checkers__:
|
||||
__errorid__ = c.__name__
|
||||
c(cfg, data)
|
File diff suppressed because it is too large
Load Diff
|
@ -3,30 +3,38 @@
|
|||
# Locate casts in the code
|
||||
#
|
||||
|
||||
import cppcheck
|
||||
import cppcheckdata
|
||||
import sys
|
||||
|
||||
@cppcheck.checker
|
||||
def cast(cfg, data):
|
||||
for token in cfg.tokenlist:
|
||||
if token.str != '(' or not token.astOperand1 or token.astOperand2:
|
||||
continue
|
||||
for arg in sys.argv[1:]:
|
||||
if arg.startswith('-'):
|
||||
continue
|
||||
|
||||
# Is it a lambda?
|
||||
if token.astOperand1.str == '{':
|
||||
continue
|
||||
print('Checking %s...' % arg)
|
||||
data = cppcheckdata.CppcheckData(arg)
|
||||
|
||||
# we probably have a cast.. if there is something inside the parentheses
|
||||
# there is a cast. Otherwise this is a function call.
|
||||
typetok = token.next
|
||||
if not typetok.isName:
|
||||
continue
|
||||
for cfg in data.iterconfigurations():
|
||||
print('Checking %s, config %s...' % (arg, cfg.name))
|
||||
for token in cfg.tokenlist:
|
||||
if token.str != '(' or not token.astOperand1 or token.astOperand2:
|
||||
continue
|
||||
|
||||
# cast number => skip output
|
||||
if token.astOperand1.isNumber:
|
||||
continue
|
||||
# Is it a lambda?
|
||||
if token.astOperand1.str == '{':
|
||||
continue
|
||||
|
||||
# void cast => often used to suppress compiler warnings
|
||||
if typetok.str == 'void':
|
||||
continue
|
||||
# we probably have a cast.. if there is something inside the parentheses
|
||||
# there is a cast. Otherwise this is a function call.
|
||||
typetok = token.next
|
||||
if not typetok.isName:
|
||||
continue
|
||||
|
||||
cppcheck.reportError(token, 'information', 'found a cast')
|
||||
# cast number => skip output
|
||||
if token.astOperand1.isNumber:
|
||||
continue
|
||||
|
||||
# void cast => often used to suppress compiler warnings
|
||||
if typetok.str == 'void':
|
||||
continue
|
||||
|
||||
cppcheckdata.reportError(token, 'information', 'found a cast', 'findcasts', 'cast')
|
||||
|
|
|
@ -24,7 +24,11 @@ def reportError(token, severity, msg, id):
|
|||
cppcheckdata.reportError(token, severity, msg, 'misc', id)
|
||||
|
||||
def simpleMatch(token, pattern):
|
||||
return cppcheckdata.simpleMatch(token, pattern)
|
||||
for p in pattern.split(' '):
|
||||
if not token or token.str != p:
|
||||
return False
|
||||
token = token.next
|
||||
return True
|
||||
|
||||
# Get function arguments
|
||||
def getArgumentsRecursive(tok, arguments):
|
||||
|
@ -159,5 +163,3 @@ for arg in sys.argv[1:]:
|
|||
if actual not in VERIFY_EXPECTED:
|
||||
print('Not expected: ' + actual)
|
||||
sys.exit(1)
|
||||
|
||||
sys.exit(cppcheckdata.EXIT_CODE)
|
||||
|
|
2498
addons/misra.py
2498
addons/misra.py
File diff suppressed because it is too large
Load Diff
|
@ -1,561 +0,0 @@
|
|||
import cppcheckdata
|
||||
|
||||
# Holds information about an array, struct or union's element definition.
|
||||
class ElementDef:
|
||||
def __init__(self, elementType, name, valueType, dimensions = None):
|
||||
self.elementType = elementType # 'array', 'record' or 'value'
|
||||
self.name = str(name)
|
||||
self.valueType = valueType
|
||||
self.children = []
|
||||
self.dimensions = dimensions
|
||||
self.parent = None
|
||||
|
||||
self.isDesignated = False
|
||||
self.isPositional = False
|
||||
self.numInits = 0
|
||||
self.childIndex = -1
|
||||
|
||||
self.flexibleToken = None
|
||||
self.isFlexible = False
|
||||
self.structureViolationToken = None
|
||||
|
||||
def __repr__(self):
|
||||
inits = ""
|
||||
if self.isPositional:
|
||||
inits += 'P'
|
||||
if self.isDesignated:
|
||||
inits += 'D'
|
||||
if not (self.isPositional or self.isDesignated) and self.numInits == 0:
|
||||
inits += '_'
|
||||
if self.numInits > 1:
|
||||
inits += str(self.numInits)
|
||||
|
||||
attrs = ["childIndex", "elementType", "valueType"]
|
||||
return "{}({}, {}, {})".format(
|
||||
"ElementDef",
|
||||
self.getLongName(),
|
||||
inits,
|
||||
", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
|
||||
)
|
||||
|
||||
@property
|
||||
def isArray(self):
|
||||
return self.elementType == 'array'
|
||||
|
||||
@property
|
||||
def isRecord(self):
|
||||
return self.elementType == 'record'
|
||||
|
||||
@property
|
||||
def isValue(self):
|
||||
return self.elementType == 'value'
|
||||
|
||||
|
||||
def getLongName(self):
|
||||
return self.parent.getLongName() + "." + self.name if self.parent else self.name
|
||||
|
||||
def getInitDump(self):
|
||||
t = []
|
||||
if self.isPositional:
|
||||
t.append('P')
|
||||
if self.isDesignated:
|
||||
t.append('D')
|
||||
if self.numInits == 0:
|
||||
t.append('_')
|
||||
if self.numInits > 1:
|
||||
t.append(str(self.numInits))
|
||||
|
||||
myDump = "".join(t)
|
||||
|
||||
if len(self.children):
|
||||
childDumps = []
|
||||
for c in self.children:
|
||||
childDumps.append(c.getInitDump())
|
||||
if self.structureViolationToken is not None:
|
||||
myDump += "!"
|
||||
myDump += "{ " + ", ".join(childDumps) + " }"
|
||||
|
||||
return myDump
|
||||
|
||||
def addChild(self, child):
|
||||
self.children.append(child)
|
||||
child.parent = self
|
||||
|
||||
def getNextChild(self):
|
||||
self.childIndex += 1
|
||||
return self.getChildByIndex(self.childIndex)
|
||||
|
||||
def getChildByIndex(self, index):
|
||||
if self.isFlexible:
|
||||
while len(self.children) <= index:
|
||||
createChild(self, self.flexibleToken, len(self.children), None)
|
||||
return self.children[index] if 0 <= index < len(self.children) else None
|
||||
|
||||
def getChildByName(self, name):
|
||||
for c in self.children:
|
||||
if c.name == name:
|
||||
return c
|
||||
return None
|
||||
|
||||
def getNextValueElement(self, root):
|
||||
current = self
|
||||
while current != root:
|
||||
if not current.parent:
|
||||
return None
|
||||
# Get next index of parent
|
||||
i = current.parent.children.index(current) + 1
|
||||
# Next index of parent exists
|
||||
if i < len(current.parent.children):
|
||||
current = current.parent.children[i]
|
||||
return current.getFirstValueElement()
|
||||
|
||||
# Next index of parent doesn't exist. Move up
|
||||
current = current.parent
|
||||
return None
|
||||
|
||||
def getFirstValueElement(self):
|
||||
current = self
|
||||
|
||||
# Move to first child as long as children exists
|
||||
next_child = current.getChildByIndex(0)
|
||||
while next_child:
|
||||
current = next_child
|
||||
next_child = current.getChildByIndex(0)
|
||||
return current
|
||||
|
||||
def getLastValueElement(self):
|
||||
current = self
|
||||
# Move to last child as long as children exists
|
||||
while len(current.children) > 0:
|
||||
current = current.children[-1]
|
||||
return current
|
||||
|
||||
def getChildByValueElement(self, ed):
|
||||
potentialChild = ed
|
||||
while potentialChild and potentialChild not in self.children:
|
||||
potentialChild = potentialChild.parent
|
||||
|
||||
return self.children[self.children.index(potentialChild)] if potentialChild else None
|
||||
|
||||
def getEffectiveLevel(self):
|
||||
if self.parent and self.parent.elementType == "array":
|
||||
return self.parent.getEffectiveLevel() + 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def setInitialized(self, designated=False, positional=False):
|
||||
if designated:
|
||||
self.isDesignated = True
|
||||
if positional or not designated:
|
||||
self.isPositional = True
|
||||
self.numInits += 1
|
||||
|
||||
def initializeChildren(self):
|
||||
for child in self.children:
|
||||
child.setInitialized(positional=True)
|
||||
child.initializeChildren()
|
||||
|
||||
def unset(self):
|
||||
self.isDesignated = False
|
||||
self.isPositional = False
|
||||
|
||||
# Unset is always recursive
|
||||
for child in self.children:
|
||||
child.unset()
|
||||
|
||||
def markStuctureViolation(self, token):
|
||||
if self.name == '->':
|
||||
self.children[0].markStuctureViolation(token)
|
||||
elif not self.structureViolationToken:
|
||||
self.structureViolationToken = token
|
||||
|
||||
def markAsFlexibleArray(self, token):
|
||||
self.flexibleToken = token
|
||||
self.isFlexible = True
|
||||
|
||||
def markAsCurrent(self):
|
||||
if self.parent:
|
||||
if self.name == '<-':
|
||||
self.parent.childIndex = self.parent.children.index(self.children[0])
|
||||
else:
|
||||
self.parent.childIndex = self.parent.children.index(self)
|
||||
|
||||
self.parent.markAsCurrent()
|
||||
|
||||
def isAllChildrenSet(self):
|
||||
myself = len(self.children) == 0 and (self.isDesignated or self.isPositional)
|
||||
mychildren = len(self.children) > 0 and all([child.isAllChildrenSet() for child in self.children])
|
||||
return myself or mychildren
|
||||
|
||||
def isAllSet(self):
|
||||
return all([child.isPositional or child.isDesignated for child in self.children])
|
||||
|
||||
def isOnlyDesignated(self):
|
||||
return all([not child.isPositional for child in self.children])
|
||||
|
||||
def isMisra92Compliant(self):
|
||||
return self.structureViolationToken is None and all([child.isMisra92Compliant() for child in self.children])
|
||||
|
||||
def isMisra93Compliant(self):
|
||||
if self.elementType == 'array':
|
||||
result = self.isAllChildrenSet() or \
|
||||
((self.isAllSet() or
|
||||
self.isOnlyDesignated()) and
|
||||
all([not (child.isDesignated or child.isPositional) or child.isMisra93Compliant() for child in self.children]))
|
||||
return result
|
||||
elif self.elementType == 'record':
|
||||
result = all([child.isMisra93Compliant() for child in self.children])
|
||||
return result
|
||||
else:
|
||||
return True
|
||||
|
||||
def isMisra94Compliant(self):
|
||||
return self.numInits <= 1 and all([child.isMisra94Compliant() for child in self.children])
|
||||
|
||||
def isMisra95Compliant(self):
|
||||
return not self.isFlexible or all([not child.isDesignated for child in self.children])
|
||||
|
||||
# Parses the initializers and update the ElementDefs status accordingly
|
||||
class InitializerParser:
|
||||
def __init__(self):
|
||||
self.token = None
|
||||
self.root = None
|
||||
self.ed = None
|
||||
self.rootStack = []
|
||||
|
||||
def parseInitializer(self, root, token):
|
||||
self.root = root
|
||||
self.token = token
|
||||
dummyRoot = ElementDef('array', '->', self.root.valueType)
|
||||
dummyRoot.children = [self.root]
|
||||
|
||||
self.rootStack = []
|
||||
self.root = dummyRoot
|
||||
self.ed = self.root.getFirstValueElement()
|
||||
isFirstElement = False
|
||||
isDesignated = False
|
||||
|
||||
while self.token:
|
||||
if self.token.str == ',':
|
||||
self.token = self.token.astOperand1
|
||||
isFirstElement = False
|
||||
|
||||
# Designated initializer ( [2]=... or .name=... )
|
||||
elif self.token.isAssignmentOp and not self.token.valueType:
|
||||
self.popFromStackIfExitElement()
|
||||
|
||||
self.ed = getElementByDesignator(self.root, self.token.astOperand1)
|
||||
if self.ed:
|
||||
# Update root
|
||||
self.pushToRootStackAndMarkAsDesignated()
|
||||
# Make sure ed points to valueElement
|
||||
self.ed = self.ed.getFirstValueElement()
|
||||
|
||||
self.token = self.token.astOperand2
|
||||
isFirstElement = False
|
||||
isDesignated = True
|
||||
|
||||
elif self.token.isString and self.ed and self.ed.isArray:
|
||||
self.ed.setInitialized(isDesignated)
|
||||
if self.token == self.token.astParent.astOperand1 and self.token.astParent.astOperand2:
|
||||
self.token = self.token.astParent.astOperand2
|
||||
self.ed.markAsCurrent()
|
||||
self.ed = self.root.getNextChild()
|
||||
else:
|
||||
self.unwindAndContinue()
|
||||
continue
|
||||
|
||||
elif self.token.str == '{':
|
||||
nextChild = self.root.getNextChild() if self.root is not None else None
|
||||
|
||||
if nextChild:
|
||||
if nextChild.isArray or nextChild.isRecord:
|
||||
nextChild.unset()
|
||||
nextChild.setInitialized(isDesignated)
|
||||
self.ed = nextChild.getFirstValueElement()
|
||||
isDesignated = False
|
||||
elif nextChild.valueType is None:
|
||||
# No type information available - unable to check structure - assume correct initialization
|
||||
nextChild.setInitialized(isDesignated)
|
||||
self.unwindAndContinue()
|
||||
continue
|
||||
|
||||
elif self.token.astOperand1:
|
||||
# Create dummy nextChild to represent excess levels in initializer
|
||||
dummyRoot = ElementDef('array', '<-', self.root.valueType)
|
||||
dummyRoot.parent = self.root
|
||||
dummyRoot.childIndex = 0
|
||||
dummyRoot.children = [nextChild]
|
||||
nextChild.parent = dummyRoot
|
||||
|
||||
self.root.markStuctureViolation(self.token)
|
||||
|
||||
# Fake dummy as nextChild (of current root)
|
||||
nextChild = dummyRoot
|
||||
|
||||
if nextChild and self.token.astOperand1:
|
||||
self.root = nextChild
|
||||
self.token = self.token.astOperand1
|
||||
isFirstElement = True
|
||||
else:
|
||||
if self.root:
|
||||
# {}
|
||||
if self.root.name == '<-':
|
||||
self.root.parent.markStuctureViolation(self.token)
|
||||
else:
|
||||
self.root.markStuctureViolation(self.token)
|
||||
self.ed = None
|
||||
self.unwindAndContinue()
|
||||
|
||||
else:
|
||||
if self.ed and self.ed.isValue:
|
||||
if not isDesignated and len(self.rootStack) > 0 and self.rootStack[-1][1] == self.root:
|
||||
self.rootStack[-1][0].markStuctureViolation(self.token)
|
||||
|
||||
if isFirstElement and self.token.str == '0' and self.token.next.str == '}':
|
||||
# Zero initializer causes recursive initialization
|
||||
self.root.initializeChildren()
|
||||
elif self.token.isString and self.ed.valueType and self.ed.valueType.pointer > 0:
|
||||
if self.ed.valueType.pointer - self.ed.getEffectiveLevel() == 1:
|
||||
if self.ed.parent != self.root:
|
||||
self.root.markStuctureViolation(self.token)
|
||||
self.ed.setInitialized(isDesignated)
|
||||
elif self.ed.valueType.pointer == self.ed.getEffectiveLevel():
|
||||
if(self.root.name != '->' and self.ed.parent.parent != self.root) or (self.root.name == '->' and self.root.children[0] != self.ed.parent):
|
||||
self.root.markStuctureViolation(self.token)
|
||||
else:
|
||||
self.ed.parent.setInitialized(isDesignated)
|
||||
self.ed.parent.initializeChildren()
|
||||
|
||||
else:
|
||||
if self.root is not None and self.ed.parent != self.root:
|
||||
# Check if token is correct value type for self.root.children[?]
|
||||
child = self.root.getChildByValueElement(self.ed)
|
||||
if self.token.valueType:
|
||||
if child.elementType != 'record' or self.token.valueType.type != 'record' or child.valueType.typeScope != self.token.valueType.typeScope:
|
||||
self.root.markStuctureViolation(self.token)
|
||||
|
||||
self.ed.setInitialized(isDesignated)
|
||||
|
||||
# Mark all elements up to root with positional or designated
|
||||
# (for complex designators, or missing structure)
|
||||
parent = self.ed.parent
|
||||
while parent and parent != self.root:
|
||||
parent.isDesignated = isDesignated if isDesignated and not parent.isPositional else parent.isDesignated
|
||||
parent.isPositional = not isDesignated if not isDesignated and not parent.isDesignated else parent.isPositional
|
||||
parent = parent.parent
|
||||
isDesignated = False
|
||||
|
||||
if self.token.isString and self.ed.parent.isArray:
|
||||
self.ed = self.ed.parent
|
||||
self.unwindAndContinue()
|
||||
|
||||
def pushToRootStackAndMarkAsDesignated(self):
|
||||
new = self.ed.parent
|
||||
if new != self.root:
|
||||
# Mark all elements up to self.root root as designated
|
||||
parent = new
|
||||
while parent and parent != self.root:
|
||||
parent.isDesignated = True
|
||||
parent = parent.parent
|
||||
self.rootStack.append((self.root, new))
|
||||
new.markAsCurrent()
|
||||
new.childIndex = new.children.index(self.ed) - 1
|
||||
self.root = new
|
||||
|
||||
def popFromStackIfExitElement(self):
|
||||
if len(self.rootStack) > 0 and self.rootStack[-1][1] == self.root:
|
||||
old = self.rootStack.pop()[0]
|
||||
old.markAsCurrent()
|
||||
self.root = old
|
||||
|
||||
def unwindAndContinue(self):
|
||||
while self.token:
|
||||
if self.token.astParent.astOperand1 == self.token and self.token.astParent.astOperand2:
|
||||
if self.ed:
|
||||
self.ed.markAsCurrent()
|
||||
self.ed = self.ed.getNextValueElement(self.root)
|
||||
|
||||
self.token = self.token.astParent.astOperand2
|
||||
break
|
||||
else:
|
||||
self.token = self.token.astParent
|
||||
if self.token.str == '{':
|
||||
if self.root:
|
||||
self.ed = self.root.getLastValueElement()
|
||||
self.ed.markAsCurrent()
|
||||
|
||||
# Cleanup if root is dummy node representing excess levels in initializer
|
||||
if self.root.name == '<-':
|
||||
self.root.children[0].parent = self.root.parent
|
||||
|
||||
self.root = self.root.parent
|
||||
|
||||
if self.token.astParent is None:
|
||||
self.token = None
|
||||
break
|
||||
|
||||
def misra_9_x(self, data, rule, rawTokens = None):
|
||||
|
||||
parser = InitializerParser()
|
||||
|
||||
for variable in data.variables:
|
||||
if variable.nameToken is None:
|
||||
continue
|
||||
|
||||
nameToken = variable.nameToken
|
||||
|
||||
# Check if declaration and initialization is
|
||||
# split into two separate statements in ast.
|
||||
if nameToken.next and nameToken.next.isSplittedVarDeclEq:
|
||||
nameToken = nameToken.next.next
|
||||
|
||||
# Find declarations with initializer assignment
|
||||
eq = nameToken
|
||||
while not eq.isAssignmentOp and eq.astParent:
|
||||
eq = eq.astParent
|
||||
|
||||
# We are only looking for initializers
|
||||
if not eq.isAssignmentOp or eq.astOperand2.isName:
|
||||
continue
|
||||
|
||||
if variable.isArray or variable.isClass:
|
||||
ed = getElementDef(nameToken, rawTokens)
|
||||
# No need to check non-arrays if valueType is missing,
|
||||
# since we can't say anything useful about the structure
|
||||
# without it.
|
||||
if ed.valueType is None and not variable.isArray:
|
||||
continue
|
||||
parser.parseInitializer(ed, eq.astOperand2)
|
||||
# print(rule, nameToken.str + '=', ed.getInitDump())
|
||||
if rule == 902 and not ed.isMisra92Compliant():
|
||||
self.reportError(nameToken, 9, 2)
|
||||
if rule == 903 and not ed.isMisra93Compliant():
|
||||
# Do not check when variable is pointer type
|
||||
type_token = variable.nameToken
|
||||
while type_token and type_token.isName:
|
||||
type_token = type_token.previous
|
||||
if type_token and type_token.str == '*':
|
||||
continue
|
||||
|
||||
self.reportError(nameToken, 9, 3)
|
||||
if rule == 904 and not ed.isMisra94Compliant():
|
||||
self.reportError(nameToken, 9, 4)
|
||||
if rule == 905 and not ed.isMisra95Compliant():
|
||||
self.reportError(nameToken, 9, 5)
|
||||
|
||||
def getElementDef(nameToken, rawTokens = None):
|
||||
if nameToken.variable.isArray:
|
||||
ed = ElementDef("array", nameToken.str, nameToken.valueType)
|
||||
createArrayChildrenDefs(ed, nameToken.astParent, nameToken.variable, rawTokens)
|
||||
elif nameToken.variable.isClass:
|
||||
ed = ElementDef("record", nameToken.str, nameToken.valueType)
|
||||
createRecordChildrenDefs(ed, nameToken.variable)
|
||||
else:
|
||||
ed = ElementDef("value", nameToken.str, nameToken.valueType)
|
||||
return ed
|
||||
|
||||
def createArrayChildrenDefs(ed, token, var, rawTokens = None):
|
||||
if token and token.str == '[':
|
||||
if rawTokens is not None:
|
||||
foundToken = next((rawToken for rawToken in rawTokens
|
||||
if rawToken.file == token.file
|
||||
and rawToken.linenr == token.linenr
|
||||
and rawToken.column == token.column
|
||||
), None)
|
||||
|
||||
if foundToken and foundToken.next and foundToken.next.str == ']':
|
||||
ed.markAsFlexibleArray(token)
|
||||
|
||||
if (token.astOperand2 is not None) and (token.astOperand2.getKnownIntValue() is not None):
|
||||
for i in range(token.astOperand2.getKnownIntValue()):
|
||||
createChild(ed, token, i, var)
|
||||
else:
|
||||
ed.markAsFlexibleArray(token)
|
||||
|
||||
|
||||
def createChild(ed, token, name, var):
|
||||
if token.astParent and token.astParent.str == '[':
|
||||
child = ElementDef("array", name, ed.valueType)
|
||||
createArrayChildrenDefs(child, token.astParent, var)
|
||||
else:
|
||||
if ed.valueType and ed.valueType.type == "record":
|
||||
child = ElementDef("record", name, ed.valueType)
|
||||
createRecordChildrenDefs(child, var)
|
||||
else:
|
||||
child = ElementDef("value", name, ed.valueType)
|
||||
|
||||
ed.addChild(child)
|
||||
|
||||
def createRecordChildrenDefs(ed, var):
|
||||
valueType = ed.valueType
|
||||
if not valueType or not valueType.typeScope:
|
||||
return
|
||||
if var is None:
|
||||
return
|
||||
typeToken = var.typeEndToken
|
||||
while typeToken and typeToken.isName:
|
||||
typeToken = typeToken.previous
|
||||
if typeToken and typeToken.str == '*':
|
||||
child = ElementDef("pointer", var.nameToken, var.nameToken.valueType)
|
||||
ed.addChild(child)
|
||||
return
|
||||
child_dict = {}
|
||||
for variable in valueType.typeScope.varlist:
|
||||
if variable is var:
|
||||
continue
|
||||
child = getElementDef(variable.nameToken)
|
||||
child_dict[variable.nameToken] = child
|
||||
for scopes in valueType.typeScope.nestedList:
|
||||
varscope = False
|
||||
if scopes.nestedIn == valueType.typeScope:
|
||||
for variable in valueType.typeScope.varlist:
|
||||
if variable.nameToken and variable.nameToken.valueType and variable.nameToken.valueType.typeScope == scopes:
|
||||
varscope = True
|
||||
break
|
||||
if not varscope:
|
||||
ed1 = ElementDef("record", scopes.Id, valueType)
|
||||
for variable in scopes.varlist:
|
||||
child = getElementDef(variable.nameToken)
|
||||
ed1.addChild(child)
|
||||
child_dict[scopes.bodyStart] = ed1
|
||||
sorted_keys = sorted(list(child_dict.keys()), key=lambda k: "%s %s %s" % (k.file, k.linenr, k.column))
|
||||
for _key in sorted_keys:
|
||||
ed.addChild(child_dict[_key])
|
||||
|
||||
|
||||
def getElementByDesignator(ed, token):
|
||||
if not token.str in [ '.', '[' ]:
|
||||
return None
|
||||
|
||||
while token.str in [ '.', '[' ]:
|
||||
token = token.astOperand1
|
||||
|
||||
while ed and not token.isAssignmentOp:
|
||||
token = token.astParent
|
||||
|
||||
if token.str == '[':
|
||||
if not ed.isArray:
|
||||
ed.markStuctureViolation(token)
|
||||
|
||||
chIndex = -1
|
||||
if token.astOperand2 is not None:
|
||||
chIndex = token.astOperand2.getKnownIntValue()
|
||||
elif token.astOperand1 is not None:
|
||||
chIndex = token.astOperand1.getKnownIntValue()
|
||||
|
||||
ed = ed.getChildByIndex(chIndex) if chIndex is not None else None
|
||||
|
||||
elif token.str == '.':
|
||||
if not ed.isRecord:
|
||||
ed.markStuctureViolation(token)
|
||||
|
||||
name = ""
|
||||
if token.astOperand2 is not None:
|
||||
name = token.astOperand2.str
|
||||
elif token.astOperand1 is not None:
|
||||
name = token.astOperand1.str
|
||||
|
||||
ed = ed.getChildByName(name)
|
||||
|
||||
return ed
|
|
@ -81,11 +81,9 @@ for arg in sys.argv[1:]:
|
|||
for scope in cfg.scopes:
|
||||
if scope.type == 'Function':
|
||||
function = scope.function
|
||||
if function is not None and function.type in ('Constructor', 'Destructor', 'CopyConstructor', 'MoveConstructor'):
|
||||
if function is not None and function.type in ('Constructor', 'Destructor'):
|
||||
continue
|
||||
res = re.match(RE_FUNCTIONNAME, scope.className)
|
||||
if not res:
|
||||
reportError(
|
||||
scope.bodyStart, 'style', 'Function ' + scope.className + ' violates naming convention', 'functionName')
|
||||
|
||||
sys.exit(cppcheckdata.EXIT_CODE)
|
||||
|
|
|
@ -182,7 +182,7 @@ def process(dumpfiles, configfile, debugprint=False):
|
|||
if "RE_FUNCTIONNAME" in conf and conf["RE_FUNCTIONNAME"]:
|
||||
for token in cfg.tokenlist:
|
||||
if token.function:
|
||||
if token.function.type in ('Constructor', 'Destructor', 'CopyConstructor', 'MoveConstructor'):
|
||||
if token.function.type == 'Constructor' or token.function.type == 'Destructor':
|
||||
continue
|
||||
retval = token.previous.str
|
||||
prev = token.previous
|
||||
|
@ -249,5 +249,4 @@ if __name__ == "__main__":
|
|||
if len(errors):
|
||||
print('Found errors: {}'.format(len(errors)))
|
||||
sys.exit(1)
|
||||
|
||||
sys.exit(0)
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
import cppcheckdata, cppcheck, runpy, sys, os
|
||||
|
||||
if __name__ == '__main__':
|
||||
addon = sys.argv[1]
|
||||
__addon_name__ = os.path.splitext(os.path.basename(addon))[0]
|
||||
sys.argv.pop(0)
|
||||
|
||||
runpy.run_path(addon, run_name='__main__')
|
||||
|
||||
# Run registered checkers
|
||||
cppcheck.runcheckers()
|
||||
sys.exit(cppcheckdata.EXIT_CODE)
|
|
@ -0,0 +1,187 @@
|
|||
// To test:
|
||||
// ~/cppcheck/cppcheck --dump cert-test.c && python ../cert.py -verify cert-test.c.dump
|
||||
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()
|
||||
{
|
||||
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 ( n, 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
|
||||
|
||||
n = atof (buffer); //cert-MSC24-C
|
||||
m = sin (n*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(str, newBuf); //cert-STR07-C
|
||||
}
|
||||
|
||||
void str11()
|
||||
{
|
||||
const char str[3]="abc"; //cert-STR11-C
|
||||
const char *x[10]; x[3]="def";
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
|
@ -1,9 +1,6 @@
|
|||
// To test:
|
||||
// ~/cppcheck/cppcheck --dump misc-test.cpp && python ../misc.py -verify misc-test.cpp.dump
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Warn about string concatenation in array initializers..
|
||||
const char *a[] = {"a" "b"}; // stringConcatInArrayInit
|
||||
const char *b[] = {"a","b" "c"}; // stringConcatInArrayInit
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
struct S {
|
||||
uint32_t some[100];
|
||||
};
|
||||
|
||||
void foo( void )
|
||||
{
|
||||
if (((S *)0x8000)->some[0] != 0U) { }
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
struct expression {
|
||||
int nargs;
|
||||
struct expression *args[3];
|
||||
};
|
||||
|
||||
struct expression plvar = {0};
|
||||
|
|
@ -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;
|
||||
}
|
|
@ -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 };
|
|
@ -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
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
struct ConDesDesc {
|
||||
unsigned Order;
|
||||
unsigned Import;
|
||||
};
|
||||
|
||||
// cppcheck-suppress misra-config
|
||||
static ConDesDesc ConDes[CD_TYPE_COUNT] = {
|
||||
{ 0, 0 },
|
||||
{ 0, 0 },
|
||||
};
|
|
@ -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 }
|
||||
}
|
||||
},
|
||||
};
|
|
@ -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}}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
|
||||
static const struct id3_frametype wordlist[] =
|
||||
{
|
||||
{0, "Encryption method registration"},
|
||||
{1, "Popularimeter"},
|
||||
};
|
||||
|
|
@ -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 } }
|
||||
};
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
#line 3 "<stdout>"
|
||||
typedef int8_t flex_int8_t;
|
|
@ -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
|
||||
};
|
|
@ -1,48 +0,0 @@
|
|||
// Test with command:
|
||||
// ./cppcheck --enable=information --enable=style --addon=misra --inline-suppr addons/test/misra/misra-ctu-*-test.c
|
||||
|
||||
#include "misra-ctu-test.h"
|
||||
|
||||
extern MISRA_2_3_A misra_2_3_a;
|
||||
|
||||
x = MISRA_2_5_OK_1;
|
||||
|
||||
// cppcheck-suppress misra-c2012-2.3
|
||||
// cppcheck-suppress misra-c2012-5.6
|
||||
typedef int MISRA_5_6_VIOLATION;
|
||||
|
||||
// cppcheck-suppress misra-c2012-5.7
|
||||
struct misra_5_7_violation_t {
|
||||
int x; // cppcheck-suppress unusedStructMember
|
||||
};
|
||||
static misra_5_7_violation_t misra_5_7_use_type_1;
|
||||
|
||||
// #11443 - FP
|
||||
static struct
|
||||
{ // no warning
|
||||
uint16_t x; // cppcheck-suppress unusedStructMember
|
||||
} misra_5_7_false_positive_1;
|
||||
|
||||
// cppcheck-suppress misra-c2012-8.4
|
||||
// cppcheck-suppress misra-c2012-5.8
|
||||
int misra_5_8_var1;
|
||||
// cppcheck-suppress misra-c2012-8.4
|
||||
// cppcheck-suppress misra-c2012-5.8
|
||||
int misra_5_8_var2;
|
||||
// cppcheck-suppress misra-c2012-5.8
|
||||
static void misra_5_8_f(void) {}
|
||||
|
||||
|
||||
// cppcheck-suppress misra-c2012-5.9
|
||||
static int misra_5_9_count;
|
||||
// cppcheck-suppress misra-c2012-5.9
|
||||
static void misra_5_8_foo(void) {}
|
||||
|
||||
// cppcheck-suppress misra-c2012-8.5
|
||||
extern int misra_8_5;
|
||||
|
||||
// cppcheck-suppress misra-c2012-8.4
|
||||
// cppcheck-suppress misra-c2012-8.6
|
||||
int32_t misra_8_6 = 1;
|
||||
|
||||
void misra_8_7_external(void) {}
|
|
@ -1,58 +0,0 @@
|
|||
// Test with command:
|
||||
// ./cppcheck --enable=information --enable=style --addon=misra --inline-suppr addons/test/misra/misra-ctu-*-test.c
|
||||
|
||||
#include "misra-ctu-test.h"
|
||||
|
||||
extern MISRA_2_3_B misra_2_3_b;
|
||||
|
||||
x = MISRA_2_5_OK_2;
|
||||
|
||||
// cppcheck-suppress misra-c2012-5.6
|
||||
typedef int MISRA_5_6_VIOLATION;
|
||||
static MISRA_5_6_VIOLATION misra_5_6_x;
|
||||
|
||||
// cppcheck-suppress misra-c2012-5.7
|
||||
struct misra_5_7_violation_t {
|
||||
int x; // cppcheck-suppress unusedStructMember
|
||||
};
|
||||
static misra_5_7_violation_t misra_5_7_use_type_2;
|
||||
|
||||
// #11443 - FP
|
||||
static struct
|
||||
{ // no warning
|
||||
uint16_t x; // cppcheck-suppress unusedStructMember
|
||||
} misra_5_7_false_positive_2;
|
||||
|
||||
// cppcheck-suppress misra-c2012-5.8
|
||||
static int misra_5_8_var1;
|
||||
// cppcheck-suppress misra-c2012-8.4
|
||||
// cppcheck-suppress misra-c2012-5.8
|
||||
void misra_5_8_f(void) {
|
||||
// cppcheck-suppress [misra-c2012-5.8, unusedVariable]
|
||||
char misra_5_8_var2;
|
||||
}
|
||||
|
||||
// cppcheck-suppress misra-c2012-5.9
|
||||
static int misra_5_9_count;
|
||||
// cppcheck-suppress misra-c2012-5.9
|
||||
static void misra_5_8_foo(void) {}
|
||||
|
||||
// cppcheck-suppress misra-c2012-8.5
|
||||
extern int misra_8_5;
|
||||
|
||||
// cppcheck-suppress misra-c2012-8.4
|
||||
// cppcheck-suppress misra-c2012-8.6
|
||||
int32_t misra_8_6 = 2;
|
||||
// cppcheck-suppress misra-c2012-8.4
|
||||
int32_t misra_8_6_1;
|
||||
// cppcheck-suppress misra-c2012-8.7
|
||||
// cppcheck-suppress misra-c2012-8.4
|
||||
int32_t misra_8_6_1 = 2;
|
||||
// cppcheck-suppress misra-c2012-8.4
|
||||
// cppcheck-suppress misra-c2012-8.7
|
||||
void misra_8_7(void) {}
|
||||
static void misra_8_7_caller(void) {
|
||||
misra_8_7();
|
||||
misra_8_7_external();
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
|
||||
typedef int MISRA_2_3_A;
|
||||
typedef int MISRA_2_3_B;
|
||||
typedef int MISRA_2_3_VIOLATION; // cppcheck-suppress misra-c2012-2.3
|
||||
|
||||
// cppcheck-suppress misra-c2012-2.4
|
||||
struct misra_2_4_violation_t {
|
||||
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_2 2
|
||||
// cppcheck-suppress misra-c2012-2.5
|
||||
#define MISRA_2_5_VIOLATION 0
|
||||
|
||||
|
|
@ -6,11 +6,11 @@
|
|||
// If it is changed update suppressions.txt with the new line number
|
||||
#include <stdio.h> //21.6
|
||||
|
||||
extern int misra_5_2_var_hides_var______31x;//8.4
|
||||
extern int misra_5_2_var_hides_var______31x;
|
||||
static int misra_5_2_var_hides_var______31y;//5.2
|
||||
static int misra_5_2_function_hides_var_31x;
|
||||
static void misra_5_2_function_hides_var_31y(void) {}//5.2
|
||||
static void foo(void)
|
||||
void misra_5_2_function_hides_var_31y(void) {}//5.2
|
||||
void foo(void)
|
||||
{
|
||||
int i;
|
||||
switch(misra_5_2_func1()) //16.4 16.6
|
||||
|
@ -21,13 +21,13 @@ static void foo(void)
|
|||
{
|
||||
for(i = 0; i < 10; i++)
|
||||
{
|
||||
if(misra_5_2_func3()) //17.3
|
||||
if(misra_5_2_func3()) //14.4
|
||||
{
|
||||
int misra_5_2_var_hides_var_1____31x;
|
||||
int misra_5_2_var_hides_var_1____31y;//5.2
|
||||
}
|
||||
}
|
||||
} while(misra_5_2_func2()); //17.3
|
||||
} while(misra_5_2_func2()); //14.4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,10 +10,5 @@ struct misra_5_2_field_hides_field__63y { //5.2
|
|||
int misra_5_2_field_hides_field1_31x;
|
||||
int misra_5_2_field_hides_field1_31y;//5.2
|
||||
};
|
||||
const char *s41_1 = "\x41g"; // 4.1 8.4
|
||||
const char *s41_2 = "\x41\x42"; // 8.4
|
||||
|
||||
// cppcheck-suppress misra-c2012-5.7
|
||||
struct misra_5_7_violation_t {
|
||||
int x;
|
||||
};
|
||||
const char *s41_1 = "\x41g"; // 4.1
|
||||
const char *s41_2 = "\x41\x42";
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
// 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
|
||||
|
||||
static void misra_10_4(void)
|
||||
{
|
||||
// #10480
|
||||
const char buf1[1] = {a};
|
||||
const char c = '0';
|
||||
x = buf1[0] - c;
|
||||
|
||||
const char buf2[2] = {x,y};
|
||||
x = 'a' == buf2[0]; // no-warning
|
||||
|
||||
typedef struct {
|
||||
int t;
|
||||
char buf[2];
|
||||
} foo_t;
|
||||
const foo_t cmd = {0};
|
||||
x = 'b' == cmd.buf[0]; // no-warning
|
||||
|
||||
const foo_t * pcmd = &cmd;
|
||||
x='c' == pcmd->buf[0]; // no-warning
|
||||
(void)cmd.t;
|
||||
}
|
||||
|
||||
static void misra_12_2(void) {
|
||||
a = (((uint64_t)0xFF) << 32);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,7 @@
|
|||
class C {
|
||||
int a;
|
||||
int b;
|
||||
C(void) : a(1), b(1) { c; }
|
||||
C() : a(1), b(1) { c; }
|
||||
};
|
||||
|
||||
class misra_21_1_C {
|
||||
|
@ -12,14 +12,14 @@ class misra_21_1_C {
|
|||
|
||||
class C2 {
|
||||
public:
|
||||
C2(void);
|
||||
C2();
|
||||
private:
|
||||
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()
|
||||
{
|
||||
auto misra_21_1_C a, b; // 12.3
|
||||
auto misra_21_1_C a, b;
|
||||
a = b;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
#ifndef MISRA_TEST_H
|
||||
#define MISRA_TEST_H
|
||||
struct misra_h_s { int foo; };
|
||||
bool test(char *a); // OK
|
||||
int misra_8_2_no_fp(int a);
|
||||
void misra_8_4_bar(void);
|
||||
#endif // MISRA_TEST_H
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
misra-c2012-21.6:*/misra-suppressions1-test.c:7
|
||||
misra-c2012-17.3
|
||||
misra-c2012-5.2
|
||||
misra-c2012-8.4:*/misra-suppressions1-test.c
|
||||
misra-c2012-16.4:*/misra-suppressions1-test.c
|
||||
misra-c2012-16.6:*/misra-suppressions1-test.c
|
||||
misra-c2012-4.1:*/misra-suppressions2-test.c
|
||||
misra-c2012-8.4:*/misra-suppressions2-test.c
|
||||
misra-c2012-19.2:*/misra-suppressions2-test.c
|
||||
misra_21.6:misra-suppressions1-test.c:7
|
||||
misra_14_4
|
||||
misra.5.2
|
||||
MISRA_16_4:misra-suppressions1-test.c
|
||||
MISRA.16.6:misra-suppressions1-test.c
|
||||
MISRA_4_1:misra-suppressions2-test.c
|
||||
MISRA.19_2:misra-suppressions2-test.c
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// To test:
|
||||
// ~/cppcheck/cppcheck --dump naming_test.c && python ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
|
||||
|
||||
// Should not crash when there is no name
|
||||
void func(int number, int);
|
||||
// To test:
|
||||
// ~/cppcheck/cppcheck --dump naming_test.c && python ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
|
||||
|
||||
// Should not crash when there is no name
|
||||
void func(int number, bool);
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
// To test:
|
||||
// ~/cppcheck/cppcheck --dump naming_test.cpp && python ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
|
||||
|
||||
// No error for mismatching Constructor/Destructor names should be issued, they can not be changed.
|
||||
class TestClass1
|
||||
{
|
||||
TestClass1() {}
|
||||
~TestClass1() {}
|
||||
TestClass1(const TestClass1 &) {}
|
||||
TestClass1(TestClass1 &&) {}
|
||||
};
|
||||
// To test:
|
||||
// ~/cppcheck/cppcheck --dump naming_test.cpp && python ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
|
||||
|
||||
// No error for mismatching Constructor/Destructor names should be issued, they can not be changed.
|
||||
class TestClass1
|
||||
{
|
||||
TestClass1() {}
|
||||
~TestClass1() {}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
uint32_t ui32Good (int abc)
|
||||
uint32_t ui32Good (int a)
|
||||
{
|
||||
uint32_t ui32good;
|
||||
int32_t i32good;
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
# 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
|
||||
|
||||
for arg in args_exit:
|
||||
sys.argv.append(arg)
|
||||
with pytest.raises(SystemExit):
|
||||
get_args()
|
||||
sys.argv.remove(arg)
|
||||
|
||||
for arg in args_ok:
|
||||
sys.argv.append(arg)
|
||||
try:
|
||||
get_args()
|
||||
except SystemExit:
|
||||
pytest.fail("Unexpected SystemExit with '%s'" % arg)
|
||||
sys.argv.remove(arg)
|
|
@ -7,11 +7,10 @@
|
|||
# Command in cppcheck directory:
|
||||
# PYTHONPATH=./addons python3 -m pytest addons/test/test-misra.py
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
||||
from .util import dump_create, dump_remove, convert_json_output
|
||||
|
||||
|
@ -19,32 +18,24 @@ from .util import dump_create, dump_remove, convert_json_output
|
|||
TEST_SOURCE_FILES = ['./addons/test/misra/misra-test.c']
|
||||
|
||||
|
||||
def remove_misra_config(s:str):
|
||||
ret = ''
|
||||
for line in s.splitlines():
|
||||
if '[misra-config]' not in line:
|
||||
ret += line + '\n'
|
||||
return ret
|
||||
def setup_module(module):
|
||||
for f in TEST_SOURCE_FILES:
|
||||
dump_create(f)
|
||||
|
||||
|
||||
def teardown_module(module):
|
||||
for f in TEST_SOURCE_FILES:
|
||||
dump_remove(f)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def checker():
|
||||
from addons.misra import MisraChecker, MisraSettings, get_args_parser
|
||||
parser = get_args_parser()
|
||||
args = parser.parse_args([])
|
||||
from addons.misra import MisraChecker, MisraSettings, get_args
|
||||
args = get_args()
|
||||
settings = MisraSettings(args)
|
||||
return MisraChecker(settings)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_files():
|
||||
for f in TEST_SOURCE_FILES:
|
||||
dump_create(f)
|
||||
yield
|
||||
for f in TEST_SOURCE_FILES:
|
||||
dump_remove(f)
|
||||
|
||||
|
||||
def test_loadRuleTexts_structure(checker):
|
||||
checker.loadRuleTexts("./addons/test/misra/misra_rules_structure.txt")
|
||||
assert(checker.ruleTexts.get(101, None) is None)
|
||||
|
@ -84,7 +75,7 @@ def test_rules_misra_severity(checker):
|
|||
assert(checker.ruleTexts[2104].misra_severity == '')
|
||||
|
||||
|
||||
def test_json_out(checker, capsys, test_files):
|
||||
def test_json_out(checker, capsys):
|
||||
sys.argv.append("--cli")
|
||||
checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
|
||||
checker.parseDump("./addons/test/misra/misra-test.c.dump")
|
||||
|
@ -97,20 +88,20 @@ def test_json_out(checker, capsys, test_files):
|
|||
assert("Advisory" in json_output['c2012-20.1'][0]['extra'])
|
||||
|
||||
|
||||
def test_rules_cppcheck_severity(checker, capsys, test_files):
|
||||
def test_rules_cppcheck_severity(checker, capsys):
|
||||
checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
|
||||
checker.parseDump("./addons/test/misra/misra-test.c.dump")
|
||||
captured = capsys.readouterr().err
|
||||
assert("(error)" not in remove_misra_config(captured))
|
||||
assert("(error)" not in captured)
|
||||
assert("(warning)" not in captured)
|
||||
assert("(style)" in captured)
|
||||
|
||||
def test_rules_cppcheck_severity_custom(checker, capsys, test_files):
|
||||
def test_rules_cppcheck_severity_custom(checker, capsys):
|
||||
checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
|
||||
checker.setSeverity("custom-severity")
|
||||
checker.parseDump("./addons/test/misra/misra-test.c.dump")
|
||||
captured = capsys.readouterr().err
|
||||
assert("(error)" not in remove_misra_config(captured))
|
||||
assert("(error)" not in captured)
|
||||
assert("(warning)" not in captured)
|
||||
assert("(style)" not in captured)
|
||||
assert("(custom-severity)" in captured)
|
||||
|
@ -126,9 +117,10 @@ def test_rules_suppression(checker, capsys):
|
|||
checker.parseDump(src + ".dump")
|
||||
captured = capsys.readouterr().err
|
||||
found = re.search(re_suppressed, captured)
|
||||
assert found is None, 'Unexptected output:\n' + captured
|
||||
assert(found is None)
|
||||
dump_remove(src)
|
||||
|
||||
|
||||
def test_arguments_regression():
|
||||
args_ok = ["-generate-table",
|
||||
"--rule-texts=./addons/test/assets/misra_rules_multiple_lines.txt",
|
||||
|
@ -144,34 +136,18 @@ def test_arguments_regression():
|
|||
# Arguments with expected SystemExit
|
||||
args_exit = ["--non-exists", "--non-exists-param=42", "-h", "--help"]
|
||||
|
||||
from addons.misra import get_args_parser
|
||||
from addons.misra import get_args
|
||||
|
||||
# sys.argv contains all pytest arguments - so clear all existing arguments first and restore afterwards
|
||||
sys_argv_old = sys.argv
|
||||
sys.argv = [sys.argv[0]]
|
||||
for arg in args_exit:
|
||||
sys.argv.append(arg)
|
||||
with pytest.raises(SystemExit):
|
||||
get_args()
|
||||
sys.argv.remove(arg)
|
||||
|
||||
try:
|
||||
for arg in args_exit:
|
||||
sys.argv.append(arg)
|
||||
with pytest.raises(SystemExit):
|
||||
parser = get_args_parser()
|
||||
parser.parse_args()
|
||||
sys.argv.remove(arg)
|
||||
|
||||
for arg in args_ok:
|
||||
sys.argv.append(arg)
|
||||
try:
|
||||
parser = get_args_parser()
|
||||
parser.parse_args()
|
||||
except SystemExit:
|
||||
pytest.fail("Unexpected SystemExit with '%s'" % arg)
|
||||
sys.argv.remove(arg)
|
||||
finally:
|
||||
sys.argv = sys_argv_old
|
||||
|
||||
|
||||
def test_read_ctu_info_line(checker):
|
||||
assert checker.read_ctu_info_line('{') is None
|
||||
assert checker.read_ctu_info_line('{"summary":"123"}') is None
|
||||
assert checker.read_ctu_info_line('{"data":123}') is None
|
||||
assert checker.read_ctu_info_line('{"summary":"123","data":123}') is not None
|
||||
for arg in args_ok:
|
||||
sys.argv.append(arg)
|
||||
try:
|
||||
get_args()
|
||||
except SystemExit:
|
||||
pytest.fail("Unexpected SystemExit with '%s'" % arg)
|
||||
sys.argv.remove(arg)
|
||||
|
|
|
@ -113,27 +113,18 @@ def test_arguments_regression():
|
|||
# Arguments with expected SystemExit
|
||||
args_exit = ["--non-exists", "--non-exists-param=42", "-h", "--help"]
|
||||
|
||||
from addons.y2038 import get_args_parser
|
||||
from addons.y2038 import get_args
|
||||
|
||||
# sys.argv contains all pytest arguments - so clear all existing arguments first and restore afterwards
|
||||
sys_argv_old = sys.argv
|
||||
sys.argv = [sys.argv[0]]
|
||||
for arg in args_exit:
|
||||
sys.argv.append(arg)
|
||||
with pytest.raises(SystemExit):
|
||||
get_args()
|
||||
sys.argv.remove(arg)
|
||||
|
||||
try:
|
||||
for arg in args_exit:
|
||||
sys.argv.append(arg)
|
||||
with pytest.raises(SystemExit):
|
||||
parser = get_args_parser()
|
||||
parser.parse_args()
|
||||
sys.argv.remove(arg)
|
||||
|
||||
for arg in args_ok:
|
||||
sys.argv.append(arg)
|
||||
try:
|
||||
parser = get_args_parser()
|
||||
parser.parse_args()
|
||||
except SystemExit:
|
||||
pytest.fail("Unexpected SystemExit with '%s'" % arg)
|
||||
sys.argv.remove(arg)
|
||||
finally:
|
||||
sys.argv = sys_argv_old
|
||||
for arg in args_ok:
|
||||
sys.argv.append(arg)
|
||||
try:
|
||||
get_args()
|
||||
except SystemExit:
|
||||
pytest.fail("Unexpected SystemExit with '%s'" % arg)
|
||||
sys.argv.remove(arg)
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
struct Dummy {
|
||||
int x;
|
||||
};
|
||||
void func() {
|
||||
// cppcheck-suppress threadsafety-threadsafety
|
||||
static Dummy dummy;
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
struct Dummy {
|
||||
int x;
|
||||
};
|
||||
void func() {
|
||||
// cppcheck-suppress threadsafety-threadsafety-const
|
||||
static const Dummy dummy;
|
||||
}
|
|
@ -20,18 +20,16 @@ def find_cppcheck_binary():
|
|||
|
||||
def dump_create(fpath, *argv):
|
||||
cppcheck_binary = find_cppcheck_binary()
|
||||
cmd = [cppcheck_binary, "--dump", "-DDUMMY", "--quiet", fpath] + list(argv)
|
||||
cmd = [cppcheck_binary, "--dump", "--quiet", fpath] + list(argv)
|
||||
p = subprocess.Popen(cmd)
|
||||
p.communicate()
|
||||
if p.returncode != 0:
|
||||
raise OSError("cppcheck returns error code: %d" % p.returncode)
|
||||
p = subprocess.Popen(["sync"])
|
||||
p.communicate()
|
||||
subprocess.Popen(["sync"])
|
||||
|
||||
|
||||
def dump_remove(fpath):
|
||||
p = subprocess.Popen(["rm", "-f", fpath + ".dump"])
|
||||
p.communicate()
|
||||
subprocess.Popen(["rm", "-f", fpath + ".dump"])
|
||||
|
||||
|
||||
def convert_json_output(raw_json_strings):
|
||||
|
|
|
@ -1,350 +1,36 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
cppcheck addon for threadsafety detection.
|
||||
|
||||
This script analyses Cppcheck dump files to locate threadsafety issues.
|
||||
It warns about
|
||||
- static local objects
|
||||
- MT-Unsafe symbols listed in the "Attributes" sections of man pages.
|
||||
|
||||
"""
|
||||
|
||||
import re
|
||||
import sys
|
||||
#
|
||||
# This script analyses Cppcheck dump files to locate threadsafety issues
|
||||
# - warn about static local objects
|
||||
#
|
||||
|
||||
import cppcheckdata
|
||||
import sys
|
||||
|
||||
# --------------------------------
|
||||
# List of MT-Unsafe identifiers
|
||||
# --------------------------------
|
||||
|
||||
# This is Work In Progress.
|
||||
# Eventually it should contain all identifiers (types
|
||||
# and functions) which are MT-Unsafe.
|
||||
|
||||
# The script tools/MT-Unsafe.py can help to re-generate this list.
|
||||
# It reads a man-page tree and report identifiers marked as "MT-Unsafe"
|
||||
# (see man 7 attributes for what this means), eg
|
||||
# MT-Unsafe.py /usr/share/man/man3
|
||||
|
||||
id_MTunsafe_full = {
|
||||
# MT-Unsafe types by definition
|
||||
# 'pthread_t',
|
||||
# Types marked MT-Unsafe
|
||||
'const:env',
|
||||
'const:hostid',
|
||||
'const:mallopt',
|
||||
'const:sigintr',
|
||||
'race:LogMask',
|
||||
'race:asctime',
|
||||
'race:crypt',
|
||||
'race:crypt_gensalt',
|
||||
'race:cuserid/!string',
|
||||
'race:dirstream',
|
||||
'race:drand48',
|
||||
'race:ecvt',
|
||||
'race:exit',
|
||||
'race:fcvt',
|
||||
'race:fgetgrent',
|
||||
'race:fgetpwent',
|
||||
'race:fgetspent',
|
||||
'race:fsent',
|
||||
'race:getdate',
|
||||
'race:getlogin',
|
||||
'race:getopt',
|
||||
'race:getspent',
|
||||
'race:getspnam',
|
||||
'race:grent',
|
||||
'race:grgid',
|
||||
'race:grnam',
|
||||
'race:hostbyaddr',
|
||||
'race:hostbyname',
|
||||
'race:hostbyname2',
|
||||
'race:hostent',
|
||||
'race:hsearch',
|
||||
'race:l64a',
|
||||
'race:localeconv',
|
||||
'race:mbrlen/!ps',
|
||||
'race:mbrtowc/!ps',
|
||||
'race:mbsnrtowcs/!ps',
|
||||
'race:mbsrtowcs/!ps',
|
||||
'race:mcheck',
|
||||
'race:mntentbuf',
|
||||
'race:netbyaddr',
|
||||
'race:netbyname',
|
||||
'race:netent',
|
||||
'race:netgrent',
|
||||
'race:protobyname',
|
||||
'race:protobynumber',
|
||||
'race:protoent',
|
||||
'race:ptsname',
|
||||
'race:pwent',
|
||||
'race:pwnam',
|
||||
'race:pwuid',
|
||||
'race:qecvt',
|
||||
'race:qfcvt',
|
||||
'race:servbyname',
|
||||
'race:servbyport',
|
||||
'race:servent',
|
||||
'race:sgetspent',
|
||||
'race:signgam',
|
||||
'race:stdin',
|
||||
'race:stdout',
|
||||
'race:streams',
|
||||
'race:strerror',
|
||||
'race:strsignal',
|
||||
'race:strtok',
|
||||
'race:tmbuf',
|
||||
'race:tmpnam/!s',
|
||||
'race:ttyent',
|
||||
'race:ttyname',
|
||||
'race:utent',
|
||||
'race:wcrtomb/!ps',
|
||||
'race:wcsnrtombs/!ps',
|
||||
'race:wcsrtombs/!ps',
|
||||
'sig:ALRM',
|
||||
'sig:SIGCHLD/linux',
|
||||
# APIs marked MT-Unsafe
|
||||
'asctime',
|
||||
'clearenv',
|
||||
'ctime',
|
||||
'cuserid',
|
||||
'drand48',
|
||||
'ecvt',
|
||||
'encrypt',
|
||||
'endfsent',
|
||||
'endgrent',
|
||||
'endhostent',
|
||||
'endnetent',
|
||||
'endnetgrent',
|
||||
'endprotoent',
|
||||
'endpwent',
|
||||
'endservent',
|
||||
'endspent',
|
||||
'endttyent',
|
||||
'endusershell',
|
||||
'endutent',
|
||||
'erand48',
|
||||
'error_at_line',
|
||||
'ether_aton',
|
||||
'ether_ntoa',
|
||||
'exit',
|
||||
'fcloseall',
|
||||
'fcvt',
|
||||
'fgetgrent',
|
||||
'fgetpwent',
|
||||
'fgetspent',
|
||||
'fts_children',
|
||||
'fts_read',
|
||||
'gamma',
|
||||
'gammaf',
|
||||
'gammal',
|
||||
'getaliasbyname',
|
||||
'getaliasent',
|
||||
'getchar_unlocked',
|
||||
'getdate',
|
||||
'getfsent',
|
||||
'getfsfile',
|
||||
'getfsspec',
|
||||
'getgrent',
|
||||
'getgrent_r',
|
||||
'getgrgid',
|
||||
'getgrnam',
|
||||
'gethostbyaddr',
|
||||
'gethostbyname',
|
||||
'gethostbyname2',
|
||||
'gethostent',
|
||||
'gethostent_r',
|
||||
'getlogin',
|
||||
'getlogin_r',
|
||||
'getmntent',
|
||||
'getnetbyaddr',
|
||||
'getnetbyname',
|
||||
'getnetent',
|
||||
'getnetgrent',
|
||||
'getnetgrent_r',
|
||||
'getopt',
|
||||
'getopt_long',
|
||||
'getopt_long_only',
|
||||
'getpass',
|
||||
'getprotobyname',
|
||||
'getprotobynumber',
|
||||
'getprotoent',
|
||||
'getpwent',
|
||||
'getpwent_r',
|
||||
'getpwnam',
|
||||
'getpwuid',
|
||||
'getrpcbyname',
|
||||
'getrpcbynumber',
|
||||
'getrpcent',
|
||||
'getservbyname',
|
||||
'getservbyport',
|
||||
'getservent',
|
||||
'getspent',
|
||||
'getspent_r',
|
||||
'getspnam',
|
||||
'getttyent',
|
||||
'getttynam',
|
||||
'getusershell',
|
||||
'getutent',
|
||||
'getutid',
|
||||
'getutline',
|
||||
'getwchar_unlocked',
|
||||
'glob',
|
||||
'gmtime',
|
||||
'hcreate',
|
||||
'hdestroy',
|
||||
'hsearch',
|
||||
'innetgr',
|
||||
'jrand48',
|
||||
'l64a',
|
||||
'lcong48',
|
||||
'localeconv',
|
||||
'localtime',
|
||||
'login',
|
||||
'login_tty',
|
||||
'logout',
|
||||
'logwtmp',
|
||||
'lrand48',
|
||||
'mallinfo',
|
||||
'mallinfo2',
|
||||
'mblen',
|
||||
'mbrlen',
|
||||
'mbrtowc',
|
||||
'mbsnrtowcs',
|
||||
'mbsrtowcs',
|
||||
'mbtowc',
|
||||
'mcheck',
|
||||
'mcheck_check_all',
|
||||
'mcheck_pedantic',
|
||||
'mprobe',
|
||||
'mrand48',
|
||||
'mtrace',
|
||||
'muntrace',
|
||||
'nrand48',
|
||||
'profil',
|
||||
'ptsname',
|
||||
'putchar_unlocked',
|
||||
'putenv',
|
||||
'pututline',
|
||||
'putwchar_unlocked',
|
||||
'pvalloc',
|
||||
'qecvt',
|
||||
'qfcvt',
|
||||
'rcmd',
|
||||
'rcmd_af',
|
||||
're_comp',
|
||||
're_exec',
|
||||
'readdir',
|
||||
'rexec',
|
||||
'rexec_af',
|
||||
'seed48',
|
||||
'setenv',
|
||||
'setfsent',
|
||||
'setgrent',
|
||||
'sethostent',
|
||||
'sethostid',
|
||||
'setkey',
|
||||
'setlogmask',
|
||||
'setnetent',
|
||||
'setnetgrent',
|
||||
'setprotoent',
|
||||
'setpwent',
|
||||
'setservent',
|
||||
'setspent',
|
||||
'setttyent',
|
||||
'setusershell',
|
||||
'setutent',
|
||||
'sgetspent',
|
||||
'siginterrupt',
|
||||
'sleep',
|
||||
'srand48',
|
||||
'strerror',
|
||||
'strsignal',
|
||||
'strtok',
|
||||
'tmpnam',
|
||||
'ttyname',
|
||||
'ttyslot',
|
||||
'unsetenv',
|
||||
'updwtmp',
|
||||
'utmpname',
|
||||
'valloc',
|
||||
'wcrtomb',
|
||||
'wcsnrtombs',
|
||||
'wcsrtombs',
|
||||
'wctomb',
|
||||
'wordexp'
|
||||
}
|
||||
|
||||
# From man 7 attributes
|
||||
# the full token could be feature:function/condition - we just want function.
|
||||
id_MTunsafe = [re.sub('^.*:', '', re.sub('/.*$', '', x))
|
||||
for x in id_MTunsafe_full
|
||||
]
|
||||
def reportError(token, severity, msg, id):
|
||||
cppcheckdata.reportError(token, severity, msg, 'threadsafety', id)
|
||||
|
||||
|
||||
def reportError(token, severity, msg, errid): # noqa: D103
|
||||
cppcheckdata.reportError(token, severity, msg, 'threadsafety', errid)
|
||||
|
||||
|
||||
def checkstatic(data): # noqa: D103
|
||||
def checkstatic(data):
|
||||
for var in data.variables:
|
||||
if var.isStatic and var.isLocal:
|
||||
vartype = None
|
||||
type = None
|
||||
if var.isClass:
|
||||
vartype = 'object'
|
||||
type = 'object'
|
||||
else:
|
||||
vartype = 'variable'
|
||||
type = 'variable'
|
||||
if var.isConst:
|
||||
if data.standards.cpp == 'c++03':
|
||||
reportError(
|
||||
var.typeStartToken,
|
||||
'warning',
|
||||
'Local constant static '
|
||||
+ vartype + "'" + var.nameToken.str
|
||||
+ "', dangerous if it is initialized"
|
||||
+ ' in parallel threads',
|
||||
'threadsafety-const')
|
||||
reportError(var.typeStartToken, 'warning', 'Local constant static ' + type + ' \'' + var.nameToken.str + '\', dangerous if it is initialized in parallel threads', 'threadsafety')
|
||||
else:
|
||||
reportError(var.typeStartToken, 'warning',
|
||||
'Local static ' + vartype + ': '
|
||||
+ var.nameToken.str,
|
||||
'threadsafety')
|
||||
reportError(var.typeStartToken, 'warning', 'Local static ' + type + ': ' + var.nameToken.str, 'threadsafety')
|
||||
|
||||
for arg in sys.argv[1:]:
|
||||
if arg.startswith('-'):
|
||||
continue
|
||||
|
||||
def check_MTunsafe(cfg):
|
||||
"""
|
||||
Look for functions marked MT-unsafe in their man pages.
|
||||
print('Checking %s...' % arg)
|
||||
data = cppcheckdata.CppcheckData(arg)
|
||||
|
||||
The MT-unsafe functions are listed in id_MTunsafe (and id_MTunsafe_full).
|
||||
That section of code can be regenerated by the external script MT-Unsafe.py
|
||||
"""
|
||||
for token in cfg.tokenlist:
|
||||
if token.str in id_MTunsafe:
|
||||
reportError(token, 'warning', token.str + ' is MT-unsafe',
|
||||
'unsafe-call')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = cppcheckdata.ArgumentParser()
|
||||
args = parser.parse_args()
|
||||
|
||||
quiet = args.quiet or args.cli
|
||||
|
||||
if not args.dumpfile:
|
||||
if not args.quiet:
|
||||
print('no input files.')
|
||||
sys.exit(0)
|
||||
|
||||
for dumpfile in args.dumpfile:
|
||||
# load XML from .dump file
|
||||
data = cppcheckdata.CppcheckData(dumpfile)
|
||||
|
||||
for cfg in data.iterconfigurations():
|
||||
if not args.quiet:
|
||||
srcfile = data.files[0]
|
||||
print('Checking %s, config %s...' % (srcfile, cfg.name))
|
||||
check_MTunsafe(cfg)
|
||||
checkstatic(cfg)
|
||||
|
||||
sys.exit(cppcheckdata.EXIT_CODE)
|
||||
for cfg in data.iterconfigurations():
|
||||
print('Checking %s, config %s...' % (arg, cfg.name))
|
||||
checkstatic(cfg)
|
||||
|
|
|
@ -9,13 +9,15 @@
|
|||
# 3. Any Y2038-unsafe symbol when _USE_TIME_BITS64 is not defined.
|
||||
#
|
||||
# Example usage:
|
||||
# $ cppcheck --addon=y2038 path-to-src/test.c
|
||||
# $ cppcheck --dump path-to-src/test.c
|
||||
# $ y2038.py path-to-src/test.c.dump
|
||||
#
|
||||
|
||||
# y2038.py will walk the source tree for .dump files.
|
||||
from __future__ import print_function
|
||||
|
||||
import cppcheckdata
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
|
@ -154,14 +156,22 @@ def check_y2038_safe(dumpfile, quiet=False):
|
|||
# load XML from .dump file
|
||||
data = cppcheckdata.CppcheckData(dumpfile)
|
||||
|
||||
srcfile = data.files[0]
|
||||
# Convert dump file path to source file in format generated by cppcheck.
|
||||
# For example after the following call:
|
||||
# cppcheck ./src/my-src.c --dump
|
||||
# We got 'src/my-src.c' value for 'file' field in cppcheckdata.
|
||||
srcfile = dumpfile.rstrip('.dump')
|
||||
srcfile = os.path.expanduser(srcfile)
|
||||
srcfile = os.path.normpath(srcfile)
|
||||
|
||||
# go through each configuration
|
||||
for cfg in data.iterconfigurations():
|
||||
if not quiet:
|
||||
print('Checking %s, config %s...' % (srcfile, cfg.name))
|
||||
safe_ranges = []
|
||||
safe = -1
|
||||
time_bits_defined = False
|
||||
srclinenr = 0
|
||||
srclinenr = '0'
|
||||
|
||||
for directive in cfg.directives:
|
||||
# track source line number
|
||||
|
@ -216,17 +226,16 @@ def check_y2038_safe(dumpfile, quiet=False):
|
|||
return y2038safe
|
||||
|
||||
|
||||
def get_args_parser():
|
||||
def get_args():
|
||||
parser = cppcheckdata.ArgumentParser()
|
||||
return parser
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = get_args_parser()
|
||||
args = parser.parse_args()
|
||||
args = get_args()
|
||||
|
||||
exit_code = 0
|
||||
quiet = args.quiet or args.cli
|
||||
quiet = not any((args.quiet, args.cli))
|
||||
|
||||
if not args.dumpfile:
|
||||
if not args.quiet:
|
||||
|
@ -234,9 +243,17 @@ if __name__ == '__main__':
|
|||
sys.exit(0)
|
||||
|
||||
for dumpfile in args.dumpfile:
|
||||
if not quiet:
|
||||
if not os.path.isfile(dumpfile):
|
||||
print("Error: File not found: %s" % dumpfile)
|
||||
sys.exit(127)
|
||||
if not os.access(dumpfile, os.R_OK):
|
||||
print("Error: Permission denied: %s" % dumpfile)
|
||||
sys.exit(13)
|
||||
if not args.quiet:
|
||||
print('Checking ' + dumpfile + '...')
|
||||
|
||||
check_y2038_safe(dumpfile, quiet)
|
||||
y2038safe = check_y2038_safe(dumpfile, quiet)
|
||||
if not y2038safe and exit_code == 0:
|
||||
exit_code = 1
|
||||
|
||||
sys.exit(cppcheckdata.EXIT_CODE)
|
||||
sys.exit(exit_code)
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
version: '{build}'
|
||||
|
||||
clone_depth: 10
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- VisualStudioVersion: 12.0
|
||||
platform: Win32
|
||||
configuration: Debug
|
||||
vcvarsall_platform: x86
|
||||
PlatformToolset: v120
|
||||
- VisualStudioVersion: 12.0
|
||||
platform: Win32
|
||||
configuration: Release
|
||||
vcvarsall_platform: x86
|
||||
PlatformToolset: v120
|
||||
MYQTDIR: C:\Qt\5.6\msvc2013
|
||||
- VisualStudioVersion: 12.0
|
||||
platform: x64
|
||||
configuration: Debug
|
||||
vcvarsall_platform: x64
|
||||
PlatformToolset: v120
|
||||
cygwin_build: yes
|
||||
- VisualStudioVersion: 12.0
|
||||
platform: x64
|
||||
configuration: Release
|
||||
vcvarsall_platform: x64
|
||||
PlatformToolset: v120
|
||||
MYQTDIR: C:\Qt\5.6\msvc2013_64
|
||||
# FIXME: These are disabled for now. They were broken by ae8653612802b41b70424ec9a5eefe8a1178f6d1
|
||||
# - VisualStudioVersion: 14.0
|
||||
# platform: Win32
|
||||
# configuration: Debug
|
||||
# vcvarsall_platform: x86
|
||||
# PlatformToolset: v140
|
||||
# - VisualStudioVersion: 14.0
|
||||
# platform: Win32
|
||||
# configuration: Release
|
||||
# vcvarsall_platform: x86
|
||||
# PlatformToolset: v140
|
||||
# MYQTDIR: C:\Qt\5.11\msvc2015
|
||||
# - VisualStudioVersion: 14.0
|
||||
# platform: x64
|
||||
# configuration: Debug
|
||||
# vcvarsall_platform: x64
|
||||
# PlatformToolset: v140
|
||||
# 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
|
||||
# MYQTDIR: C:\Qt\5.11\msvc2015_64
|
||||
|
||||
install:
|
||||
- pip install pytest
|
||||
- SET p=x86
|
||||
- IF "%platform%"=="x64" SET p=x64
|
||||
- curl -fsSL https://github.com/Z3Prover/z3/releases/download/z3-4.8.7/z3-4.8.7-%p%-win.zip -o z3-4.8.7-win.zip
|
||||
- 7z x z3-4.8.7-win.zip -oexternals -r -y
|
||||
- move externals\z3-4.8.7-%p%-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..
|
||||
- msbuild "cppcheck.sln" /consoleloggerparameters:Verbosity=minimal /target:Build /property:Configuration="%configuration%";Platform=%platform% /p:PlatformToolset=%PlatformToolset% /maxcpucount /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
# 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 %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
|
||||
- cd test\cli
|
||||
- python -m pytest test-helloworld.py
|
||||
- python -m pytest test-inline-suppress.py
|
||||
- python -m pytest test-suppress-syntaxError.py
|
||||
- 'IF defined cygwin_build C:\cygwin64\bin\bash -e -l -c "cd /cygdrive/c/projects/cppcheck && make clean && make -j 2 && make test && make checkcfg"'
|
||||
|
||||
artifacts:
|
||||
- path: bin
|
||||
name: CLI binaries
|
||||
type: zip
|
||||
- path: Build\gui
|
||||
name: GUI binaries
|
||||
type: zip
|
|
@ -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
|
||||
|
144
build-pcre.txt
144
build-pcre.txt
|
@ -1,76 +1,68 @@
|
|||
PCRE is a library that is used by the optional "rules" feature for the command
|
||||
line version of cppcheck. It is readily available on Linux and Mac OS X, but
|
||||
must be obtained separately for Windows.
|
||||
|
||||
If you're using qmake to generate makefiles, the following behavior applies:
|
||||
|
||||
- If you're not on Windows, it assumes by default that you have PCRE and want
|
||||
to enable rules support. You can disable rules support (removing the PCRE
|
||||
dependency) by passing HAVE_RULES=no to qmake.
|
||||
|
||||
- If you are on Windows, but have PCRE available, you can enable rules support
|
||||
by passing HAVE_RULES=yes to qmake.
|
||||
|
||||
- Note: This includes using build.bat since it calls qmake - to use PCRE and
|
||||
build.bat, you need to run set HAVE_RULES=yes before each run of build.bat
|
||||
|
||||
|
||||
Build instructions
|
||||
------------------
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
Visual Studio
|
||||
|
||||
To build PCRE, download the source code from www.pcre.org and
|
||||
CMake (https://cmake.org/download/). We assume you use Visual Studio 2015 -
|
||||
otherwise adapt the commands for your version.
|
||||
|
||||
VS Solution file
|
||||
cmake . -G "Visual Studio 14 2015"
|
||||
Open PCRE.sln with VS IDE or via cmd:
|
||||
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
|
||||
MSBuild PCRE.sln /target:Build /property:Configuration="Release"
|
||||
|
||||
For 64-bit target: cmake . -G "Visual Studio 14 2015 Win64"
|
||||
|
||||
or using NMake
|
||||
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
|
||||
cmake . -G "NMake Makefiles"
|
||||
nmake
|
||||
|
||||
or using MSYS
|
||||
cmake . -G "MSYS Makefiles"
|
||||
make
|
||||
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
The normal Makefile should work.
|
||||
|
||||
Install PCRE on Ubuntu might be needed:
|
||||
sudo apt-get install libpcre3 libpcre3-dev
|
||||
|
||||
|
||||
Mac OSX
|
||||
-------
|
||||
|
||||
Install PCRE:
|
||||
|
||||
homebre
|
||||
brew install pcre
|
||||
|
||||
or macport
|
||||
sudo port install pcre
|
||||
|
||||
Ensure /path/to/pcre.h is in CXXFLAGS, e.g:
|
||||
|
||||
for homebrew
|
||||
export CXXFLAGS=${CXXFLAGS}:/usr/local/include
|
||||
|
||||
or macport
|
||||
export CXXFLAGS=${CXXFLAGS}:/opt/local/include
|
||||
|
||||
Or for MSVC copy pcre.lib and pcre.h in /externals directory.
|
||||
PCRE is a library that is used by the optional "rules" feature for the command
|
||||
line version of cppcheck. It is readily available on Linux and Mac OS X, but
|
||||
must be obtained separately for Windows.
|
||||
|
||||
If you're using qmake to generate makefiles, the following behavior applies:
|
||||
|
||||
- If you're not on Windows, it assumes by default that you have PCRE and want
|
||||
to enable rules support. You can disable rules support (removing the PCRE
|
||||
dependency) by passing HAVE_RULES=no to qmake.
|
||||
|
||||
- If you are on Windows, but have PCRE available, you can enable rules support
|
||||
by passing HAVE_RULES=yes to qmake.
|
||||
|
||||
- Note: This includes using build.bat since it calls qmake - to use PCRE and
|
||||
build.bat, you need to run set HAVE_RULES=yes before each run of build.bat
|
||||
|
||||
|
||||
Build instructions
|
||||
------------------
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
Visual Studio
|
||||
|
||||
To build PCRE, download the source code from www.pcre.org and
|
||||
CMake (https://cmake.org/download/). We assume you use Visual Studio 2015 -
|
||||
otherwise adapt the commands for your version.
|
||||
|
||||
VS Solution file
|
||||
cmake . -G "Visual Studio 14 2015"
|
||||
Open PCRE.sln with VS IDE or via cmd:
|
||||
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
|
||||
MSBuild PCRE.sln /target:Build /property:Configuration="Release"
|
||||
|
||||
For 64-bit target: cmake . -G "Visual Studio 14 2015 Win64"
|
||||
|
||||
or using NMake
|
||||
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
|
||||
cmake . -G "NMake Makefiles"
|
||||
nmake
|
||||
|
||||
or using MSYS
|
||||
cmake . -G "MSYS Makefiles"
|
||||
make
|
||||
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
The normal Makefile should work.
|
||||
|
||||
Install PCRE on Ubuntu might be needed:
|
||||
sudo apt-get install libpcre3 libpcre3-dev
|
||||
|
||||
|
||||
Mac OSX
|
||||
-------
|
||||
|
||||
Install PCRE:
|
||||
|
||||
sudo port install pcre
|
||||
|
||||
Ensure /path/to/pcre.h is in CXXFLAGS, e.g:
|
||||
|
||||
export CXXFLAGS=${CXXFLAGS}:/opt/local/include
|
||||
|
||||
Or for MSVC copy pcre.lib and pcre.h in /externals directory.
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
@echo off
|
||||
REM A simple script to build different cppcheck targets from project root
|
||||
REM folder. This script can be run from VS prompt or Qt prompt.
|
||||
REM
|
||||
REM Usage: build <target> [release|debug]
|
||||
REM where <target> is any of cppcheck/gui/tests/all
|
||||
REM release or debug is the configuration
|
||||
REM all-target builds both cppcheck and gui.
|
||||
REM
|
||||
REM Run the command before build.bat to enable rules using pcre:
|
||||
REM set HAVE_RULES=yes
|
||||
REM
|
||||
REM TODO:
|
||||
REM - run tests too
|
||||
|
||||
pushd %~dp0
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
REM Qt prompt sets QMAKESPEC
|
||||
if "%QMAKESPEC%" == "" (
|
||||
REM parse qmakespec to see if it's some msvc
|
||||
if "%QMAKESPEC:~6,4%" == "msvc" (
|
||||
set MAKE=nmake
|
||||
) else (
|
||||
set MAKE=mingw32-make
|
||||
)
|
||||
) else (
|
||||
set MAKE=nmake
|
||||
)
|
||||
|
||||
if "%2" == "" set TARGET=release
|
||||
if "%2" == "debug" set TARGET=debug
|
||||
if "%2" == "release" set TARGET=release
|
||||
|
||||
if "%1" == "all" goto cppcheck
|
||||
if "%1" == "cppcheck" goto cppcheck
|
||||
if "%1" == "gui" goto gui
|
||||
if "%1" == "tests" goto tests
|
||||
goto help
|
||||
|
||||
:cppcheck
|
||||
pushd cli
|
||||
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
||||
%MAKE%
|
||||
popd
|
||||
if "%1" == "all" goto gui
|
||||
goto end
|
||||
|
||||
:gui
|
||||
pushd gui
|
||||
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
||||
%MAKE%
|
||||
lupdate -no-obsolete gui.pro
|
||||
lrelease gui.pro
|
||||
popd
|
||||
goto end
|
||||
|
||||
:tests
|
||||
pushd test
|
||||
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
||||
%MAKE%
|
||||
popd
|
||||
goto end
|
||||
|
||||
:help
|
||||
echo Syntax: build ^<target^> [debug^|release]
|
||||
echo where ^<target^> is any of cppcheck/gui/tests/all
|
||||
echo debug or release define used configuration
|
||||
echo all- target builds both cppcheck and gui.
|
||||
|
||||
:end
|
29
cfg/avr.cfg
29
cfg/avr.cfg
|
@ -3,6 +3,8 @@
|
|||
<def format="2">
|
||||
<!-- stdint.h -->
|
||||
<define name="__USING_MINT8" value="0"/>
|
||||
<define name="__CONCATenate(left, right)" value="left ## right"/>
|
||||
<define name="__CONCAT(left, right)" value="__CONCATenate(left, right)"/>
|
||||
<!-- Integer types capable of holding object pointers -->
|
||||
<podtype name="intptr_t" sign="s" size="2"/>
|
||||
<podtype name="uintptr_t" sign="u" size="2"/>
|
||||
|
@ -84,8 +86,32 @@
|
|||
<define name="SIG_ATOMIC_MAX" value="INT8_MAX"/>
|
||||
<define name="SIG_ATOMIC_MIN" value="INT8_MIN"/>
|
||||
<define name="SIZE_MAX" value="(__CONCAT(INT16_MAX, U))"/>
|
||||
<!-- Macros for integer constants -->
|
||||
<define name="INT8_C(value)" value="((int8_t) value)"/>
|
||||
<define name="UINT8_C(value)" value="((uint8_t) __CONCAT(value, U))"/>
|
||||
<define name="INT16_C(value)" value="value"/>
|
||||
<define name="UINT16_C(value)" value="__CONCAT(value, U)"/>
|
||||
<define name="INT32_C(value)" value="__CONCAT(value, L)"/>
|
||||
<define name="UINT32_C(value)" value="__CONCAT(value, UL)"/>
|
||||
<define name="INT64_C(value)" value="__CONCAT(value, LL)"/>
|
||||
<define name="UINT64_C(value)" value="__CONCAT(value, ULL)"/>
|
||||
<define name="INTMAX_C(value)" value="__CONCAT(value, LL)"/>
|
||||
<define name="UINTMAX_C(value)" value="__CONCAT(value, ULL)"/>
|
||||
<!-- FIXME: add macros for printf and scanf format specifiers,e.g. PRId8 -->
|
||||
<!-- math.h -->
|
||||
<define name="M_E" value="2.7182818284590452354"/>
|
||||
<define name="M_LOG2E" value="1.4426950408889634074"/>
|
||||
<define name="M_LOG10E" value="0.43429448190325182765"/>
|
||||
<define name="M_LN2" value="0.69314718055994530942"/>
|
||||
<define name="M_LN10" value="2.30258509299404568402"/>
|
||||
<define name="M_PI" value="3.14159265358979323846"/>
|
||||
<define name="M_PI_2" value="1.57079632679489661923"/>
|
||||
<define name="M_PI_4" value="0.78539816339744830962"/>
|
||||
<define name="M_1_PI" value="0.31830988618379067154"/>
|
||||
<define name="M_2_PI" value="0.63661977236758134308"/>
|
||||
<define name="M_2_SQRTPI" value="1.12837916709551257390"/>
|
||||
<define name="M_SQRT2" value="1.41421356237309504880"/>
|
||||
<define name="M_SQRT1_2" value="0.70710678118654752440"/>
|
||||
<define name="powf" value="pow"/>
|
||||
<define name="roundf" value="round"/>
|
||||
<define name="signbitf" value="signbit"/>
|
||||
|
@ -111,6 +137,9 @@
|
|||
<define name="putchar(__c)" value="fputc(__c, stdout)"/>
|
||||
<define name="getc(__stream)" value="fgetc(__stream)"/>
|
||||
<define name="getchar()" value="fgetc(stdin)"/>
|
||||
<define name="SEEK_SET" value="0"/>
|
||||
<define name="SEEK_CUR" value="1"/>
|
||||
<define name="SEEK_END" value="2"/>
|
||||
<function name="vfprintf_P">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
|
|
142
cfg/bento4.cfg
142
cfg/bento4.cfg
|
@ -1,142 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<def format="2">
|
||||
<define name="AP4_DEFINE_DYNAMIC_CAST_ANCHOR" value=""/>
|
||||
<define name="AP4_IMPLEMENT_DYNAMIC_CAST_D" value=""/>
|
||||
<define name="AP4_FAILED(C)" value="C"/>
|
||||
<define name="AP4_ATOM_HEADER_SIZE_64" value="16"/>
|
||||
<define name="AP4_ATOM_HEADER_SIZE" value="8"/>
|
||||
<define name="AP4_ATOM_MAX_NAME_SIZE" value="256"/>
|
||||
<define name="AP4_ATOM_MAX_URI_SIZE" value="512"/>
|
||||
<define name="AP4_AVC_PROFILE_BASELINE" value="66"/>
|
||||
<define name="AP4_AVC_PROFILE_EXTENDED" value="88"/>
|
||||
<define name="AP4_AVC_PROFILE_HIGH_10" value="110"/>
|
||||
<define name="AP4_AVC_PROFILE_HIGH_422" value="122"/>
|
||||
<define name="AP4_AVC_PROFILE_HIGH_444" value="144"/>
|
||||
<define name="AP4_AVC_PROFILE_HIGH" value="100"/>
|
||||
<define name="AP4_AVC_PROFILE_MAIN" value="77"/>
|
||||
<define name="AP4_CENC_CIPHER_AES_128_CBC" value="2"/>
|
||||
<define name="AP4_CENC_CIPHER_AES_128_CTR" value="1"/>
|
||||
<define name="AP4_CENC_CIPHER_NONE" value="0"/>
|
||||
<define name="AP4_CENC_SAMPLE_ENCRYPTION_FLAG_OVERRIDE_TRACK_ENCRYPTION_DEFAULTS" value="1"/>
|
||||
<define name="AP4_CENC_SAMPLE_ENCRYPTION_FLAG_USE_SUB_SAMPLE_ENCRYPTION" value="2"/>
|
||||
<define name="AP4_COMMAND_TAG_ES_DESCRIPTOR_REMOVE_REF" value="0x07"/>
|
||||
<define name="AP4_COMMAND_TAG_ES_DESCRIPTOR_REMOVE" value="0x04"/>
|
||||
<define name="AP4_COMMAND_TAG_ES_DESCRIPTOR_UPDATE" value="0x03"/>
|
||||
<define name="AP4_COMMAND_TAG_IPMP_DESCRIPTOR_REMOVE" value="0x06"/>
|
||||
<define name="AP4_COMMAND_TAG_IPMP_DESCRIPTOR_UPDATE" value="0x05"/>
|
||||
<define name="AP4_COMMAND_TAG_OBJECT_DESCRIPTOR_EXECUTE" value="0x08"/>
|
||||
<define name="AP4_COMMAND_TAG_OBJECT_DESCRIPTOR_REMOVE" value="0x02"/>
|
||||
<define name="AP4_COMMAND_TAG_OBJECT_DESCRIPTOR_UPDATE" value="0x01"/>
|
||||
<define name="AP4_DESCRIPTOR_TAG_DECODER_CONFIG" value="0x04"/>
|
||||
<define name="AP4_DESCRIPTOR_TAG_DECODER_SPECIFIC_INFO" value="0x05"/>
|
||||
<define name="AP4_DESCRIPTOR_TAG_ES" value="0x03"/>
|
||||
<define name="AP4_DESCRIPTOR_TAG_IOD" value="0x02"/>
|
||||
<define name="AP4_DESCRIPTOR_TAG_MP4_IOD" value="0x10"/>
|
||||
<define name="AP4_DESCRIPTOR_TAG_MP4_OD" value="0x11"/>
|
||||
<define name="AP4_DESCRIPTOR_TAG_OD" value="0x01"/>
|
||||
<define name="AP4_DESCRIPTOR_TAG_SL_CONFIG" value="0x06"/>
|
||||
<define name="AP4_DV_PROFILE_DVAV_PEN" value="1"/>
|
||||
<define name="AP4_DV_PROFILE_DVAV_PER" value="0"/>
|
||||
<define name="AP4_DV_PROFILE_DVHE_DEN" value="3"/>
|
||||
<define name="AP4_DV_PROFILE_DVHE_DER" value="2"/>
|
||||
<define name="AP4_DV_PROFILE_DVHE_DTB" value="7"/>
|
||||
<define name="AP4_DV_PROFILE_DVHE_DTH" value="6"/>
|
||||
<define name="AP4_DV_PROFILE_DVHE_DTR" value="4"/>
|
||||
<define name="AP4_DV_PROFILE_DVHE_STN" value="5"/>
|
||||
<define name="AP4_FRAG_FLAG_SAMPLE_IS_DIFFERENCE" value="0x00010000"/>
|
||||
<define name="AP4_FULL_ATOM_HEADER_SIZE_64" value="20"/>
|
||||
<define name="AP4_FULL_ATOM_HEADER_SIZE" value="12"/>
|
||||
<define name="AP4_HEVC_CHROMA_FORMAT_420" value="1"/>
|
||||
<define name="AP4_HEVC_CHROMA_FORMAT_422" value="2"/>
|
||||
<define name="AP4_HEVC_CHROMA_FORMAT_444" value="3"/>
|
||||
<define name="AP4_HEVC_CHROMA_FORMAT_MONOCHROME" value="0"/>
|
||||
<define name="AP4_HEVC_PROFILE_MAIN_10" value="2"/>
|
||||
<define name="AP4_HEVC_PROFILE_MAIN_STILL_PICTURE" value="3"/>
|
||||
<define name="AP4_HEVC_PROFILE_MAIN" value="1"/>
|
||||
<define name="AP4_HEVC_PROFILE_REXT" value="4"/>
|
||||
<define name="AP4_MDHD_DEFAULT_GENERIC_TIMESCALE" value="1000"/>
|
||||
<define name="AP4_MDHD_DEFAULT_VIDEO_TIMESCALE" value="90000"/>
|
||||
<define name="AP4_MPEG2_STREAM_TYPE_ATSC_AC3" value="0x81"/>
|
||||
<define name="AP4_MPEG2_STREAM_TYPE_ATSC_EAC3" value="0x81"/>
|
||||
<define name="AP4_MPEG2_STREAM_TYPE_HEVC" value="0x24"/>
|
||||
<define name="AP4_MPEG2_STREAM_TYPE_ISO_IEC_13818_1_PES" value="0x06"/>
|
||||
<define name="AP4_MPEG2_TS_DEFAULT_PID_AUDIO" value="0x101"/>
|
||||
<define name="AP4_MPEG2_TS_DEFAULT_PID_PMT" value="0x100"/>
|
||||
<define name="AP4_MPEG2_TS_DEFAULT_PID_VIDEO" value="0x102"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_AAC_LC" value="2"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_AAC_LTP" value="4"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_AAC_MAIN" value="1"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_AAC_SCALABLE" value="6"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_AAC_SSR" value="3"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ALGORITHMIC_SYNTHESIS" value="16"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ALS" value="36"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_CELP" value="8"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_DST" value="35"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_AAC_ELD" value="39"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_AAC_LC" value="17"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_AAC_LD" value="23"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_AAC_LTP" value="19"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_AAC_SCALABLE" value="20"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_BSAC" value="22"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_CELP" value="24"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_HILN" value="26"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_HVXC" value="25"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_PARAMETRIC" value="27"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_ER_TWINVQ" value="21"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_GENERAL_MIDI" value="15"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_HVXC" value="9"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_LAYER_1" value="32"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_LAYER_2" value="33"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_LAYER_3" value="34"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_MAIN_SYNTHETIC" value="13"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_MPEG_SURROUND" value="30"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_PS" value="29"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_SBR" value="5"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_SLS_NON_CORE" value="38"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_SLS" value="37"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_SMR_MAIN" value="41"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_SMR_SIMPLE" value="40"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_SSC" value="28"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_TTSI" value="12"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_TWINVQ" value="7"/>
|
||||
<define name="AP4_MPEG4_AUDIO_OBJECT_TYPE_WAVETABLE_SYNTHESIS" value="14"/>
|
||||
<define name="AP4_OMA_DCF_ENCRYPTION_METHOD_AES_CBC" value="1"/>
|
||||
<define name="AP4_OMA_DCF_ENCRYPTION_METHOD_AES_CTR" value="2"/>
|
||||
<define name="AP4_OMA_DCF_ENCRYPTION_METHOD_NULL" value="0"/>
|
||||
<define name="AP4_OMA_DCF_PADDING_SCHEME_NONE" value="0"/>
|
||||
<define name="AP4_OMA_DCF_PADDING_SCHEME_RFC_2630" value="1"/>
|
||||
<define name="AP4_PROTECTION_SCHEME_VERSION_CENC_10" value="0x00010000"/>
|
||||
<define name="AP4_PROTECTION_SCHEME_VERSION_OMA_20" value="0x00000200"/>
|
||||
<define name="AP4_PROTECTION_SCHEME_VERSION_PIFF_10" value="0x00010000"/>
|
||||
<define name="AP4_PROTECTION_SCHEME_VERSION_PIFF_11" value="0x00010001"/>
|
||||
<define name="AP4_TFHD_FLAG_BASE_DATA_OFFSET_PRESENT" value="0x00001"/>
|
||||
<define name="AP4_TFHD_FLAG_DEFAULT_BASE_IS_MOOF" value="0x20000"/>
|
||||
<define name="AP4_TFHD_FLAG_DEFAULT_SAMPLE_DURATION_PRESENT" value="0x00008"/>
|
||||
<define name="AP4_TFHD_FLAG_DEFAULT_SAMPLE_FLAGS_PRESENT" value="0x00020"/>
|
||||
<define name="AP4_TFHD_FLAG_DEFAULT_SAMPLE_SIZE_PRESENT" value="0x00010"/>
|
||||
<define name="AP4_TFHD_FLAG_DURATION_IS_EMPTY" value="0x10000"/>
|
||||
<define name="AP4_TFHD_FLAG_SAMPLE_DESCRIPTION_INDEX_PRESENT" value="0x00002"/>
|
||||
<define name="AP4_TRACK_DEFAULT_MOVIE_TIMESCALE" value="1000"/>
|
||||
<define name="AP4_TRACK_FLAG_ENABLED" value="0x0001"/>
|
||||
<define name="AP4_TRACK_FLAG_IN_MOVIE" value="0x0002"/>
|
||||
<define name="AP4_TRACK_FLAG_IN_PREVIEW" value="0x0004"/>
|
||||
<define name="AP4_TRUN_FLAG_DATA_OFFSET_PRESENT" value="0x0001"/>
|
||||
<define name="AP4_TRUN_FLAG_FIRST_SAMPLE_FLAGS_PRESENT" value="0x0004"/>
|
||||
<define name="AP4_TRUN_FLAG_SAMPLE_COMPOSITION_TIME_OFFSET_PRESENT" value="0x0800"/>
|
||||
<define name="AP4_TRUN_FLAG_SAMPLE_DURATION_PRESENT" value="0x0100"/>
|
||||
<define name="AP4_TRUN_FLAG_SAMPLE_FLAGS_PRESENT" value="0x0400"/>
|
||||
<define name="AP4_TRUN_FLAG_SAMPLE_SIZE_PRESENT" value="0x0200"/>
|
||||
<podtype name="AP4_UI08" sign="u" size="1"/>
|
||||
<podtype name="AP4_UI16" sign="u" size="2"/>
|
||||
<podtype name="AP4_UI32" sign="u" size="4"/>
|
||||
<podtype name="AP4_Result" sign="s" size="4"/>
|
||||
<function name="BitWriter::Write">
|
||||
<noreturn>false</noreturn>
|
||||
<arg nr="1">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
</def>
|
331
cfg/boost.cfg
331
cfg/boost.cfg
|
@ -11,56 +11,29 @@
|
|||
<define name="BOOST_CLASS_VERSION(class,version)" value=""/>
|
||||
<define name="BOOST_TYPEOF_REGISTER_TYPE(x)" 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_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_REPEAT(a,b,c)" value=""/>
|
||||
<define name="BOOST_PP_STRINGIZE(t)" value=""/>
|
||||
<!-- https://www.boost.org/doc/libs/master/doc/html/foreach.html -->
|
||||
<define name="BOOST_FOREACH(A,B)" value="for (A: B)"/>
|
||||
<!-- https://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html -->
|
||||
<define name="BOOST_FORCEINLINE" value="inline"/>
|
||||
<define name="BOOST_NOINLINE" value=""/>
|
||||
<define name="BOOST_NORETURN" value="[[noreturn]]"/>
|
||||
<define name="BOOST_THROW_EXCEPTION(X)" value="boost::throw_exception(X)"/>
|
||||
<define name="BOOST_LIKELY(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_END()" value="};"/>
|
||||
<define name="BOOST_FIXTURE_TEST_SUITE(...)" value=""/>
|
||||
<define name="BOOST_FIXTURE_TEST_SUITE_END()" value=""/>
|
||||
<define name="BOOST_TEST_GLOBAL_FIXTURE(name)" 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_END()" value="}" />
|
||||
<define name="BOOST_AUTO_TEST_SUITE(...)" value=""/>
|
||||
<define name="BOOST_AUTO_TEST_SUITE_END()" value=""/>
|
||||
<define name="BOOST_ASSERT(condition)" value="assert(condition)"/>
|
||||
<define name="BOOST_TEST(condition, ...)" value="static_cast<void>(static_cast<bool>(condition))" />
|
||||
<define name="BOOST_TEST_REQUIRE(condition, ...)" value="static_cast<void>(static_cast<bool>(condition))" />
|
||||
<define name="BOOST_WARN(condition)" value="static_cast<void>(static_cast<bool>(condition))" />
|
||||
<define name="BOOST_WARN_MESSAGE(condition, msg)" value="static_cast<void>(static_cast<bool>(condition)); std::string(msg)" />
|
||||
<define name="BOOST_WARN_EQUAL(a, b)" value="static_cast<void>((a) == (b))" />
|
||||
<define name="BOOST_WARN_NE(a, b)" value="static_cast<void>((a) != (b))" />
|
||||
<define name="BOOST_WARN_GT(a, b)" value="static_cast<void>((a) > (b))" />
|
||||
<define name="BOOST_WARN_GE(a, b)" value="static_cast<void>((a) >= (b))" />
|
||||
<define name="BOOST_WARN_LT(a, b)" value="static_cast<void>((a) < (b))" />
|
||||
<define name="BOOST_WARN_LE(a, b)" value="static_cast<void>((a) <= (b))" />
|
||||
<define name="BOOST_CHECK(condition)" value="static_cast<void>(static_cast<bool>(condition))" />
|
||||
<define name="BOOST_CHECK_MESSAGE(condition, msg)" value="static_cast<void>(static_cast<bool>(condition)); std::string(msg)" />
|
||||
<define name="BOOST_CHECK_EQUAL(a, b)" value="static_cast<void>((a) == (b))" />
|
||||
<define name="BOOST_CHECK_NE(a, b)" value="static_cast<void>((a) != (b))" />
|
||||
<define name="BOOST_CHECK_GT(a, b)" value="static_cast<void>((a) > (b))" />
|
||||
<define name="BOOST_CHECK_GE(a, b)" value="static_cast<void>((a) >= (b))" />
|
||||
<define name="BOOST_CHECK_LT(a, b)" value="static_cast<void>((a) < (b))" />
|
||||
<define name="BOOST_CHECK_LE(a, b)" value="static_cast<void>((a) <= (b))" />
|
||||
<define name="BOOST_REQUIRE(condition)" value="static_cast<void>(static_cast<bool>(condition))" />
|
||||
<define name="BOOST_REQUIRE_MESSAGE(condition, msg)" value="static_cast<void>(static_cast<bool>(condition)); std::string(msg)" />
|
||||
<define name="BOOST_REQUIRE_EQUAL(a, b)" value="static_cast<void>(static_cast<bool>((a) == (b)))" />
|
||||
<define name="BOOST_REQUIRE_NE(a, b)" value="static_cast<void>((a) != (b))" />
|
||||
<define name="BOOST_REQUIRE_GT(a, b)" value="static_cast<void>((a) > (b))" />
|
||||
<define name="BOOST_REQUIRE_GE(a, b)" value="static_cast<void>((a) >= (b))" />
|
||||
<define name="BOOST_REQUIRE_LT(a, b)" value="static_cast<void>((a) < (b))" />
|
||||
<define name="BOOST_REQUIRE_LE(a, b)" value="static_cast<void>((a) <= (b))" />
|
||||
<define name="BOOST_TEST(condition)" value="assert(condition)"/>
|
||||
<define name="BOOST_WARN(condition)" value="assert(condition)"/>
|
||||
<define name="BOOST_CHECK(condition)" value="assert(condition)"/>
|
||||
<define name="BOOST_REQUIRE(condition)" value="assert(condition)"/>
|
||||
<define name="BOOST_CHECK_EQUAL(a,b)" value="assert((a) == (b))"/>
|
||||
<define name="BOOST_WARN_EQUAL(a,b)" value="assert((a) == (b))"/>
|
||||
<define name="BOOST_REQUIRE_EQUAL(a,b)" value="assert((a) == (b))"/>
|
||||
<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 -->
|
||||
<define name="BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS" value=""/>
|
||||
<define name="BOOST_MATH_USE_FLOAT128" value=""/>
|
||||
|
@ -85,17 +58,8 @@
|
|||
<define name="BOOST_MATH_INT_VALUE_SUFFIX" value=""/>
|
||||
<!-- 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_FIXTURE_TEST_CASE(name, fixture, ...)" value="struct name : fixture { void test_method(); }; void name::test_method()" />
|
||||
<define name="BOOST_FIXTURE_TEST_CASE_TEMPLATE(test_name, type_name, TL, F)" value="template<typename type_name> struct test_name : public F { void test_method(); }; template<typename type_name> void test_name<type_name>::test_method()" />
|
||||
<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_FIXTURE_TEST_CASE(...)" value="void BOOST_FIXTURE_TEST_CASE_run(__VA_ARGS__)"/>
|
||||
<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_END(x)" value=""/>
|
||||
<define name="BOOST_TTI_HAS_TYPE(x)" value=""/>
|
||||
<define name="BOOST_TTI_HAS_TYPE(x)" value=""/>
|
||||
<define name="BOOST_TTI_MEMBER_TYPE(x)" value=""/>
|
||||
<define name="BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(x)" value=""/>
|
||||
<!-- ########## Boost containers ########## -->
|
||||
<!-- boost containers that are similar to std containers -->
|
||||
<container id="boostArray" startPattern="boost :: array|scoped_array <" inherits="stdArray"/>
|
||||
|
@ -108,24 +72,19 @@
|
|||
<container id="boostVector" startPattern="boost :: vector|small_vector <" inherits="stdVector"/>
|
||||
<container id="boostStableVector" startPattern="boost :: stable_vector|static_vector <" inherits="stdVectorDeque"/>
|
||||
<container id="boostDeque" startPattern="boost :: deque <" inherits="stdDeque"/>
|
||||
<container id="boostStringView" startPattern="boost :: string_view" inherits="stdStringView"/>
|
||||
<!-- ########## Boost smart pointers ########## -->
|
||||
<!-- https://www.boost.org/doc/libs/1_70_0/libs/smart_ptr/doc/html/smart_ptr.html -->
|
||||
<smart-pointer class-name="boost::scoped_ptr">
|
||||
<unique/>
|
||||
</smart-pointer>
|
||||
<smart-pointer class-name="boost::scoped_ptr"/>
|
||||
<!-- <smart-pointer class-name="boost::scoped_array"/> Already configured as container -->
|
||||
<smart-pointer class-name="boost::shared_ptr"/>
|
||||
<smart-pointer class-name="boost::weak_ptr"/>
|
||||
<smart-pointer class-name="boost::intrusive_ptr"/>
|
||||
<smart-pointer class-name="boost::local_shared_ptr"/>
|
||||
<!-- https://www.boost.org/doc/libs/1_70_0/doc/html/boost/movelib/unique_ptr.html -->
|
||||
<smart-pointer class-name="boost::movelib::unique_ptr">
|
||||
<unique/>
|
||||
</smart-pointer>
|
||||
<smart-pointer class-name="boost::movelib::unique_ptr"/>
|
||||
<!-- ########## Boost functions ########## -->
|
||||
<!-- https://www.boost.org/doc/libs/1_69_0/doc/html/boost/algorithm/join.html -->
|
||||
<!-- template<typename SequenceSequenceT, typename Range1T>
|
||||
<!-- template<typename SequenceSequenceT, typename Range1T>
|
||||
range_value< SequenceSequenceT >::type join(const SequenceSequenceT & Input, const Range1T & Separator); -->
|
||||
<function name="boost::algorithm::join">
|
||||
<noreturn>false</noreturn>
|
||||
|
@ -801,63 +760,6 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- std::time_t last_write_time(const path& p); -->
|
||||
<!-- std::time_t last_write_time(const path& p, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::last_write_time">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="time_t"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- void permissions(const path& p, perms prms); -->
|
||||
<!-- void permissions(const path& p, perms prms, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::permissions">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="void"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="3" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- path read_symlink(const path& p); -->
|
||||
<!-- path read_symlink(const path& p, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::read_symlink">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="path"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- path relative(const path& p, system::error_code& ec); -->
|
||||
<!-- path relative(const path& p, const path& base=current_path()); -->
|
||||
<!-- path relative(const path& p, const path& base, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::relative">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="path"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- bool equivalent(const path& p1, const path& p2); -->
|
||||
<!-- bool equivalent(const path& p1, const path& p2, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::equivalent">
|
||||
|
@ -877,35 +779,6 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- uintmax_t file_size(const path& p); -->
|
||||
<!-- uintmax_t file_size(const path& p, system::error_code& ec); -->
|
||||
<!-- uintmax_t hard_link_count(const path& p); -->
|
||||
<!-- uintmax_t hard_link_count(const path& p, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::file_size,boost::filesystem::hard_link_count">
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="uintmax_t"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- const path& initial_path(); -->
|
||||
<!-- const path& initial_path(system::error_code& ec); -->
|
||||
<function name="boost::filesystem::initial_path">
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="const path &"/>
|
||||
<arg nr="1" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- boost::filesystem actions -->
|
||||
<!-- bool remove(const path& p); -->
|
||||
<!-- bool remove(const path& p, system::error_code& ec); -->
|
||||
|
@ -937,174 +810,6 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- void rename(const path& old_p, const path& new_p); -->
|
||||
<!-- void rename(const path& old_p, const path& new_p, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::rename">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="void"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
<arg nr="3" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- void resize_file(const path& p, uintmax_t new_size); -->
|
||||
<!-- void resize_file(const path& p, uintmax_t new_size, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::resize_file">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="void"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="3" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- space_info space(const path& p); -->
|
||||
<!-- space_info space(const path& p, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::space">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="space_info"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- file_status status(const path& p); -->
|
||||
<!-- file_status status(const path& p, system::error_code& ec) noexcept; -->
|
||||
<function name="boost::filesystem::status">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="file_status"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- bool status_known(file_status s) noexcept; -->
|
||||
<function name="boost::filesystem::status_known">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="bool"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- file_status symlink_status(const path& p); -->
|
||||
<!-- file_status symlink_status(const path& p, system::error_code& ec) noexcept; -->
|
||||
<function name="boost::filesystem::symlink_status">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="file_status"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- path system_complete(const path& p); -->
|
||||
<!-- path system_complete(const path& p, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::system_complete">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="path"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- path temp_directory_path(); -->
|
||||
<!-- path temp_directory_path(system::error_code& ec); -->
|
||||
<function name="boost::filesystem::temp_directory_path">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="path"/>
|
||||
<arg nr="1" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- path unique_path(const path& model="%%%%-%%%%-%%%%-%%%%"); -->
|
||||
<!-- path unique_path(const path& model, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::unique_path">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="path"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- path weakly_canonical(const path& p); -->
|
||||
<!-- path weakly_canonical(const path& p, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::weakly_canonical">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="path"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="0" direction="out">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- path absolute(const path& p, const path& base=current_path()); -->
|
||||
<function name="boost::filesystem::absolute">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="path"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" default="current_path()" direction="in">
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- path canonical(const path& p, const path& base = current_path()); -->
|
||||
<!-- path canonical(const path& p, system::error_code& ec); -->
|
||||
<!-- path canonical(const path& p, const path& base, system::error_code& ec); -->
|
||||
<function name="boost::filesystem::canonical">
|
||||
<noreturn>false</noreturn>
|
||||
<pure/>
|
||||
<leak-ignore/>
|
||||
<returnValue type="path"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- void copy(const path& from, const path& to); -->
|
||||
<!-- void copy(const path& from, const path& to, system::error_code& ec); -->
|
||||
<!-- void copy_directory(const path& from, const path& to); -->
|
||||
|
@ -1263,10 +968,4 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<function name="boost::throw_exception">
|
||||
<noreturn>true</noreturn>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
</def>
|
||||
|
|
250
cfg/bsd.cfg
250
cfg/bsd.cfg
|
@ -181,7 +181,6 @@
|
|||
<returnValue type="size_t"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
|
||||
<arg nr="1">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
|
@ -204,7 +203,6 @@
|
|||
<returnValue type="size_t"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
|
||||
<arg nr="1">
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
|
@ -218,176 +216,6 @@
|
|||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/3/setbuffer -->
|
||||
<!-- void setbuffer(FILE *stream, char *buf, size_t size); -->
|
||||
<function name="setbuffer">
|
||||
<returnValue type="void"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1" direction="inout">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2">
|
||||
<not-uninit/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/3/setbuffer -->
|
||||
<!-- void setlinebuf(FILE *stream); -->
|
||||
<function name="setlinebuf">
|
||||
<returnValue type="void"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1" direction="inout">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/2/writev -->
|
||||
<!-- ssize_t readv(int fd, const struct iovec *iov, int iovcnt); -->
|
||||
<function name="readv">
|
||||
<leak-ignore/>
|
||||
<returnValue type="ssize_t"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="2" direction="out">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/2/writev -->
|
||||
<!-- ssize_t writev(int fd, const struct iovec *iov, int iovcnt); -->
|
||||
<function name="writev">
|
||||
<leak-ignore/>
|
||||
<returnValue type="ssize_t"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/2/writev -->
|
||||
<!-- ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset); -->
|
||||
<function name="preadv">
|
||||
<leak-ignore/>
|
||||
<returnValue type="ssize_t"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="2" direction="out">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/2/writev -->
|
||||
<!-- ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags); -->
|
||||
<function name="preadv2">
|
||||
<leak-ignore/>
|
||||
<returnValue type="ssize_t"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="2" direction="out">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="5" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/2/writev -->
|
||||
<!-- ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset); -->
|
||||
<function name="pwritev">
|
||||
<leak-ignore/>
|
||||
<returnValue type="ssize_t"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/2/writev -->
|
||||
<!-- ssize_t pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags); -->
|
||||
<function name="pwritev2">
|
||||
<leak-ignore/>
|
||||
<returnValue type="ssize_t"/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="5" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://www.freebsd.org/cgi/man.cgi?query=arc4random -->
|
||||
<!-- uint32_t arc4random(void); -->
|
||||
<function name="arc4random">
|
||||
|
@ -400,7 +228,7 @@
|
|||
<noreturn>false</noreturn>
|
||||
<returnValue type="void"/>
|
||||
<leak-ignore/>
|
||||
<arg nr="1" direction="out">
|
||||
<arg nr="1">
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="2"/>
|
||||
</arg>
|
||||
|
@ -465,82 +293,6 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</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="FTSENT"/>
|
||||
<!-- This type definitions refer to https://mandoc.bsd.lv/includes/sys/types.h.html -->
|
||||
<podtype name="u_char" sign="u" stdtype="char"/>
|
||||
<podtype name="u_short" sign="u" stdtype="short"/>
|
||||
<podtype name="u_int" sign="u" stdtype="int"/>
|
||||
<podtype name="u_long" sign="u" stdtype="long"/>
|
||||
<!-- Sys V compatibility types -->
|
||||
<podtype name="unchar" sign="u" stdtype="char"/>
|
||||
<podtype name="ushort" sign="u" stdtype="short"/>
|
||||
<podtype name="uint" sign="u" stdtype="int"/>
|
||||
<podtype name="ulong" sign="u" stdtype="long"/>
|
||||
<!-- https://linux.die.net/man/3/tailq_head -->
|
||||
<define name="TAILQ_HEAD(name,type)" value="struct name { type *first; type *last; }"/>
|
||||
<!-- https://man7.org/linux/man-pages/man2/lseek.2.html :
|
||||
Conforming to:
|
||||
SEEK_DATA and SEEK_HOLE are nonstandard extensions also present
|
||||
in Solaris, FreeBSD, and DragonFly BSD; they are proposed for
|
||||
inclusion in the next POSIX revision (Issue 8).-->
|
||||
<define name="SEEK_DATA" value="3"/>
|
||||
<define name="SEEK_HOLE" value="4"/>
|
||||
<!-- Old BSD names for the same constants; just for compatibility. -->
|
||||
<define name="L_INCR" value="SEEK_CUR"/>
|
||||
<define name="L_SET" value="SEEK_SET"/>
|
||||
<define name="L_XTND" value="SEEK_END"/>
|
||||
</def>
|
||||
|
|
1356
cfg/cppcheck-cfg.rng
1356
cfg/cppcheck-cfg.rng
File diff suppressed because it is too large
Load Diff
|
@ -5,13 +5,13 @@
|
|||
<define name="CPPUNIT_TEST(test)" value=""/>
|
||||
<define name="CPPUNIT_TEST_SUITE_END()" value=""/>
|
||||
<!-- Macros see http://cppunit.sourceforge.net/doc/cvs/group___assertions.html -->
|
||||
<define name="CPPUNIT_ASSERT(condition)" value="{if (!(condition)) throw false;}"/>
|
||||
<define name="CPPUNIT_ASSERT_MESSAGE(message, condition)" value="{if (!(condition)) throw message;}"/>
|
||||
<define name="CPPUNIT_FAIL(message)" value="throw message;"/>
|
||||
<define name="CPPUNIT_ASSERT_EQUAL(expected, actual)" value="{if ((expected) != (actual)) throw false;}"/>
|
||||
<define name="CPPUNIT_ASSERT_EQUAL_MESSAGE(message, expected, actual)" value="{if ((expected) != (actual)) throw message;}"/>
|
||||
<define name="CPPUNIT_ASSERT_DOUBLES_EQUAL(expected, actual, delta)" value="{if (std::abs((expected) - (actual)) > delta) throw false;}"/>
|
||||
<define name="CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(message, expected, actual, delta)" value="{if (std::abs((expected) - (actual)) > delta) throw message;}"/>
|
||||
<define name="CPPUNIT_ASSERT(condition)" value=""/>
|
||||
<define name="CPPUNIT_ASSERT_MESSAGE(message, condition)" value=""/>
|
||||
<define name="CPPUNIT_FAIL(message)" value=""/>
|
||||
<define name="CPPUNIT_ASSERT_EQUAL(expected, actual)" value=""/>
|
||||
<define name="CPPUNIT_ASSERT_EQUAL_MESSAGE(message, expected, actual)" value=""/>
|
||||
<define name="CPPUNIT_ASSERT_DOUBLES_EQUAL(expected, actual, delta)" value=""/>
|
||||
<define name="CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(message, expected, actual, delta)" value=""/>
|
||||
<define name="CPPUNIT_ASSERT_THROW(expression, ExceptionType)" value=""/>
|
||||
<define name="CPPUNIT_ASSERT_THROW_MESSAGE(message, expression, ExceptionType)" value=""/>
|
||||
<define name="CPPUNIT_ASSERT_NO_THROW(expression)" value=""/>
|
||||
|
|
|
@ -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<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>arg2?arg1:arg2</returnValue>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
</def>
|
11
cfg/dpdk.cfg
11
cfg/dpdk.cfg
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<def format="2">
|
||||
<function name="rte_panic">
|
||||
<noreturn>true</noreturn>
|
||||
<formatstr/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<formatstr/>
|
||||
</arg>
|
||||
</function>
|
||||
</def>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<def format="2">
|
||||
<define name="EM_ASM(...)" value=""/>
|
||||
<define name="EM_JS(...)" value=""/>
|
||||
<define name="MAIN_THREAD_EM_ASM(...)" value=""/>
|
||||
<define name="EMSCRIPTEN_BINDINGS(...)" value=""/>
|
||||
</def>
|
12848
cfg/ginac.cfg
12848
cfg/ginac.cfg
File diff suppressed because it is too large
Load Diff
356
cfg/gnu.cfg
356
cfg/gnu.cfg
|
@ -25,45 +25,15 @@
|
|||
<alloc init="false" buffer-size="malloc">pvalloc</alloc>
|
||||
<dealloc>free</dealloc>
|
||||
</memory>
|
||||
<function name="bswap_16">
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<returnValue type="uint16_t">((arg1 & 0xff00u) >> 8) | ((arg1 & 0x00ffu) << 8)</returnValue>
|
||||
<leak-ignore/>
|
||||
<const/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<define name="bswap_16(x)" value="((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))"/>
|
||||
<define name="__bswap_constant_16(x)" value="bswap_16(x)"/>
|
||||
<define name="__builtin_bswap16(x)" value="bswap_16(x)"/>
|
||||
<define name="__bswap_16(x)" value="bswap_16(x)"/>
|
||||
<function name="bswap_32">
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<returnValue type="uint32_t">((arg1 & 0xff000000ul) >> 24) | ((arg1 & 0x00ff0000ul) >> 8) | ((arg1 & 0x0000ff00ul) << 8) | ((arg1 & 0x000000fful) << 24)</returnValue>
|
||||
<leak-ignore/>
|
||||
<const/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<define name="bswap_32(x)" value="((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))"/>
|
||||
<define name="__bswap_constant_32(x)" value="bswap_32(x)"/>
|
||||
<define name="__builtin_bswap32(x)" value="bswap_32(x)"/>
|
||||
<define name="__bswap_32(x)" value="bswap_32(x)"/>
|
||||
<function name="bswap_64">
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<returnValue type="uint64_t">((arg1 & 0xff00000000000000ull) >> 56) | ((arg1 & 0x00ff000000000000ull) >> 40) | ((arg1 & 0x0000ff0000000000ull) >> 24) | ((arg1 & 0x000000ff00000000ull) >> 8) | ((arg1 & 0x00000000ff000000ull) << 8) | ((arg1 & 0x0000000000ff0000ull) << 24) | ((arg1 & 0x000000000000ff00ull) << 40) | ((arg1 & 0x00000000000000ffull) << 56)</returnValue>
|
||||
<leak-ignore/>
|
||||
<const/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<define name="bswap_64(x)" value="((((x) & 0xff00000000000000ull) >> 56) | (((x) & 0x00ff000000000000ull) >> 40) | (((x) & 0x0000ff0000000000ull) >> 24) | (((x) & 0x000000ff00000000ull) >> 8) | (((x) & 0x00000000ff000000ull) << 8) | (((x) & 0x0000000000ff0000ull) << 24) | (((x) & 0x000000000000ff00ull) << 40) | (((x) & 0x00000000000000ffull) << 56))"/>
|
||||
<define name="__bswap_constant_64(x)" value="bswap_64(x)"/>
|
||||
<define name="__builtin_bswap64(x)" value="bswap_64(x)"/>
|
||||
<define name="__bswap_64(x)" value="bswap_64(x)"/>
|
||||
|
@ -92,34 +62,6 @@
|
|||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man2/semop.2.html -->
|
||||
<!-- int semtimedop(int semid, struct sembuf *sops, size_t nsops, const struct timespec *timeout); -->
|
||||
<function name="semtimedop">
|
||||
<noreturn>false</noreturn>
|
||||
<returnValue type="int"/>
|
||||
<use-retval/>
|
||||
<leak-ignore/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="2" direction="out">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<!-- If the timeout argument is NULL, then semtimedop() behaves exactly like semop() -->
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- void * __builtin_assume_aligned (const void *exp, size_t align, ...) -->
|
||||
<!-- This function can have either two or three arguments, if it has three, the third argument should have integer type. -->
|
||||
<function name="__builtin_assume_aligned">
|
||||
|
@ -143,7 +85,6 @@
|
|||
<noreturn>false</noreturn>
|
||||
<returnValue type="void *"/>
|
||||
<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"/>
|
||||
|
@ -168,19 +109,6 @@
|
|||
<arg nr="variadic" direction="in">
|
||||
<not-uninit/>
|
||||
</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>
|
||||
<!-- https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/Alignment.html -->
|
||||
<!-- __alignof__ is used like sizeof -->
|
||||
|
@ -213,21 +141,6 @@
|
|||
<not-null/>
|
||||
</arg>
|
||||
</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 timersub(struct timeval *a, struct timeval *b, struct timeval *res);-->
|
||||
<function name="timeradd,timersub">
|
||||
|
@ -276,50 +189,6 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/mempcpy.3.html-->
|
||||
<!-- wchar_t *wmempcpy(wchar_t *restrict dest, const wchar_t *restrict src, size_t n);-->
|
||||
<function name="wmempcpy">
|
||||
<returnValue type="wchar_t *"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
|
||||
<arg nr="1" direction="out">
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/mempcpy.3.html-->
|
||||
<!-- void *mempcpy(void *restrict dest, const void *restrict src, size_t n);-->
|
||||
<function name="mempcpy">
|
||||
<returnValue type="void *"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
|
||||
<arg nr="1" direction="out">
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- void xexit(int status); -->
|
||||
<function name="xexit">
|
||||
<noreturn>true</noreturn>
|
||||
|
@ -346,7 +215,6 @@
|
|||
<not-null/>
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<strz/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- void xfree(void *block); -->
|
||||
|
@ -414,7 +282,7 @@
|
|||
<arg nr="1" direction="out">
|
||||
<not-null/>
|
||||
<not-bool/>
|
||||
<minsize type="value" value="2" baseType="int"/>
|
||||
<minsize type="value" value="2"/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
|
@ -471,7 +339,6 @@
|
|||
<arg nr="2" direction="in">
|
||||
<formatstr/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- int isascii_l(int c, locale_t locale); -->
|
||||
|
@ -501,7 +368,6 @@
|
|||
<arg nr="2" direction="in">
|
||||
<formatstr/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
|
@ -530,114 +396,6 @@
|
|||
</arg>
|
||||
<leak-ignore/>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/gethostbyaddr_r.3.html -->
|
||||
<!-- int gethostbyaddr_r(const void *addr, socklen_t len, int type, struct hostent *restrict ret, char *restrict buf, size_t buflen, struct hostent **restrict result, int *restrict h_errnop); -->
|
||||
<function name="gethostbyaddr_r">
|
||||
<returnValue type="int"/>
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="4" direction="out">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="5" direction="in">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="6"/>
|
||||
</arg>
|
||||
<arg nr="6" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="7" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="8" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/gethostbyname2_r.3.html -->
|
||||
<!-- int gethostbyname2_r(const char *name, int af, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -->
|
||||
<function name="gethostbyname2_r">
|
||||
<returnValue type="int"/>
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="3" direction="out">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="5"/>
|
||||
</arg>
|
||||
<arg nr="5" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="6" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="7" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/gethostbyname_r.3.html -->
|
||||
<!-- int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -->
|
||||
<function name="gethostbyname_r">
|
||||
<returnValue type="int"/>
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="2" direction="out">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="4"/>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="5" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="6" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html#Getopt-Long-Options -->
|
||||
<!-- int getopt_long(int argc, char * const argv[],
|
||||
const char *optstring,
|
||||
|
@ -678,7 +436,6 @@
|
|||
<not-null/>
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<strz/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- char *strndupa(const char *s, size_t n); -->
|
||||
|
@ -689,7 +446,6 @@
|
|||
<arg nr="1" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
|
@ -729,7 +485,6 @@
|
|||
<not-uninit/>
|
||||
<not-null/>
|
||||
<not-bool/>
|
||||
<strz/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- char *strdupa(const char *s); -->
|
||||
|
@ -741,7 +496,6 @@
|
|||
<not-null/>
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<strz/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- http://www.gnu.org/software/libc/manual/html_node/Backtraces.html -->
|
||||
|
@ -842,30 +596,6 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/getservent_r.3.html -->
|
||||
<!-- int getservent_r(struct servent *restrict result_buf, char *restrict buf, size_t buflen, struct servent **restrict result); -->
|
||||
<function name="getservent_r">
|
||||
<returnValue type="int"/>
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<arg nr="1" direction="out">
|
||||
<not-null/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/3/ecvt_r -->
|
||||
<!-- int ecvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
||||
<function name="ecvt_r">
|
||||
|
@ -980,23 +710,21 @@
|
|||
<warn severity="style" reason="Obsolescent" alternatives="sprintf"/>
|
||||
</function>
|
||||
<!-- https://www.gnu.org/software/gnulib/manual/html_node/c_002dstrcasestr.html -->
|
||||
<!-- char* strcasestr(const char *s1, const char *s2); -->
|
||||
<!-- size_t strcasestr(const char *s1, const char *s2); -->
|
||||
<function name="strcasestr">
|
||||
<use-retval/>
|
||||
<returnValue type="char *"/>
|
||||
<returnValue type="size_t"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<pure/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<strz/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- http://linux.die.net/man/2/getresuid -->
|
||||
|
@ -1076,7 +804,6 @@
|
|||
<arg nr="1">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="2">
|
||||
<not-null/>
|
||||
|
@ -1091,7 +818,6 @@
|
|||
<not-uninit/>
|
||||
<not-null/>
|
||||
<not-bool/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<leak-ignore/>
|
||||
</function>
|
||||
|
@ -1143,7 +869,6 @@
|
|||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
<not-null/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="3" direction="out">
|
||||
<not-null/>
|
||||
|
@ -1182,7 +907,6 @@
|
|||
<arg nr="1" direction="in">
|
||||
<not-null/>
|
||||
<not-bool/>
|
||||
<strz/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://linux.die.net/man/3/execvpe -->
|
||||
|
@ -1194,7 +918,6 @@
|
|||
<arg nr="1" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
|
@ -1273,7 +996,6 @@
|
|||
<arg nr="1" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
|
@ -1303,37 +1025,12 @@
|
|||
<valid>0:</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/qsort.3.html -->
|
||||
<!-- void qsort_r(void *base, size_t n, size_t size, int (*cmp)(const void *, const void *, void *), void *arg); -->
|
||||
<function name="qsort_r">
|
||||
<noreturn>false</noreturn>
|
||||
<returnValue type="void"/>
|
||||
<leak-ignore/>
|
||||
<arg nr="1" direction="inout">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<minsize type="argvalue" arg="2"/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="4" direction="out">
|
||||
<not-null/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- http://man7.org/linux/man-pages/man3/ffs.3.html -->
|
||||
<!-- int ffsl(long int i);
|
||||
int ffsll(long long int i); -->
|
||||
<function name="ffsl,ffsll">
|
||||
<use-retval/>
|
||||
<!-- It returns the position of the first bit set, or 0 if no bits are set in i. -->
|
||||
<returnValue type="int">arg1==0 &0</returnValue>
|
||||
<returnValue type="int"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1" direction="in">
|
||||
|
@ -1488,7 +1185,6 @@
|
|||
<not-null/>
|
||||
<not-uninit/>
|
||||
<minsize type="argvalue" arg="2"/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="2">
|
||||
<not-uninit/>
|
||||
|
@ -1541,25 +1237,6 @@
|
|||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- int euidaccess(const char *pathname, int mode); -->
|
||||
<!-- int eaccess(const char *pathname, int mode); -->
|
||||
<!-- Ref: https://man7.org/linux/man-pages/man3/euidaccess.3.html
|
||||
Conforming to: These functions are nonstandard. Some other systems have an eaccess() function. -->
|
||||
<function name="euidaccess,eaccess">
|
||||
<use-retval/>
|
||||
<returnValue type="int"/>
|
||||
<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>
|
||||
<!-- char * dcgettext (const char *domainname, const char *msgid, int category); -->
|
||||
<function name="dcgettext">
|
||||
<noreturn>false</noreturn>
|
||||
|
@ -1656,7 +1333,6 @@
|
|||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="3" direction="out">
|
||||
<not-null/>
|
||||
|
@ -1682,7 +1358,6 @@
|
|||
<arg nr="3" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="4" direction="out">
|
||||
<not-null/>
|
||||
|
@ -1693,17 +1368,6 @@
|
|||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/error.3.html -->
|
||||
<!-- void error(int status, int errnum, const char *format, ...); -->
|
||||
<!-- void error_at_line(int status, int errnum, const char *filename, unsigned int linenum, const char *format, ...); -->
|
||||
<function name="error,error_at_line">
|
||||
<noreturn>true</noreturn>
|
||||
<leak-ignore/>
|
||||
<returnValue type="void"/>
|
||||
<arg nr="any" direction="in">
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- ########## Resource allocation ########## -->
|
||||
<resource>
|
||||
<alloc init="true">mkostemp</alloc>
|
||||
|
@ -1727,10 +1391,4 @@
|
|||
<define name="SIGIO" value="29"/>
|
||||
<define name="SIGPWR" value="30"/>
|
||||
<define name="SIGUNUSED" value="31"/>
|
||||
<!-- see https://man7.org/linux/man-pages/man3/stdin.3.html -->
|
||||
<define name="STDIN_FILENO" value="0"/>
|
||||
<define name="STDOUT_FILENO" value="1"/>
|
||||
<define name="STDERR_FILENO" value="2"/>
|
||||
<entrypoint name="_init"/>
|
||||
<entrypoint name="_fini"/>
|
||||
</def>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue