Skip to content

0.2.0

Choose a tag to compare

@sonic182 sonic182 released this 09 Nov 09:16
· 193 commits to main since this release
e866af2

cchecker 0.2.0 comes from running 0.1.0 over the Agentica VM in CI: it covers shapes that needed a cchecker: ignore there, and it makes the baseline safer to keep in CI.

  • CC_MAY_JUMP and [assume] may_jump: a call of a function that may jump out (longjmp on an error) is also a way out of its caller. A pointer that still owns there is CC-OWN-LEAK, and a lock still held is CC-PATH-LOCK-NOT-RELEASED.
  • CC_OWNS_OUT: an out-parameter (int take(CC_OWNS_OUT char **out)) hands an owned pointer to the caller, and take(&p) makes p own it. A store into an array that owns (argv[i] = p) hands p on to the array.
  • --strict-baseline: a baseline entry whose finding is gone, in the tools and files the run covered, fails the run. Every run now names its stale entries.
  • Tool versions in the baseline: an update of every file records the versions of gcc, clang and clang-tidy. A run with another version number warns and lists the change in version_changes of --json. A 0.1.0 baseline still reads.

Breaking: the macros of include/cchecker.h are now empty unless cchecker dumps the AST (CCHECKER_AST). A normal clang build no longer carries an annotate attribute on every mark. A project that read that attribute must define the macros itself. Copy the new header into your project.

Install and run (needs Agentica 0.26.1+, gcc 10+, clang and clang-tidy):

git clone --branch 0.2.0 https://github.com/agentica-lang/cchecker ~/cchecker
agentica ~/cchecker/cchecker.agc -p build    # in your project, with build/compile_commands.json

Changelog

Added

  • --strict-baseline: a stale baseline entry (its finding is gone) of the tools and files that the run covered exits
    1. Every run now names its stale entries after the summary and in stale of --json.
  • CC_MAY_JUMP and [assume] may_jump: a call of a function that may jump out (longjmp on an error) is also a way
    out of its caller, where a pointer that still owns is CC-OWN-LEAK and a lock held is CC-PATH-LOCK-NOT-RELEASED.
  • CC_OWNS_OUT on a parameter (char **out): *out = p hands p out to the caller, and take(&p) makes p own
    what the call left. argv[i] = p in an array that owns hands p on to the array.
  • A baseline records the versions of the tools. An --update-baseline of every file (no FILE, no --exclude) writes
    those of the tools it ran (gcc, clang, clang-tidy) into tools, and a run with another version number warns on
    standard error and lists the change in version_changes of --json. The exit code does not change; a baseline of
    0.1.0 still reads.

Changed

  • include/cchecker.h: the macros are empty unless cchecker dumps the AST (CCHECKER_AST), so a normal clang build no
    longer carries an annotate attribute on every marked field and local. Breaking: a project that read the
    annotate attribute defines the macros itself.