Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers and many other analysis tools, it doesn't detect syntax errors. Cppcheck only detects the types of bugs that the compilers normally fail to detect. The goal is no false positives.
We recommend that you enable as many warnings as possible in your compiler.
Supported platforms:
Cppcheck is far from finished, it is continuously improved to make it more accurate.
Cppcheck is rarely wrong about reported errors. But there are many bugs that it doesn't detect.
You will find more bugs in your software by testing your software carefully, than by using Cppcheck.
You will find more bugs in your software by instrumenting your software (with for example http://valgrind.org/), than by using Cppcheck.
It is unlikely that you will find all the bugs in your software through testing and instrumenting. Cppcheck can detect some of the bugs that you have missed.
The Cppcheck manual is available as HTML and PDF.
Articles about writing rules.
Part 1 - Getting started
Part 2 - Data representation
Part 3 - Introduction to C++ rules
This article talks about the internal data in Cppcheck.
This article discuss the philosphy of Cppcheck - how we try to avoid false warnings.
Cppcheck can be used from many popular development tools.
Cppcheck has many different kinds of checks. A full list is available.
To suggest a new checker, please use Trac.
IRC channel:
channel: #cppcheck
server: irc://irc.libera.chat
The IRC channel can be access with a web browser: https://web.libera.chat/
Forum: http://sourceforge.net/p/cppcheck/discussion/
We make about 5-6 releases / year.
Use Trac to report any problems: Trac
''Defects'' are for severe bugs such as:
''Enhancements'' are for issues such as:
You are welcome to contribute. Help is needed.
Latest version can be found in the cppcheck git repository.
To get the source code using git:
git clone git://github.com/danmar/cppcheck.git
To get the source code using subversion:
svn checkout https://github.com/danmar/cppcheck/trunk
You can also download the latest sources in a zip archive from the github website.
Here are some of the found bugs that have been fixed:
Wiki: Found_bugs
Wiki: ListOfChecks
Wiki: mercurialhook
Wiki: tortoisesvn