cppcheck

cppcheck

TLDR

Recursively check the current directory, showing progress on the screen and logging error messages to a file

>_ cppcheck . 2> cppcheck.log
copy

Recursively check a given directory, and don't print progress messages

>_ cppcheck --quiet [path/to/directory]
copy

Check a given file, specifying which tests to perform (by default only errors are shown)

>_ cppcheck --enable=[error|warning|style|performance|portability|information|all] [path/to/file.cpp]
copy

List available tests

>_ cppcheck --errorlist
copy

Check a given file, ignoring specific tests

>_ cppcheck --suppress=[test_id1] --suppress=[test_id2] [path/to/file.cpp]
copy

Check the current directory, providing paths for include files located outside it (e.g. external libraries)

>_ cppcheck -I [include/directory_1] -I [include/directory_2] .
copy

Check a Microsoft Visual Studio project (*.vcxproj) or solution (*.sln)

>_ cppcheck --project=[path/to/project.sln]
copy

Copied to clipboard
free 100$ digital ocean credit