--- doc-id: SLM-EPB-MISRA-COMP-001 version: 1.0 status: Released date: 2026-05-12 --- # MISRA C:2012 Compliance Statement | Field | Value | |---------------|----------------------------------------| | Project | demo-epb | | Document ID | SLM-EPB-MISRA-COMP-001 | | Date | 2026-05-12 | | Standard | MISRA C:2012 (incl. Amendment 1) | | Compiler | GCC 11.2 (Linux CI) / GCC 16.1 (Win) | | Checker | Cppcheck 2.7+ with `--addon=misra` | --- ## 1. Summary The source code of demo-epb has been checked against MISRA C:2012. All **Required** and **Mandatory** rules are observed, with the exception of one documented deviation (see MISRA-REC-001). **Compliance statement:** demo-epb v1.0 is **MISRA C:2012 compliant** taking into account the documented deviation records. ## 2. Scope | Module | MISRA-checked | |------------------------------|--------------------------| | `src/switch_debouncer.{c,h}` | Yes | | `src/actuator_driver.{c,h}` | Yes | | `src/apply_controller.{c,h}` | Yes | | `src/safety_manager.{c,h}` | Yes | | `src/epb_types.h` | Yes | | `src/stubs/*.h` | Header-only, no MISRA-relevant implementations | | `tests/**/*` | Out of scope (test code) | | `tools/**/*` | Out of scope (Python scripts) | ## 3. Rule activation The Cppcheck MISRA addon checks the following rule categories: | Category | Count | Activation in project | |-----------|--------|----------------------------------| | Mandatory | 9 | All active, violation blocks build | | Required | 119 | All active, violation blocks build | | Advisory | 47 | Active at warning level, deviations allowed per record | ## 4. Compliance status per rule category ### 4.1 Mandatory rules (9) | Rule | Status | |-------------|------------| | R 9.1, R 9.2, R 9.3 | Compliant | | R 13.6, R 17.3, R 17.4 | Compliant | | R 19.1, R 21.13, R 21.17 | Compliant | | R 21.18, R 21.19, R 21.20 | Compliant | **Mandatory status: 100% Compliant.** ### 4.2 Required rules Total: 119 Required rules. Violations: **0**. Top relevant rules for this project: | Rule | Description | Status | |---------|----------------------------------------------------------|----------| | R 8.1 | Type specifier shall be explicit | Compliant | | R 8.2 | Function parameters shall be explicitly named | Compliant | | R 8.4 | Compatible declaration shall be visible | Compliant | | R 8.7 | Functions shall not have external linkage if used in one unit | Compliant | | R 14.1 | Loop counter shall not have essentially floating type | Compliant | | R 14.4 | Controlling expression shall have essentially Boolean type | Compliant | | R 15.4 | At most one break or goto per loop | Compliant | | R 17.7 | Return value of non-void function shall be used | Compliant (or explicit `(void)`) | | R 21.3 | No dynamic memory allocation (malloc/free) | Compliant (no heap use) | | R 21.4 | No setjmp/longjmp | Compliant | ### 4.3 Advisory rules 47 Advisory rules. Violations are documented via MISRA deviation records. | Record ID | Rule | File | Rationale summary | |-------------------|---------|-------------------------------|-----------------------------| | MISRA-REC-001 | R 15.5 | `src/apply_controller.c:64` | Early-exit for NULL check | **Advisory status: 1 deviation record, documented.** ## 5. Check pipeline ```bash cppcheck \ --enable=all \ --inconclusive \ --error-exitcode=1 \ --suppress=missingIncludeSystem \ --suppress=unusedFunction \ --addon=misra \ -I src src ``` Checks are run: - Locally before each commit (recommended) - Automatically in CI on every push and PR - Before each release (tag push triggers release.yml) ## 6. Deviation Permits (project-wide) No project-wide permits are active. ## 7. Re-audit triggers This compliance statement must be re-created on the following changes: - Compiler change (e.g. GCC → Clang) - Major update of Cppcheck or the MISRA addon - New source files outside `src/` - MISRA standard update (e.g. C:2025 release) ## 8. Revision history | Version | Date | Change | Author | |---------|-------------|---------------------|------------| | 1.0 | 2026-05-12 | First release v1.0 | S. Lohmaier|