Cppcheck v2.0 Release Notes

Release Date: 2020-05-10 // 11 months ago
  • Overview

    ๐Ÿ’ป The command line is not changed drastically. Your old cppcheck scripts should work as before.

    Compiling: There is a new dependency Z3. When compiling with the Makefile it is highly recommended to use "USE_Z3=yes".

    ๐Ÿ‘Œ Improved clang-tidy integration

    ๐Ÿ›  Several fixes to;

    • ๐Ÿ‘Œ improve parsing
    • detect more bugs with existing checks
    • ๐Ÿ›  fix false alarms

    Clang import

    ๐Ÿ“œ Clang is a C/C++ compiler that has a very robust and well made parser.

    0๏ธโƒฃ Cppcheck will always use its internal parser by default. However there is now an option to use the Clang parser instead.

    0๏ธโƒฃ It is recommended that you use the default internal Cppcheck parser unless you notice that it fails to parse your code properly (syntax errors, strange false alarms).

    ๐Ÿ› Bug hunting

    There is a new "soundy" analysis in Cppcheck that should detect most bugs. You should expect false alarms, however the false alarms will not be overwhelming.

    This new "soundy" analysis is not intended to replace normal Cppcheck analysis. There are use cases where false alarms can not be tolerated.

    We have added 1 checker and that checks for division by zero:

    • โœ… It detects all "integer division by zero" bugs in the Juliet test suite.
    • โœ… It detects all "division by zero" bugs in the ITC test suite.
    • ๐Ÿ‘€ There was 28 division by zero CVEs published in 2019 for C/C++ open source projects, and we could quickly see that 21 of the bugs are found by Cppcheck. There is no CVE bug that we know Cppcheck fails to diagnose. But there are 7 CVEs that would require additional investigation to establish if it is really detected or not.

    You can read more about this analysis in the "Bug hunting" chapter in the manual.