cppcheck / News: Recent posts


Cppcheck 1.77 has been released

General changes:
- Added flag --cppcheck-build-dir to allow incremental analysis and inter-file checking
- Improved --project support for Visual Studio solutions

Removed checks:

New checks:
- Detect pointer overflow
- Detect usage of variable after std::move or std::forward

Checking improvements:
- Warn about number and char literals in boolean expressions
- Improved checking for variables modified but not used again
- Libraries: Added support to specify <returnValue>
- Improved ValueFlow, especially related to function return values and casts
- Improved simplification of Null values to allow more accurate checking
- Several improvements to windows.cfg, posix.cfg, gnu.cfg and std.cfg
- Reimplemented check for using iterators of mismatching containers... read more

Posted by Daniel Marjamäki 2016-12-31

cppcast about cppcheck

the latest episode of cppcast is about Cppcheck.

cppcast is a podcast about C++.

Posted by Daniel Marjamäki 2016-11-18


Cppcheck-1.76.1 has been released.

It has a bugfix to avoid hang.

Posted by Daniel Marjamäki 2016-10-12


Cppcheck-1.76 has been released.

General changes:
- Completed CWE mapping
- Support opening project files of external build systems, including CMake and Visual Studio (CLI: --project)
- XML format version 1 is deprecated and will be removed in 1.81

Removed checks:

New checks:

Checking improvements:
- Improved checking for conditions that are always true/false
- Improved format string checking: Support more functions, support %h and %hh
- Improved std.cfg, windows.cfg and qt.cfg; added wxwidgets.cfg
- Improved ValueFlow analysis
- Improved SymbolDatabase accuracy
- Improved Preprocessor (simplecpp)
- Support base class methods in Library... read more

Posted by Daniel Marjamäki 2016-10-08


Cppcheck-1.75 has been released

General changes:
- Replaced internal preprocessor by the brand-new preprocessor 'simplecpp'
- Improved Windows installer: Install a copy of the license instead of asking to accept it
- The Windows x64 binaries are now compiled with profile guided optimization, resulting in a speedup of 11%
- Improved manual, especially the chapter about Libraries
- Improved CWE mapping
- --append is deprecated and will be removed in 1.80... read more

Posted by Daniel Marjamäki 2016-08-06


Cppcheck-1.74 has been released

General changes:
- Improved CWE mapping of messages
- Git pre-commit hook checks only added or modified files

Checking improvements:
- Replaced simplification of enums by keeping and parsing them in the SymbolDatabase
- Added support to Library for specifying the parameter used by allocating/deallocating functions
- Improved support for integers defined in Libraries
- Improved accuracy of ValueType analysis
- Improved accuracy of VarID assignment, especially when dealing with structs and unions
- Improved performance of VarID assignment, checking for struct member usage, buffer overrun checking and several simplifications
- Added support for lots functions to windows.cfg and posix.cfg
- Better support for operator overloads
- Detect buffer overflows when %c is used with a width
- Improved checking for sizeof() taken of wrong type
- Support char literals when checking for conditions being always true or false
- Reimplemented check for usage of boolean results used in bitwise operations based on ValueType
- Improved checking for c_str() usage... read more

Posted by Daniel Marjamäki 2016-06-05


Cppcheck-1.73 has been released

General changes:
- CWE mapping of messages
- Translated manual to Japanese language

Removed checks:
- Checks for variables hiding enums or typedefs have been removed

New checks:

Checking improvements:
- Improved ValueType a lot, use it in more checks
- Improved VarId support for template constructors, namespaces and references as class members
- Improved libraries, especially gnu.cfg, posix.cfg and windows.cfg
- Improved simplification of enums and templates
- Better distinguishing between possible and known null pointer dereferenciations
- Assume integers to be signed by default
- better support for cplusplus macro in preprocessor
- Preprocessor directives for addons
- New tools: times-vs.py, reduce.py... read more

Posted by Daniel Marjamäki 2016-04-08


Cppcheck-1.72 has been released.

General changes:
- Added platform files to customize characteristics of different target platforms
- Added setting to configure the default sign of integral variables and bit size of type 'char'
- Added option -E (only preprocess the code)
- Option --dump now outputs data for each configurations, not only the last one
- Several qmake project files have been removed

Removed checks:
- Check for unnecessary forward declaration has been removed... read more

Posted by Daniel Marjamäki 2016-01-09


Cppcheck-1.71 has been released

General changes:
- The deprecated options --suppressions and --exitcode-suppressions have been removed
- .hh and .hxx files are now treated as C++ files
- Improved documentation (readmes and manuals)
- Internal errors (for example syntax error) are now suppressable

Removed checks:
- Check for unnecessary qualification has been removed

Checking improvements:
- Support range-based for-loops (C++11)
- Better support for C++11 style initialization
- Better support for lambdas (C++11)
- Support digit separators (C++14)
- Added determination of the type of an expression (ValueType)
- Support case ranges (GCC extension)
- Improved AST generation and added validation
- Improved value flow analysis
- Improved checking for unitialized arrays
- Improved VarId assignment for member variables
- Rewrote checking of char variables
- Known variable simplification has been removed partially in favour of value flow analysis... read more

Posted by Daniel Marjamäki 2015-11-14


Cppcheck-1.70 has been released

General changes:
- New version of .cfg file format, adding support for namespaces and declaring several functions at once
- Support building x64 installer for Windows; Both x64 and x86 builds are now provided
- Warn about deprecated options --suppressions and --exitcode-suppressions. They will be removed in future
- Added debugging option --debug-normal, which prints out debug output before second stage simplification... read more

Posted by Daniel Marjamäki 2015-09-04


Cppcheck-1.69 has been released

General changes:
- Added flag --platform=native, when it is used type sizes and behaviour of host system are used
- Backward compatibility for Libary files is now working. Future cppcheck versions will be able to use libraries written for previous versions
- Windows 32 bit builds now set /LARGEADDRESSAWARE, so that they can use up to 4 GiB

New checks:
- Detect bad bitmask checks (usage of | where & should be used)
- Suggest usage of "explicit" for constructors with a single parameter
- Suggest usage of make_shared/make_unique
- Warn about usage of malloc with auto_ptr
- Detect redundant pointer operations like &*ptr... read more

Posted by Daniel Marjamäki 2015-05-01


Cppcheck-1.68 has been released

General changes:

New checks:
- Multifile checking for buffer overruns and uninitialized variables

- Libraries are now able to contain platform specific types
- Improved handling of function overloads
- Improved handling of integer literal suffixes
- Improved stability of template parsing
- Improved accuracy of ValueFlow analysis
- Improved checking of pointer overflow
- Support noexcept(false)
- Support attribute((noreturn))
- A bunch of additions to several Libraries, especially posix.cfg and qt.cfg... read more

Posted by Daniel Marjamäki 2015-01-03


Cppcheck-1.67 has been released.

General changes:
- Library files have now a 'format' attribute. Format version 1 is assumed by default
- Cppcheck does no longer abort checking if unhandled characters (Non-ASCII) are found

New checks:
- Check for unused return values
- Detect shift by too many bits, signed integer overflow and dangerous sign conversion
- Recommend usage of expm1(), log1p(), erfc()
- Division by sizeof() as parameter to memset/memcpy/memmove/etc. as they expect a size in bytes
- Several new va_arg related checks:
-- Wrong parameter passed to va_start()
-- Reference passed to va_start()
-- Missing va_end()
-- Using va_list before it is opened
-- Subsequent calls to va_start/va_copy()
- Initialization by itself in initializer list
- Dead pointer usage when pointer alias local variable that has gone out of scope... read more

Posted by Daniel Marjamäki 2014-10-18


Cppcheck-1.66 has been released.

New checks:
- Compare pointer with '\0'
- Assigning boolean expression to floating point variables

- Much improved AST
- Much improved ValueFlow analysis
- ValueFlow and AST now used by much more checks, improving checking accuracy and performance
- Checking for self assignment now supports more complex expressions
- Returning references to literals or references to calculation results is detected
- Enhanced support for commutative operators in duplicate expression checking
- Improved template/enum parsing
- Much improved htmlreport
- Definition of POD types in .cfg files
- Definition of minsize for buffer arguments in .cfg files for buffer overflow checking
- Fixed handling of #error: Do not report them if -f and -D are used together
- New .cfg file for AVR platform
- Generate xml dump of AST/ValueFlow/SymbolDatabase/TokenList if --dump is given
- Improved performance in several cases
- Windows Builds: Now compiled with VS2013, linked against Qt 5.3.1... read more

Posted by Daniel Marjamäki 2014-08-02


Cppcheck-1.65 has been released.

General changes:

  • Cppcheck requires a C++11 compiler supporting the common subset of features supported by GCC 4.4, Visual Studio 2010 and Clang 2.9
  • Problems with packaging and windows installer introduced in last release were fixed


  • Much improved support of complex combinations of function pointers, arrays and references
  • Better handling of syntax errors
  • Better detection of stack variables passed to free()
  • Much improved value flow analysis
  • More robust error detection in several checks due to usage of AST
  • Better handling of unknown Macros in function declarations
  • Allocation/Deallocation functions can be extend across different .cfg files
  • Better handling of some C++11 language features like enum class, in-class member initializers
  • Detect calling (std::)abs() with bool argument... read more
Posted by Daniel Marjamäki 2014-05-10


cppcheck-1.64 has been released.

Value Flow

A new value flow analysis has been added. It is generic so the same analysis can be reused by various checkers - previously many checkers have had their own value flow and control flow analysis. The new value flow analysis performs context sensitive cross-function analysis. All checkers that uses this will automatically have cross-function context sensitive value flow analysis. The new analysis is gradually introduced in the checkers - the old analysis in a checker is kept until it is redundant.... read more

Posted by Daniel Marjamäki 2014-03-02


Cppcheck-1.63 has been released.

The .cfg files are needed by cppcheck. Either put them in a subfolder cfg
where the binary is. Otherwise compile cppcheck with CFGDIR to specify an
arbitrary path where you put the
.cfg files.

New check:
* Using pointer addition result in condition 'if (p+1)' - either a dereference
is forgotten or it depends on UB (the result is only 0 if there is overflow,
which is UB).... read more

Posted by Daniel Marjamäki 2014-01-04


New checks
* Divide with variable and then compare to see if variable is 0
* Duplicated inherited member

Improved checking:
* handling of >> in templates
* format string checking
* comparing bool result with integer
* standard isgreater()/islower() functions
* standard math functions
* reassigning struct members

xml-version 2 is now handled

Posted by Daniel Marjamäki 2013-10-12


New checks:
* arithmetical usage of inf/nan result
* suspicious usage of comma in return statement
* sizeof(void)

Improved checking:
* better simplification of strlen
* improved handling of array member variables 'x[y].z..'
* Specific improvements in checks for buffer overruns, format strings, uninitialized variables

Command line:
* Using both --max-configs and -D. Normally when -D is used, Cppcheck will only check the given configuration. By using --max-configs also, you can tell Cppcheck to check more configurations.
* Added --library and --check-library.... read more

Posted by Daniel Marjamäki 2013-08-03


Cppcheck 1.60.1 has been released.

A bug in compiled patterns was fixed.

Posted by Daniel Marjamäki 2013-06-02


new checks:
* dereference iterator and then checking it in condition: 'if (std::isalpha(*i) && i != str.end()) { }'
* calling pure virtual function from constructor/destructor
* assert() condition calls function with side effects

improved checking:
* improved struct member leaks checking
* improved handling of variable initialisation in 'reassignment of variable (first assignment is redundant)' check
* better 'Prefer prefix ++/-- operators' checking for iterators
* handle more complicated patterns in checkIncorrectStringCompare... read more

Posted by Daniel Marjamäki 2013-06-01


cppcheck-1.59 has been released

Commandline/Settings changes:
* New option to enable warnings but not style messages: --enable=warning
* Cppcheck used to skip includes where the header filename is enclosed in <>. You can now include these headers also by using -I. It is still not required to include these headers so feel free to try it and then include the headers that give you the best results. The biggest problem with including many headers is that analysis gets slow.... read more

Posted by Daniel Marjamäki 2013-03-29


Cppcheck-1.58 has been released.

Commandline/Settings changes:
- Added --include to the cppcheck command line client. This forces inclusion of the given file. This can for instance be used instead of --append and will then allow you to use #define etc also.
- The threads handling has been improved. Using -jN now works in windows also.

- NULL pointers: Improved checking of default function argument values.... read more

Posted by Daniel Marjamäki 2013-01-12


Cppcheck-1.57 has been released

Commandline/Settings changes:

* Support for Java and C# code has been removed.
* New option --language= (alias: -x=) to enforce treating code as a specific language


* Support GCC binary number syntax (0b...)
* Fixed search order for include paths
* Several error messages have been improved to be more understandable and consistent
* Rewrote enum parsing
* Simplification of well-known math.h functions
* Check for variable being assigned a value never used handles now also reassignments
* Fixed several false negatives in buffer overrun check
* Detect more inadequate comparisons of boolean variables
* Better detection of mismatching and assignments and comparisons with bitwise operations ... read more

Posted by Daniel Marjamäki 2012-11-04


Cppcheck-1.56 has been released.

Commandline/Settings changes:
- Code is considered to be C++11 or C11 compatible by default, added new standards to --std= option: c89, c11, c++03
- '--inconclusive' has been made "official" and shown in help dialog

- Uninstanciated templates are no longer removed from token list
- Support 'using namespace std;' - 'std ::' added to C++ standard library types when 'using namespace std;' is found
- Several error messages have been improved to be more understandable and consistent
- Checking of preprocessor configurations that are considered invalid, because the macro used in #if is also used in the code, is now skipped.... read more

Posted by Daniel Marjamäki 2012-09-01

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks