Cppcheck 2.12 Released for C++ and C Static Code Analysis

New Version of Static Code Analyzer CPPCHECK 2.12 Released

The highly anticipated release of CPPCHECK 2.12, a powerful static code analyzer, has recently become available. This updated version provides developers with the ability to identify various classes of errors in both C and C++ code, including those that utilize non-standard syntax commonly found in built-in systems. CPPCHECK 2.12 offers a collection of plugins that facilitate integration with various development systems, continuous integration, and testing. Additionally, the software offers features such as code verification and compliance with specific code design styles. Code analysis can be performed using its own parser or an external parser such as Clang. For those interested in contributing, the package also includes the DONATE-CPU.PY script, which allows for collective code checking of debian packages. The project makes use of the GNU General Public License version 3 (GPLv3), and the original texts of the project can be found here.

The main focus of CPPCHECK’s development is to identify problems related to uncertain behavior and the use of potentially dangerous structures in terms of security. The aim is also to minimize false positives. The list of identified issues include signs into non-existent objects, zero divisions, integer overflow, incorrect bit shift operations, incorrect transformations, memory-related problems, incorrect use of STL, selection of zero signs, checks after buffer access, buffer overflows, and the use of uninitialized variables. CPPCHECK 2.12 seeks to address these issues and improve overall code quality and security.

Main Changes in CPPCHECK 2.12:

  • Added “Uselessoverride” check: This new check helps detect redundant functions that duplicate code or simply implement the base class.
  • Added “KnownpointoBool” check: This check focuses on detecting pointer-to-boolean variable conversions, where the result is always a true or false value.
  • Improved existing checks: The “trunklongCastassignment” and “TrunClongCastretRN” checks now include additional types such as Float and Double. The “DuplinheritedMember” check now reports duplicate member functions. The “Constarameter*”/”Constvariable*” checks now find more cases where indicators/pointers may have a const modifier
/Reports, release notes, official announcements.