Skip to content

LCppC 1.1

Latest
Compare
Choose a tag to compare
@PKEuS PKEuS released this 30 Aug 11:45
· 423 commits to master since this release

This release focuses on bringing back useful checks that got lost in recent years
of Cppcheck development and improving existing checks to fix false negatives -
besides fixing bugs from the first release. Additionally, a first preview of
a new GUI is included in the release.

New Features:

  • New Check: Char given as third parameter to memset()
    (One half restored functionality from Cppcheck 1.87, the other half is new)

  • New Check: Allocation of memory with negative size with new[] or as VLAs
    (Restored functionality from Cppcheck 1.87)

  • New Check: Detect usage of command line arguments without checking their size
    (Restored functionality from Cppcheck 1.87)

  • New Check: Detect incorrect usage of mutexes and lock guards (also in upcoming Cppcheck 2.2)

  • New Check: Dereferencing out of bounds and end iterators (also in upcoming Cppcheck 2.2)

  • New Check: Detect iteration over empty container (also in upcoming Cppcheck 2.2)

  • Initial support for C++20 features: modules, consteval and constinit

  • New library microsoft_unittest.cfg: Microsoft CppUnitTest library (also in upcoming Cppcheck 2.2)

  • GUI: Work in progress, so far only supporting a scratchpad to test small code snippets

Improvements:

  • Improved various checks to support more generic code:

    • Usage of std::string::c_str()

    • Filling arrays incompletely in a suspicious manner

    • Comparison of string literals with char*

    • Replaced specific check for usage of pipe() by CheckBufferOverrun and Library configuration

    • Usage of mismatching iterators

    • Detect known conditions when sizeof is involved (also in upcoming Cppcheck 2.2)

    • Support more simple class types in unused variable checking (also in upcoming Cppcheck 2.2)

  • Improved detection whether a function modifies its parameters in various checks

  • A couple of small performance and memory usage optimizations

  • Support iterators in ValueType parsing. The type of iterator is defined by Library configuration

  • Avoid false positives caused by #if/ifdef in several checks (also in upcoming Cppcheck 2.2)

  • Improved std.cfg, wxwidgets.cfg and windows.cfg (also in upcoming Cppcheck 2.2)

  • Improved --showtime results for better readability and usability and fixed times for nested timers

  • Improved accuracy of ValueFlow analysis (also in upcoming Cppcheck 2.2)

  • Ensure that Libraries are only loaded once

Bugfixes:

  • Fixed a major regression in LCppC 1.0 that made whole program analysis partially ineffective

  • Fixed AST and template parsing in some scenarios (also in upcoming Cppcheck 2.2)

  • Lots of other bugs were fixed

Notes:

  • The check for correct return type of operator=, removed in upcoming Cppcheck 2.2, was kept in LCppC.

  • LCppC retained the approach on comparison of boolean expressions with integers from CppCheck 2.1 and earlier.

  • The message hash introduced in upcoming Cppcheck 2.2 is not part of LCppC.