A Security/Safety Checker for C/C++ based on Clang-Tidy and Coccinelle.
pip install schecker
#!/usr/bin/python
import sys
import schecker
paths = [ './path/to/your/c/project' ]
excludes = [ './path/to/your/c/project/third-party' ]
scripts = ['schecker/tests/cocci-scripts/']
schecker = schecker.Schecker(paths, excludes=excludes)
schecker.options_coccinelle(script_dirs=scripts)
# now start the actual test, this may take some time
schecker.check_all(sys.stderr)
Schecker depends on clang-tidy and coccinelle, though it is possible to disable
the modules seperatly. E.g. you don't need coccinelle: Schecker(..., modules_disabled=['coccinelle'])
sudo aptitude install clang-tidy coccinelle