Skip to content

Cppcheck Open-Source 2.12 released

We are happy to announce the release of Cppcheck Open-Source 2.12!

Cppcheck introduces new checks such as uselessOverride for redundant overriding functions and knownPointerToBool for unnecessary pointer-to-bool conversions. Enhancements include expanded type checking for truncLongCastAssignment and truncLongCastReturn, and more robust detection of const correctness in constParameter* and constVariable* checks. GUI improvements highlight activated checkers and critical errors post-analysis, with a new interface feature to report activated checkers via --checkers-report. Deprecations include the qmake build system and specific command-line options. Other changes enforce the use of Qt6 without fallback to Qt5, handle addon execution failures as internalError, and remove "Win32" configurations from Visual Studio projects.

Release notes:

  • New checks:
    • uselessOverride finds overriding functions that either duplicate code from or delegate back to the base class implementation
    • knownPointerToBool finds pointer to bool conversions that are always true or false
  • Improved checking:
    • truncLongCastAssignment and truncLongCastReturn check additional types, including float/double/long double
    • duplInheritedMember also reports duplicated member functions
    • constParameter*/constVariable* checks find more instances of pointers/references that can be const, e.g. when calling library functions
  • GUI:
    • Show in statistics which checkers have been activated in latest analysis
    • Make it more visible if there has been critical errors that caused checkers to be skipped
  • Changed interface:
    • Write how many checkers was activated after a run
    • Added --checkers-report that can be used to generate a report in a file that shows what checkers was activated and disabled
  • Deprecations:
    • The qmake build system has been deprecated and will be removed in a future version.
    • Command-line option '--template ' is deprecated and will be removed in 2.13 - please use '--template=' instead.
    • Command-line option '--template-location ' is deprecated and will be removed in 2.13 - please use '--template-location=' instead.

      Other:

      • "USE_QT6=On" will no longer fallback to Qt5 when Qt6 is not found.
      • When the execution of an addon fails with an exitcode it will now result in an 'internalError' instead of being silently ignored.
      • "Win32" configurations have been removed from the bundled Visual Studio solution and projects. You might still be able to build 32-bit binaries using CMake but that is untested and unmaintained.