Changelog History
Page 1
-
v2.3 Changes
December 05, 2020๐ Improved C++ parser:
- types
- wrong operands in ast
- ๐ better simplification of templates
๐ Improved clang import, various fixes.
๐ Improved value flow analysis๐ Fixed false positives
๐ Improved configuration in library files
- boost.cfg
- โ googletest.cfg
- qt.cfg
- ๐ windows.cfg
- wxwidgets.cfg
โ Added several Misra rules:
- 6.1
- 6.2
- 7.2
- 7.4
- 9.2
- 10.2
- 15.4
โ Added platforms:
- elbrus e1c+
- pic
- pic8
- mips
-
v2.2 Changes
October 03, 2020๐ New checks:
- ๐ incorrect usage of mutexes and lock guards
- Dereference end iterator
- Iterating a known empty container
- outOfBounds check for iterators to containers
โ Removed 'operator=' check that ensures reference to self is returned. That is not about safety.
๐ Improved parser
- ๐ various ast fixes
๐ Clang parser
- The Clang import feature in Cppcheck should be considered to be experimental for now. There are problems.
๐ Improved bug hunting
- variable constraints
- handling of multidimension arrays
- function calls, execute functions that are in same TU
- ๐ improved handling of containers
- several improvements for uninitialized variables check
- ๐ improved analysis of for loops
- โ added a hash value for warnings that can be used for suppressions
๐ Improved data flow
- one more heuristic for ternary operators
- ๐ improved data flow for containers
CLI:
- ๐ Fixed some addon execution problems when there are spaces etc
GUI:
- ๐ Fix handling of tags
- Exclude files
cppcheck-htmlreport:
- several result files can be combined into 1 output
Suppressions:
- comments can be added at end of suppression in suppressions file
-
v2.1 Changes
June 13, 2020๐ This is a minor release.
๐ We have tweaked build scripts.
- ๐ When you use USE_Z3=yes, we will handle new versions of z3 better. If you have an old z3 library and get compilation problems you will need to add a z3_version.h in externals.
- โก๏ธ The cmake scripts was updated.
๐ There was a couple of bug fixes.
๐ New check:
- for "expression % 1" the result is always 0.
-
v2.0 Changes
May 10, 2020Overview
๐ป 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.
-
v1.90 Changes
December 21, 2019๐ New check:
- alias to vector element invalid after vector is changed
๐ Improved checking:
- ๐ improved value flow analysis for struct members
- ๐ improved value flow analysis for pointer alias
CERT:
- โ Added ENV33-C: Do not call system()
MISRA:
- โ Added rule 2.7
- โ Added rule 3.2
- โ Added rule 4.2
- โ Added rule 14.2
- โ Added rule 21.1
- โ Added rule 21.12
-
v1.89 Changes
September 01, 2019๐ป Command line:
- โ The default warning message format was changed. The new format is similar to GCC. If you want to get warnings in the old format, add --template=cppcheck1 to the command line.
Compiling:
- From now on, use FILESDIR instead of CFGDIR to specify the path for Cppcheck data files. The readme.txt describes the available flags.
๐ Improved checking:
- ๐ improved value flow analysis for pointer aliases
- ๐ improved checking for uninitialized variables/structs
- ๐ better checking of smart pointers
- ๐ better checking of global variables
- Added Cppcheck annotations cppcheck_low (VALUE) and cppcheck_high (VALUE)
- shadow variables; warn when argument is shadowed
- warn if local reference variable can be const
CERT:
- โ Added API01-C: Avoid laying out strings in memory directly before sensitive data
- โ Added MSC24-C: Do not use deprecated or obsolescent functions
- โ Added STR11-C: Do not specify the bound of a character array initialized with a string literal
MISRA:
- โ Added rule 17.2
- โ Added rule 18.4
- โ Added rule 18.7
GUI:
- Minor tweaks
-
v1.88 Changes
June 29, 2019๐ New checks:
- Comparing pointers that point to different objects
- โ Address of local variable 'x' is accessed at non-zero index
- STL usage: unnecessary search before insertion
- Duplicate expression for condition and assignment: if (x==3) x=3;
โ Added --library configuration files for:
- cppunit
- libcerror
- nspr
- opengl
- sqlite3
๐ Better handling of C++14 and C++17
๐ป Command line:
- ๐ New command line option --addon used to run addons directly from Cppcheck.
- Some advanced options are only available in GUI:
- remove unused declarations in header files to speedup analysis
- remove unused templates to speedup analysis
- when checking visual studio project, only check 1 configuration
- max whole-program-analysis call stack depth
๐ป To get these features in command line tool, create a GUI project file and import that on command line using --project.
GUI:
- ๐ started implementing theme support
๐ Makefile:
๐ Please use MATCHCOMPILER=yes instead of SRCDIR=build when compiling to enable the match compiler.Cert:
- โ add check exp15-c
- โ add check str03-c
- โ add check str05-c
- โ add check str07-c
Misra:
- โ Add check 17.7
- โ Add check 20.7
- โ Add check 20.10
-
v1.87 Changes
February 09, 2019๐ป Command line interface:
- --project can now import Cppcheck GUI projects.
๐ New checks:
- Condition is always true when array address is compared with 0.
- function argument expression calculation has known result (#8830)
๐ Improvements:
- ๐ Better lifetime checking (using pointer/reference that points at deleted object)
- ๐ Improved whole program analysis
- ๐ Better handling of language extension var@address.
- ๐ Many improvements in parser to handle templates, type aliases, etc better
๐ง Configuration:
- ๐ new configuration for boost
- ๐ง much better wxwidgets configuration
โ Addons:
- ๐ New addon for checking naming conventions. Naming conventions are configured in json file.
๐ Performance:
According to daca@home Cppcheck-1.87 is in average 10% faster than Cppcheck-1.86. -
v1.86 Changes
December 08, 2018General:
- ๐ Many fixes in the template simplifier
- ๐ Several fixes in the abstract syntax tree.
Checking improvements:
- ๐ New check: passing address of char to function that expects a strz
- ๐ New check: shadow variables
- ๐ Improved lifetime checking
- ๐ Improved STL iterators checking
- ๐ Improved data flow analysis
๐ New libraries:
- zlib
- โ googletest
โ Addons:
- ๐ misra.py: Fixes for suppressions and exclusions
- namingng.py: New addon to check naming conventions. Rules are specified in json file.
-
v1.85 Changes
October 14, 2018General:
- ๐ We are modernizing the Cppcheck code. Support for MSVC 2010 and GCC 4.4 is dropped. You now need a compiler that is at least as good as MSVC 2013 or GCC 4.6.
- According to "daca@home" (http://cppcheck.osuosl.org:8000)
- There are fewer crashes.
- Cppcheck-1.85 is ~25% slower than Cppcheck-1.84
Checking improvements:
- ๐ New check: Suggest STL algorithms instead of hard-coded for loops
- ๐ New check: Warn about ineffective algorithms (same iterator passed)
- ๐ New check: Mismatching iterators used together in operators
- Container (STL/Qt/WxWidgets/etc) access out of bounds
- ๐ Improved the checkers that warns about same/opposite expressions, track variable values better.
- logical conjunctions
- identical/opposite inner expressions
- same expressions around operator
- etc
- Variable scope: warn about references also
Graphical user interface:
- You can specify undefines in the project file dialog
- ๐ Fixed configuration of suppressions
- ๐ Windows: Fixed issue of wrong/no theme being applied to UI elements
Misra:
- ๐ support per file excludes from cppcheck
- ๐ support per file suppressions from cppcheck
- summary will now summarize results for all files again
- ๐ a few false positives were fixed