Skip to content

fix: MISRA deviations - #3

Merged
aajll merged 14 commits into
masterfrom
fix_misra_deviations
Jul 3, 2026
Merged

aajll merged 14 commits into
masterfrom
fix_misra_deviations

Conversation

@aajll

@aajll aajll commented Jul 2, 2026

Copy link
Copy Markdown
Owner

No description provided.

aajll added 14 commits July 2, 2026 09:28
Reverted the memcpy pointer-copy workaround for Rule 11.5: it traded a
well-defined pointer conversion for an object-representation copy with
no standard guarantee across pointer types, evaded the checker rather
than complying with the rule, and blinded cppcheck's dataflow (two
spurious constParameterPointer suggestions on buffers that are written
through the derived pointer). The casts are back, deviated inline with
an @deviation rationale.

Replaced the (void *) casts that silenced Rule 21.15 at 21 memcpy call
sites with two internal helpers, ppack_member_write and
ppack_member_read, which centralise the type-erased struct-member
copies behind a single documented deviation each, plus one inline
deviation for the deliberate F32 float/uint32_t pun. Call sites are now
cast-free and Rule 21.15 remains live against any future direct memcpy
in the file.

Also:
- added a _Static_assert that float is exactly 32 bits, an F32
  wire-format prerequisite that was previously only documented
- rewrote misra-deviations.txt for ppack (was copy-pasted from ucrc)
  and removed the stray ucrc tools/ reference from misra.toml
- replaced the stale file-header deviation record in src/ppack.c with
  a summary of the misch-driven workflow
- updated README, CONTRIBUTING and CHANGELOG to describe the misch
  audit and the three required-rule (21.15) deviations accurately
@aajll

aajll commented Jul 3, 2026

Copy link
Copy Markdown
Owner Author

Made use of misch (a new MISRA C:2023 checking tool I'm developing) for refining the remediation and acknowledgment of MISRA C deviations.

@aajll
aajll merged commit 292e836 into master Jul 3, 2026
5 checks passed
@aajll
aajll deleted the fix_misra_deviations branch July 3, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant