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.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments