cppcheck Command Examples

A static analysis tool for C/C++ code. Instead of syntax errors, it focuses on the types of bugs that compilers normally do not detect. More information: https://cppcheck.sourceforge.net.

cppcheck . 2> cppcheck.log

cppcheck --quiet {{path/to/directory}}

cppcheck --enable {{error|warning|style|performance|portability|information|all}} {{path/to/file.cpp}}

cppcheck --errorlist

cppcheck --suppress {{test_id1}} --suppress {{test_id2}} {{path/to/file.cpp}}

cppcheck -I {{include/directory_1}} -I {{include/directory_2}} .

cppcheck --project {{path/to/project.sln}}