name: splint-post-c-sanity description: Run splint after cppcheck/clang-format/clang-tidy precommit sanity to find memory issues, API misuse, and contract violations in staged C code (tolerates older C parser limitations).
Splint pass (after C sanity)
Use this skill after running cppcheck-clang-format-precommit when you want an additional Splint pass focused on memory ownership, API misuse, and contract/annotation checking.
Workflow
- Stage changes (
git add ...). - Run the C sanity skill first:
./.agents/skills/cppcheck-clang-format-precommit/scripts/precommit_c_sanity.sh
- Then run Splint:
./.agents/skills/splint-post-c-sanity/scripts/run_splint_on_staged.sh
- If Splint reports problems, fix and repeat.
What it does
- Runs
splinton staged non-kernel*.cfiles; files undersys/are skipped. Headers are pulled in via includes. - Uses a conservative flag set aimed at:
- memory/ownership issues (
mustfreefresh,usereleased,freshtrans, etc.) - bounds/null misuse (
boundsread/write,nullpass/nullret) - contract checking via annotations where present
- memory/ownership issues (
- Because Splint’s parser is older, the script is intentionally conservative and may require local suppressions or annotations in tricky areas.
Tuning
- Edit
SPLINT_FLAGS/ include dirs inside the script if you need to reduce noise or add-D...defines.