Forrest logo
tool overview
On this page you find all important commands for the CLI tool cppcheck. If the command you are looking for is missing please ask our AI.

cppcheck

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 have very few false positives. Cppcheck is designed to be able to analyze your C/C++ code even if it has non-standard syntax (common in embedded projects).

List of commands for cppcheck:

  • cppcheck:tldr:3ac55 cppcheck: Recursively check the current directory, showing progress on the screen and logging error messages to a file.
    $ cppcheck . 2> cppcheck.log
    try on your machine
    explain this command
  • cppcheck:tldr:4d4d8 cppcheck: List available tests.
    $ cppcheck --errorlist
    try on your machine
    explain this command
  • cppcheck:tldr:51961 cppcheck: Check a given file, ignoring specific tests.
    $ cppcheck --suppress=${test_id1} --suppress=${test_id2} ${filename-cpp}
    try on your machine
    explain this command
  • cppcheck:tldr:69a42 cppcheck: Recursively check a given directory, and don't print progress messages.
    $ cppcheck --quiet ${path-to-directory}
    try on your machine
    explain this command
  • cppcheck:tldr:ab516 cppcheck: Check a Microsoft Visual Studio project (`*.vcxproj`) or solution (`*.sln`).
    $ cppcheck --project=${path-to-project-sln}
    try on your machine
    explain this command
  • cppcheck:tldr:dd69f cppcheck: Check a given file, specifying which tests to perform (by default only errors are shown).
    $ cppcheck --enable=${select} ${filename-cpp}
    try on your machine
    explain this command
  • cppcheck:tldr:f7392 cppcheck: 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} .
    try on your machine
    explain this command
tool overview