winget install --id Cppcheck.Cppcheck
About Cppcheck
Cppcheck is a static analysis tool for C/C++ code. Unlike C/C++ compilers and many other analysis tools it does not detect syntax errors in the code. Cppcheck primarily detects the types of bugs that the compilers normally do not detect. The goal is to detect only real errors in the code (i.e. have zero false positives).
What's new in 2.21.0
Release Notes for Cppcheck 2.21 Major bug fixes & crashes: - Fixed potential crash with incomplete preprocessor directive - Fixed hang in createAst - Fixed invalid AST for braced initialization and references/pointers - Fixed cppcheckError with array typedef - Fixed recheck which now correctly excludes non selected files - Fixed potential crash when rechecking files in gui New checks: - MISRA C 2012 rule 10.3 now warns on assigning integer literals 0 and 1 to bool in C99 and later while preserving the existing C89 behavior. - funcArgNamesDifferentUnnamed warns on function declarations/definitions where a parameter in either location is unnamed - uninitMemberVarNoCtor warns on user-defined types where (1) some but not all members requiring initialization have in-class initializers or (2) there is a mixture of members which do/do not require initialization. - fcloseInLoopCondition warns when fclose() is used as a while loop condition, which may skip the loop body or double-close the file handle. C/C++ support: - import project: include path in compile_commands.json now handled correctly GUI: - Removed handling of Cppcheck Premium LOC license Other: - Make it possible to specify the regular expression engine using the engine element in a rule XML. - Added CLI option --exitcode-suppress to specify an error ID which should not result in a non-zero exitcode. - Moved source code from https://github.com/danmar/cppcheck to https://github.com/cppcheck-opensource/cppcheck - The official Windows binary is now built with Visual Studio 2026. - Updated simplecpp to 1.7.0.
Version history
| Version | Updated | Notes |
|---|---|---|
| 2.21.0 | Unknown | Release Notes for Cppcheck 2.21 Major bug fixes & crashes: - Fixed potential crash with incomplete preprocessor directive - Fixed hang in createAst - Fixed invalid AST for braced initialization and references/pointers -... |
| 2.20.0 | Unknown | Release Notes for Cppcheck 2.20 GUI: - Fix: The Misra C checkbox in "Edit Project" dialog is unchecked after reloading project. - Fix: In the Misra Report, use proper icons according to misra classifications - Fix: The p... |
| 2.19.0 | Unknown | Release Notes for Cppcheck 2.19 Major bug fixes & crashes: - Crash in CheckClass::checkConst() - fuzzing crash (assert) in Token::update_property_info() - Crash in checkConstVariable() - Crash in valueFlowLifetimeClassCo... |
| 2.18.0 | Unknown | Release notes |
| 2.17.1 | Unknown | Release notes |
| 2.16.0 | Unknown | Release notes |
| 2.15.0 | Unknown | Release notes |
| 2.14.2 | Unknown | Release notes |
| 2.14.1 | Unknown | Release notes |
| 2.14.0 | Unknown | Release notes |
| 2.13.0 | Unknown | Release notes |
| 2.12.0 | Unknown | - uselessOverride finds overriding functions that either duplicate code from or delegate back to the base class implementation - knownPointerToBool finds pointer to bool conversions that are always true or false - truncL... |
| 2.11 | Unknown | - pop_back on empty container is UB - Improve useStlAlgorithm check to handle many more conditions in the loop for any_of, all_of and none_of algorithms - ValueFlow can evaluate the return value of functions even when co... |
| 2.10 | Unknown | Release notes |
| 2.9 | Unknown | Release notes |
| 2.8 | Unknown | Release notes |
| 2.7 | Unknown | Release notes |
| 2.6 | Unknown | No notes |
| 2.5 | Unknown | No notes |
| 2.4.1 | Unknown | No notes |