Cppcheck-2.6
New checks in core cppcheck:
- missing return in function
- writing overlapping data, detect undefined behavior
- compared value is out of possible type range
- [perf] Copy elision optimization can't be applied for
return std::move(local) - file can not be opened for read and write access at the same time on different streams
Various improvements:
- Color output for diagnostics are added for unix-based platforms.
- Added symbolic analysis for ValueFlow. A simple delta is used to compute the difference between two unknown variable.
- Rules using the "define" tokenlist can also match #include as well.
- Library
<function>tags can now use<container>tag, so free functions that accept containers such asstd::size,std::empty,std::begin,std::end, etc. can specify theyieldsoractionfor the container. - Library
<smart-pointer>tag can specify a<unique>tag for smart pointers that have unique ownership. Cppcheck now warns about dangling references to smart pointers with unique ownership. - Fixed problems when --cppcheck-build-dir is used, that should now work better. It is recommended to use --cppcheck-build-dir to speedup Cppcheck analysis.
- htmlreport can now output author information (using git blame)
- More warnings about variables that is not const but can be const
Misra C 2012 compliance has been "completed"
All Misra C 2012 rules have been implemented except 1.1 , 1.2 and 17.3. Including the rules in amendment 1 and amendment 2.
The rules 1.1 and 1.2 must be checked with a compiler.
The rule 17.3 can be checked by a compiler, for instance GCC.