|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Accepted – 2026-02-10.
ADR-0001 commits the project to IEC 61508 SIL 3 / DO-178C Level B. Both standards expect the source language to be constrained by a documented coding standard; for C, the de-facto choice is MISRA C:2012 (with Amendments 1-4) or its safety-critical superset MISRA C:2023.
Enforcing MISRA in CI requires a checker. The mainstream choices:
| Checker | License | Rule coverage | Cost |
|---|---|---|---|
| LDRA Testbed | Commercial | Full MISRA C:2012/2023 | $$$$ |
| Parasoft C/C++test | Commercial | Full MISRA C:2012/2023 | $$$$ |
| PRQA / Helix QAC | Commercial | Full MISRA C:2012/2023 | $$$$ |
| Coverity | Commercial (free for OSS) | Partial MISRA | $$$ / 0 |
| clang-tidy | FOSS (Apache 2) | ~30 MISRA rules via misra-* checks | 0 |
| cppcheck | FOSS (GPLv3) | ~120 MISRA rules via the bundled addons/misra.py add-on | 0 |
| PC-lint Plus | Commercial | Full MISRA C:2012 | $$$ |
Project constraints:
cppcheck is the only FOSS option with broad MISRA coverage. Its MISRA add-on covers ~120 of the 175 directive + rule items in MISRA C:2012, which is sufficient to demonstrate the spirit of MISRA conformance without the audit-grade traceability of a commercial tool.
MISRA enforcement is performed by cppcheck only, via the pre-commit hook (scripts/git/pre-commit) and the CI workflow. The exact invocation is
cppcheck --enable=warning,style,performance,portability \
--error-exitcode=1 \
--suppressions-list=.cppcheck-suppressions \
--inline-suppr \
--std=c11 \
--quiet \
<files>
The standard is pinned to --std=c11, not --std=c23. The pinned cppcheck (2.13) predates C23 support: the codebase's C23 typed enums (enum : uint8_t) and [[...]] attributes raise syntaxError under a C23 parse, and cppcheck has no c23 value for --std. All three invocations use --std=c11 accordingly: scripts/checks/cppcheck.sh, scripts/checks/misra_check.sh, and scripts/checks/misra_check_inner.sh (whose inline comment records the version limitation). The consequence is that any line using C23-only syntax raises syntaxError; cppcheck recovers and continues parsing the rest of the translation unit, so MISRA coverage is the parseable subset of the tree rather than every line. For the two MISRA rules this most affects – 15.1 (goto) and 21.4 (<setjmp.h>) – a parse-independent textual backstop (scripts/checks/check_no_goto_setjmp.py) closes the gap for goto / setjmp / longjmp across the whole tree.