Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e6c2ccc in mainline


Ignore:
Timestamp:
2020-03-10T12:06:13Z (4 weeks ago)
Author:
Manuele Conti <manuele.conti@…>
Parents:
dd90608
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

    rdd90608 re6c2ccc  
    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

    rdd90608 re6c2ccc  
    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.