Changeset 6d974a4 in mainline


Ignore:
Timestamp:
2020-03-11T11:11:23Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
172cae4c, 44dde42
Parents:
badfbc0
git-author:
Manuele Conti <manuele.conti@…> (2020-03-10 12:06:13)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2020-03-11 11:11:23)
Message:

Add cppcheck extra target to allow static analysis.
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 detect only real errors in the code (i.e. have very few false positives).
The original name of this program was "C++check", but it was later changed to "Cppcheck".
Despite the name, Cppcheck is designed for both C and C++.

To run target just type:
ninja cppcheck > /dev/null

Note: There is a problem with memory.cpp so cppcheck analysis ends about 30% completed.

Location:
meson/part
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • meson/part/extra_targets/meson.build

    rbadfbc0 r6d974a4  
    8282endif
    8383
     84if cppcheck.found()
     85        run_target('cppcheck', command: ['cppcheck', '--project=' +
     86                join_paths(meson.build_root(), 'compile_commands.json'),
     87                ' -q --force --file-list=*.c* --platform=unix32 --enable=all' ])
     88endif
     89
    8490# TODO text-xcw
    8591#ifeq ($(CONFIG_DEVEL_FILES),y)
  • meson/part/tools/meson.build

    rbadfbc0 r6d974a4  
    5454which = find_program('which')
    5555cpc = find_program(_tools_dir / 'cc.sh')
     56cppcheck = find_program('cppcheck', required: false)
    5657
    5758sh = [ find_program('sh'), '-u', '-e' ]
Note: See TracChangeset for help on using the changeset viewer.