# 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. [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. [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. [Source](https://github.com/danmar/cppcheck/blob/main/test/testuninitvar.cpp)
- **CI enforcement** (unknown) — No reviewed evidence is recorded for this dimension.
- **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. [Source](https://cppcheck.sourceforge.io/manual.html)
- **Real-world adoption** (unknown) — No reviewed evidence is recorded for this dimension.
- **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. [Source](https://cppcheck.sourceforge.io/manual.html)
- **Agent portability** (unknown) — No reviewed evidence is recorded for this dimension.

## 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)
