# Cppcheck

Catch undefined behavior in native code

Analyze the project with matching platform definitions and include paths. Investigate out-of-bounds accesses and uninitialized variables against the actual build configuration.

Category: Code quality
Languages: C, C++

## Standard evidence

Rubric v1 · 5/8 verified · 3 unknown · 0 contrary · reviewed 2026-11-28

- **Definition** (verified) — Cppcheck documents analysis for undefined behavior in C and C++ and explains the importance of configuring the platform and preprocessing inputs. Reviewed 2026-11-28. [Cited source](https://cppcheck.sourceforge.io/manual.html)
- **Measurement** (verified) — The manual shows how to analyze files or an imported project and interpret diagnostics with file locations, severity and an error identifier. Reviewed 2026-11-28. [Cited source](https://cppcheck.sourceforge.io/manual.html)
- **Conformance** (verified) — The uninitialized-variable tests assert expected diagnostics for sample C and C++ programs, including cases that must remain warning-free. Reviewed 2026-11-28. [Cited source](https://github.com/danmar/cppcheck/blob/main/test/testuninitvar.cpp)
- **CI enforcement** (unknown) — No reviewed evidence is recorded for this dimension.
  - Can a change trigger a useful check? [Contribute evidence](https://github.com/seikika/seikika/issues/new?title=Evidence+review+%C2%B7+Cppcheck+%C2%B7+CI+enforcement&body=Practice%3A+cppcheck%0ACriterion%3A+ci+%28rubric+v1%29%0ACan+a+change+trigger+a+useful+check%3F%0A%0APublished+judgment%3A+unknown%0ANo+reviewed+evidence+is+recorded+for+this+dimension.%0A%0AProposed+judgment+and+rationale%3A%0A%0APublic+source+or+reproduction+%28include+version%2C+inputs+and+observed+result%29%3A)
- **Getting started** (verified) — The manual describes obtaining Cppcheck and walks through a small C source file. Running the tool produces a reported out-of-bounds access at the indicated line. Reviewed 2026-11-28. [Cited source](https://cppcheck.sourceforge.io/manual.html)
- **Real-world adoption** (unknown) — No reviewed evidence is recorded for this dimension.
  - Has another team put it to work? [Contribute evidence](https://github.com/seikika/seikika/issues/new?title=Evidence+review+%C2%B7+Cppcheck+%C2%B7+Real-world+adoption&body=Practice%3A+cppcheck%0ACriterion%3A+adoption+%28rubric+v1%29%0AHas+another+team+put+it+to+work%3F%0A%0APublished+judgment%3A+unknown%0ANo+reviewed+evidence+is+recorded+for+this+dimension.%0A%0AProposed+judgment+and+rationale%3A%0A%0APublic+source+or+reproduction+%28include+version%2C+inputs+and+observed+result%29%3A)
- **Agent guidance** (verified) — Reproduce the sample array-bounds diagnostic on the single C file. Compare its declared length with the flagged index, fix the access, and rerun with the same platform and preprocessor choices before accepting a clean result. Reviewed 2026-11-28. [Cited source](https://cppcheck.sourceforge.io/manual.html)
- **Agent portability** (unknown) — No reviewed evidence is recorded for this dimension.
  - Does the practice work in two agent harnesses? [Contribute evidence](https://github.com/seikika/seikika/issues/new?title=Evidence+review+%C2%B7+Cppcheck+%C2%B7+Agent+portability&body=Practice%3A+cppcheck%0ACriterion%3A+portability+%28rubric+v1%29%0ADoes+the+practice+work+in+two+agent+harnesses%3F%0A%0APublished+judgment%3A+unknown%0ANo+reviewed+evidence+is+recorded+for+this+dimension.%0A%0AProposed+judgment+and+rationale%3A%0A%0APublic+source+or+reproduction+%28include+version%2C+inputs+and+observed+result%29%3A)

## Adoption

Use Cppcheck in this repository to meet this standard: Catch undefined behavior in native code. Analyze the project with matching platform definitions and include paths. Investigate out-of-bounds accesses and uninitialized variables against the actual build configuration. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.

Seikika package: no verified installation is listed.

## References

- [Tool documentation](https://cppcheck.sourceforge.io/)
- [Agent skill](/skills/cppcheck/SKILL.md)
