Cppcheck

The Cppcheck team·Cppcheck.Cppcheck

Cppcheck is a static analysis tool for C/C++ code.

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

winget install --id Cppcheck.Cppcheck --exact --source winget

Latest 2.22.0·September 19, 2026

Release Notes

Release Notes for Cppcheck 2.22 Major bug fixes & crashes:

  • Fixed a large number of fuzzer-found crashes and hangs in the tokenizer and template simplifier, e.g. TemplateSimplifier::expandTemplate() (bb630c2, 3f2d60c), Tokenizer::simplifyTypedef() (71de675, 3deb36d, 592e7b7), Tokenizer::simplifyUsing() (9162aa7, 7d5a54c), Tokenizer::findGarbageCode() (08db304) and ReverseTraversal::traverse() (3a3184d, 5aa31d0).
  • 6d2b6f4 Fix #14974 [regression] inline suppression does not work with build dir anymore.
  • 9a500c8 Fix #14972 [regression] Syntax Error: AST broken, '!' doesn't have an operand. New checks:
  • 0d7884d Warn when feof() is used as a while loop condition (wrongfeofUsage).
  • 04091bd ftell() result is unspecified when file is opened in mode "t".
  • 3d88880 Detect when an STL algorithm such as std::copy, std::equal, std::transform, etc. accesses more elements through an iterator than are available in the container (algorithmOutOfBounds).
  • f695ade Detect switch cases that cannot be selected when the switch condition has a known value (unreachableSwitchCase). C/C++ support:
  • b878dc2 Support C++23 'if consteval' / 'if !consteval'.
  • 7a8c67a Fix #15007 isAttributeNoreturn not set for _Noreturn. GUI:
  • f81f6f0 Fix #14829 Platform configuration mismatch between UI selection and analysis log.
  • 9f74c2d Fix #14813 crash: recheck in GUI sometimes crashes.
  • 550189b Fix #14738 GUI recheck of files not working properly when importing compile_commands.json.
  • 8f7666d Fix #14983 GUI: exclude file with relative path.
  • 6640862 Fix #14933 each GUI log entry line should be output on a separate line.
  • 5799d47 Removed GUI compliance report instructions (feature removed). Suppressions:
  • 93546a2 XML suppression file: added macro attribute for specifying macro name.
  • fecb349 Fix #14959 Warning hash for token-based warnings.
  • f6fff71 Fix #15013 Calculate warning hash for CTU warnings.
  • 0b59984 Baseline functionality (script and documentation).
  • 637d5be Suppression file name cache. (performance)
  • c976cac ErrorLogger: do not open and read from files unless necessary (performance). Import project:
  • d32c01d Added support for Folders in slnx project files, skip non-C++ projects.
  • 9408a1d Added support for vcxproj ExcludedFromBuild.
  • bf099d1 Import project: handle forced include files from compilation database projects.
  • 3a9750e Flexible handling of -isystem, --sysroot and -I flags in compile_commands.json through the script tweak-compile_commands.py. Infrastructure & dependencies:
  • 4e62f0c Fix #14614 Optionally provide comments in preprocessor output (BuildCache).
  • ff4d7ce Fix #14987 Update simplecpp to 1.9.1. Other:
  • 1fb6630 Added configuration file for Microsoft.GSL (Guideline Support Library).
  • 167f49d, 5aec67c, 767ace6 man/checkers: documented remaining checkers and fixed guideline classifications for MISRA C++.

Installer type: wix

x64—3929162BAB7E71D1B9B18708EC054FB0188BFC8EA1660979ED95837F5A9F547B

Details

Homepage
https://github.com/danmar/cppcheck
License
GPL-3.0
Publisher
The Cppcheck team
Moniker
cppcheck

Tags

adminanalysisc++checkcodecppstatic

Older versions (21)

2.21.0
x64—A86EEF1180DC18FDE46B08F4E4B12F2A1EAD8CFC0DD6C294AAC8757748CBBB24
2.20.0
x64—BB1132BCA1BCA857A6CE3F04605698F002196070A947CAE7015EEDDC3C00F449
2.19.0
x64—AAC15F6DC2B404B3B2562015419F11D91F391E686279CABD20627A8435782128
2.18.0
x64—651C14395B8F8B2F18B7C08FF27533142ECAFD60B6BE0DC123F92FBD873CB638
2.17.1
x64—BCC28E10AE88584A5844540F0B9D54419EB04185F506565459117EC73D63F137
2.16.0
x64—B4137578B4E76F0A1065D561C99D8A286BB1159BC29A0B1914CC33AFC7A890B0
2.15.0
x64—923243A2677CF9572A6341C94C3A804691689B094DCAFBAA95C04530E1662FC9
2.14.2
x64—C6DA399327B33C5A56676981FABBA550AC0AD172A739E956D5F0256E5321E0CD
2.14.1
x64—824A11B5B90A49717DA24A44AA9C925AB451A690E1C52CF98F4C1D4983A66EA9
2.14.0
x64—DF27B2346D941D7C502B3A95B10FFB0DFF9E06B6063F5C282452FADD8A78F54B
2.13.0
x64—72C4910DD5D027353DEB88D98498E27B9E4F0BA49467C9130796EE91E9A646C2
2.12.0
x64—780F0B0A56C0EC6CEA9A8D81A197FD8AFC8313ADEF22C5698FE022C446D3F3F0
2.11
x64—55BCE7A8911CCDA48D631204D95C9DC6606A590F161E45593452FEFE750B39C7
2.10
x64—1963084475F34628A5C100ED8B90834D8575D28DD4EC9548D4C92C138DF2FB9F
2.9
x64—090DA7BBE16D2E9B1658BC482245B8D342C66A8165DC5F83B0E06A7375FB9B69
2.8
x64—752037A631A23698C03609FBCE9339A5466D2E25EA05DA57B948DF61B6ED873E
2.7
x64—D481563ECCA60D0C2279AC2AE1AA9B35991A284D6CB7D126E64BB84546A3CBA1
2.6
x64—2094F180E3E1E16D4EC77560289C909178707A3E3EC46AA06EE399DC63AF841D
2.5
x64—5CDA946E59C8402FB82186BF94BF1F70FF74D8F36110B20F044AC2EE31D84A77
2.4.1
x64—380414BFD26BA86DC635743168C365E5F73E0D114B266B13C5AE9EA8EA1EAB60
2.3
x64—38A2D796F8F7D50ABB45F5F7158B8443AC7660F4A1A9EFC7D4A7EE2EC85C2118