Cppcheck – static analysis tool

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).

This is free and open source software.

Key Features

  • Unique code analysis that detect various kinds of bugs in your code.
    • Uses unsound flow sensitive analysis. Several other analyzers use path sensitive analysis based on abstract interpretation, that is also great however that has both advantages and disadvantages. In theory by definition, it is better with path sensitive analysis than flow sensitive analysis. But in practice, it means Cppcheck will detect bugs that the other tools do not detect.
  • Both command line interface and graphical user interface are available.
  • Cppcheck has a strong focus on detecting undefined behaviour:
    • Dead pointers.
    • Division by zero.
    • Integer overflows.
    • Invalid bit shift operands.
    • Invalid conversions.
    • Invalid usage of STL.
    • Memory management.
    • Null pointer dereferences.
    • Out of bounds checking.
    • Uninitialized variables.
    • Writing const data.

Website: cppcheck.sourceforge.io
Support:
Developer: Many contributors
License: GNU General Public License v3.0

Cppcheck is written in C++. Learn C++ with our recommended free books and free tutorials.


Related Software

CSS Linter Tools
StylelintCSS linter that helps you avoid errors and enforce conventions
CSSLintCSS code quality tool
SCSS-LintKeep SCSS files clean and readable
CppcheckStatic analysis tool
postcss-bem-linterBEM linter for PostCSS

Read our verdict in the software roundup.

C and C++ Linters
OCLintStatic code analysis tool for improving quality and reducing defects
cpplintStatic code checker for C++
UncrustifySource code beautifer
Include What You UseSource analysis tool for C and C++ projects built on Clang
CppcheckStatic analysis tool for C/C++ code
ClangFormatCode formatting tool
Clang-TidyClang-based C++ “linter” tool

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted