Skip to content

refactor: S10.10 mechanical MISRA sweep (10 rules, ~130 sites)#376

Merged
DavidCozens merged 12 commits into
mainfrom
refactor/s10-10-mechanical-misra-sweep
May 16, 2026
Merged

refactor: S10.10 mechanical MISRA sweep (10 rules, ~130 sites)#376
DavidCozens merged 12 commits into
mainfrom
refactor/s10-10-mechanical-misra-sweep

Conversation

@DavidCozens

@DavidCozens DavidCozens commented May 16, 2026

Copy link
Copy Markdown
Owner

Purpose

Closes #375. Lands the cross-cutting mechanical MISRA sweep specified in docs/misra-conformance.md ("Mechanical MISRA sweep — hybrid split"), plus the Rule 5.6 polyfill fix carried forward from S10.06. Finishes the cross-cutting batch begun by S10.07/S10.08/S10.09 before the per-component conformance sweeps begin.

Change Description

Per-rule landing, one commit per rule, in rule-size-descending order:

Rule Audit count After Commit subject
5.6 5 0 Switched SOLIDSYSLOG_STATIC_ASSERT polyfill to C11 _Static_assert (the typedef-trick form duplicated identifier solidsyslog_static_assert_ across every TU)
10.4 92 0 U-suffix sweep across Core/ + Platform/*/ — literals at flagged sites, SOLIDSYSLOG_MAX_MESSAGE_SIZE / SOLIDSYSLOG_MAX_INTEGRITY_SIZE / SOLIDSYSLOG_FORMATTER_OVERHEAD and the STORAGE_SIZE macros. Two byte-comparison sites (BOM strip, UTF-8 lead range) refactored to unsigned char + hex literals
10.1 11 0 Cast char to unsigned char for bitwise operators in SolidSyslogUtf8.h (5 sites), SolidSyslogFormatter.c (5 sites), and inlined the BITS_PER_BYTE enum constant as a literal 8U in SolidSyslogCrc16.c
15.7 10 0 Trailing else { /* explanatory */ } on ten if/else-if chains across Core and Platform
12.1 5+drift 0 Explicit precedence parens around sub-expressions mixing comparison with arithmetic. One ternary refactored to if/return (cppcheck-misra kept flagging return-of-ternary even bracketed)
10.8 2 0 Hoisted (uint32_t) cast above the composite expression in SolidSyslog_FormatNonZeroUtcOffset
2.5 2 0 Audit verdict ("delete unused") was wrong — the macros are public API consumed under Tests/ and Bdd/Targets/. Captured as D.012 in misra_suppressions.txt + docs/misra-deviations.md
14.4 1 0 BOOL from GetComputerNameExA compared with != FALSE
7.1 1 0 0600 octal → named hex constant OWNER_READ_WRITE = 0x180U in SolidSyslogPosixMessageQueueBuffer.c
3.1 1 0 Dropped https:// prefix from a URL in the SolidSyslogCrc16.c banner — the // inside /* */ was a nested comment-start
Total 130 0

New deviations introduced as byproducts of the sweep:

  • D.011 — Rule 20.10: the # operator in the _Static_assert wrapper is unavoidable for stringifying the msg argument; documented per MISRA Compliance:2020 §4.2 deviation-record format.
  • D.012 — Rule 2.5: public API macros consumed outside the cppcheck-misra scope; documented with the actual consumer list.

Both are line-specific in misra_suppressions.txt so genuinely unused macros and stray #/## use elsewhere still surface as fresh findings.

Auditor view of suppressions placement discussed during the story: structural deviations live in misra_suppressions.txt + docs/misra-deviations.md (the project's existing D.001–D.010 pattern) rather than inline cppcheck-suppress comments. Reasoning maps to MISRA Compliance:2020 §4.2: centralised, listable, auditable, and each D.XXX carries an explicit "Risk and mitigation" path-to-elimination section.

Verdict re-categorisations from the audit (three rules had wrong or incomplete verdicts):

  • Rule 2.5 was tagged Fix — should have been Deviate (the macros aren't unused).
  • Rule 5.6 was tagged "per-site review" — actual cause was a single polyfill macro emitting the same typedef name in every TU.
  • Rule 12.1 count grew 5 → 8 → 10 as earlier fixes widened cppcheck-misra's visibility into bracketed sub-expressions and into the new _Static_assert condition. All resolved.

Test Evidence

  • After every rule's commit, cppcheck --addon=misra re-run in the gcc container to confirm the per-rule count went to 0. No behaviour-change commits (every fix is structural or essential-type-mechanical), so existing tests verify behaviour preservation.
  • Full local CI battery green: build-linux-gcc, build-linux-clang, sanitize-linux-gcc, coverage-linux-gcc (99.5% line, 98.9% functions — unchanged), analyze-tidy, analyze-cppcheck (both passes), analyze-format (clang-format dry-run clean after the macro-rewrite reflow).
  • One clang-tidy bugprone-easily-swappable-parameters warning surfaced after the Rule 10.1 refactor changed Formatter_IsAboveUnicodeMaxEncoding's body shape; suppressed with NOLINTBEGIN/END matching the existing pattern on Formatter_WriteContext.

Areas Affected

  • Core/Source/SolidSyslogMacros.h (polyfill switch), SolidSyslogFormatter.c, SolidSyslog.c, SolidSyslogCrc16.c, SolidSyslogUtf8.h, SolidSyslogFileBlockDevice.c, BlockSequence.c, RecordStore.h, SolidSyslogUdpPayload.c, SolidSyslogUdpSender.c, SolidSyslogStreamSender.c, SolidSyslogCircularBuffer.c, SolidSyslogMetaSd.c, SolidSyslogOriginSd.c, SolidSyslogTimeQualitySd.c, SolidSyslogAtomicCounter.c.
  • Core/Interface/SolidSyslogTunablesDefaults.h, SolidSyslogSecurityPolicyDefinition.h, SolidSyslogBlockStore.h, SolidSyslogFileBlockDevice.h, SolidSyslogStreamSender.h, SolidSyslogFormatter.h, SolidSyslogCircularBuffer.h.
  • Platform/*/Platform/Posix/Source/{SolidSyslogPosixFile,SolidSyslogPosixHostname,SolidSyslogPosixMessageQueueBuffer,SolidSyslogPosixDatagram,SolidSyslogPosixTcpStream}.c; Platform/Windows/Source/{SolidSyslogWindowsFile,SolidSyslogWindowsHostname,SolidSyslogWinsockDatagram,SolidSyslogWinsockTcpStream}.c; Platform/OpenSsl/Source/SolidSyslogTlsStream.c; all Platform/*/Interface/Solid*.h storage-size enum + slots[] arrays.
  • Docs / configdocs/misra-conformance.md (rows marked landed, totals updated, sweep-volume table renumbered to S10.11..S10.18), docs/misra-deviations.md (D.011, D.012 added), misra_suppressions.txt (line-specific entries for D.011 / D.012), DEVLOG.md (session entry), CLAUDE.md unchanged.
  • No Tests/ or Bdd/ changes — the sweep is structural and the existing test suite verifies behaviour preservation.

Closes #375

Summary by CodeRabbit

  • Refactor

    • Enhanced type safety with consistent unsigned integer literal handling and improved type-aware comparisons throughout codebase
  • Documentation

    • Updated MISRA C:2012 compliance documentation with refined audit results and deviation tracking records
  • Chores

    • Internal code quality improvements for standards conformance and reliability

Review Change Stack

DavidCozens and others added 12 commits May 15, 2026 18:12
Append __LINE__ via two-step concat so each typedef expansion produces
a unique name within a translation unit, satisfying MISRA C:2012
Rule 5.6 (typedef name shall be a unique identifier).

cppcheck-misra: rule 5.6 findings 5 → 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add U suffix to integer literals (and a handful of anonymous-enum
initializers and named tunable constants) so each operator's operands
share the same MISRA essential-type category. Two byte-comparison sites
in SolidSyslog.c (BOM strip) and SolidSyslogFormatter.c (UTF-8 lead
range) refactored to use `unsigned char` comparisons with hex literals
where the (char) cast did not satisfy cppcheck-misra's essential-type
tracking. SOLIDSYSLOG_FORMATTER_STORAGE_SIZE picks up U on the literal
inside the macro so every expansion is uniform.

cppcheck-misra: rule 10.4 findings 92 → 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rations

Bitwise operators (& == << ^=) on plain char are inappropriate per
MISRA Rule 10.1 — chars are essentially-character, the bitwise
operators require essentially-unsigned operands. Cast char operands to
unsigned char and U-suffix the hex literal masks they are tested
against. Affected sites:

- Core/Source/SolidSyslogUtf8.h: five top-bit classifiers
  (IsAsciiByte, IsContinuationByte, IsTwoByteLead, IsThreeByteLead,
  IsFourByteLead).
- Core/Source/SolidSyslogFormatter.c: IsOverlongTwoByteLead,
  IsOverlongThreeByteEncoding, IsUtf16SurrogateEncoding,
  IsOverlongFourByteEncoding, IsAboveUnicodeMaxEncoding.
- Core/Source/SolidSyslogCrc16.c: the data-byte shift inside
  SolidSyslogCrc16_Compute now uses a literal 8U (the BITS_PER_BYTE
  anonymous-enum constant remained essentially-signed for cppcheck-misra
  even after U-suffixing the initializer); the unrelated enum
  initializers picked up matching U suffixes for visual consistency
  inside the same block.

cppcheck-misra: rule 10.1 findings 11 → 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…SRA 15.7)

Add empty else clauses with explanatory comments to ten if/else-if
chains spanning Core/Source/ and Platform/*/Source/. The else bodies
hold no code — they document the residual case the existing branches
do not cover, which is what Rule 15.7 asks for.

cppcheck-misra: rule 15.7 findings 10 → 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add parentheses around sub-expressions mixing comparison/equality with
arithmetic or logical operators to make precedence explicit per MISRA
Rule 12.1 (advisory). One ternary in SolidSyslogUdpPayload_FromMtu
refactored to a small if/return — cppcheck-misra continued to flag the
return-of-ternary form even after bracketing both arms.

cppcheck-misra: rule 12.1 findings 5 → 0 (audit baseline; +3 newly
surfaced sites that fell out of the 10.4 sweep were swept along).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…10.8)

Cast absoluteMinutes to uint32_t once at the top of
SolidSyslog_FormatNonZeroUtcOffset and use uint32_t arithmetic for the
hours/minutes split. Previous form cast each composite (absoluteMinutes
/ 60) and (absoluteMinutes % 60) — a different essential-type category
on a composite expression, which violates MISRA Rule 10.8.

cppcheck-misra: rule 10.8 findings 2 → 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…acros

The two SOLIDSYSLOG_CIRCULARBUFFER_STORAGE_SIZE[_BYTES] macros are part
of the public API: integrator code under Tests/ and Bdd/Targets/ calls
them to size caller-supplied storage. cppcheck-misra runs only over
Core/Source/ + Platform/*/Source/, so from its scope the macros look
unused. Annotate with an inline `cppcheck-suppress misra-c2012-2.5`
naming the consumers, so the rule keeps catching genuinely-unused
macros elsewhere.

Also U-suffix a literal inside SOLIDSYSLOG_CIRCULARBUFFER_STORAGE_SIZE_BYTES
to match the Rule 10.4 sweep style — the macro is not currently expanded
inside any cppcheck-scanned TU, so this is preemptive consistency.

The audit's original verdict ("unused — delete them") was wrong: the
macros are used, just outside cppcheck's scope.

cppcheck-misra: rule 2.5 findings 2 → 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…(MISRA 14.4)

GetComputerNameExA returns BOOL (typedef int in Win32). The
controlling expression of an if shall have essentially boolean type
(MISRA 14.4); a bare BOOL value does not. Compare against FALSE so
the != yields a real boolean result.

cppcheck-misra: rule 14.4 findings 1 → 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…MISRA 7.1)

MISRA 7.1 prohibits octal literals — Posix permission bits are
traditionally written in octal (0600 = owner read/write), but the
project has agreed to avoid octal in production code. Replace with a
named hex constant OWNER_READ_WRITE = 0x180U inside a local anonymous
enum so the literal is named at the call site and the value documents
what each bit represents.

cppcheck-misra: rule 7.1 findings 1 → 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… (MISRA 3.1)

The CRC-16 banner comment contained a https:// URL — the // inside a
/* */ block is a nested comment-start sequence, which MISRA 3.1
prohibits. Drop the protocol prefix and rephrase the citation; the host
+ path are still navigable.

cppcheck-misra: rule 3.1 findings 1 → 0.

All ten S10.10-scope rules now report zero findings:
5.6 (5→0), 10.4 (92→0), 10.1 (11→0), 15.7 (10→0), 12.1 (5→0+drift→0),
10.8 (2→0), 2.5 (2→0), 14.4 (1→0), 7.1 (1→0), 3.1 (1→0).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d D.011/D.012

Two related changes for cleaner MISRA conformance:

1. **STATIC_ASSERT polyfill (Rule 5.6 follow-up).** The negative-array-
   size form added earlier in this story used a __LINE__-concatenated
   typedef name to satisfy Rule 5.6 (typedef uniqueness). cppcheck-misra
   then surfaced 5 new Rule 2.3 findings (typedef declared but never
   used — by design for the assertion mechanism) and the ## operator
   itself was a Rule 20.10 violation. Net regression vs. baseline.

   Switch to a direct C11 _Static_assert wrapper that stringifies the
   msg argument. The library already compiles at --std=c11; this avoids
   the typedef entirely. New deviation D.011 covers the unavoidable #
   operator in the stringify wrapper.

2. **CircularBuffer 2.5 suppression (Rule 2.5 follow-up).** Move the
   inline cppcheck-suppress on the public API macros to a txt-file
   suppression paired with D.012, matching the project's structural
   deviation pattern. Inline rationale removed.

Also incidental:

- `SOLIDSYSLOG_STATIC_ASSERT` call sites in `SolidSyslogFormatter.c`
  and `SolidSyslogCircularBuffer.c` gain explicit parens around the
  `*` sub-expression — cppcheck-misra now analyses inside the
  `_Static_assert` condition and surfaces Rule 12.1.
- `OWNER_READ_WRITE` constant in `SolidSyslogPosixMessageQueueBuffer.c`
  moved from a function-local anonymous enum to the file-scope one,
  silencing a Rule 5.7 finding on the second anonymous enum block.
- `Formatter_IsAboveUnicodeMaxEncoding` gains a NOLINT for
  bugprone-easily-swappable-parameters — the Rule 10.1 refactor
  shifted the function body so that `lead` and `continuation1` are
  each used exactly once, tripping clang-tidy's heuristic.

cppcheck-misra: rules 5.6, 20.10, 2.3, 2.5, 5.7, 12.1 all 0 →
unchanged or → 0; no regressions in any sweep target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mark the ten sweep-target rule rows in misra-conformance.md as landed
in S10.10 with the count → 0 annotation matching the S10.07/S10.08/S10.09
style. Update the MISRA totals table to add the S10.10 row, move rule
2.5 from Fix to Deviate (D.012), and add the D.011 entry. Renumber the
per-component sweep target table from S10.10..S10.17 to S10.11..S10.18
to reflect the actual numbering after S10.10 took the slot. Mark the
Mechanical MISRA sweep table as landed with audit / post-S10.10
columns plus the two new deviations introduced as byproducts.

DEVLOG entry records:
- Story selection rationale and slicing approach
- Three audit verdict re-categorisations (rule 2.5, 5.6, 12.1)
- Quirks encountered (anonymous-enum essential-type tracking,
  (char) cast vs unsigned char, return-of-ternary, clang-tidy
  swappable-parameters sensitivity to body shape, clang-format
  re-flow on suppression comments)
- The auditor-view discussion on txt-file vs inline suppressions

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This pull request implements the S10.10 mechanical MISRA sweep: 125+ uniform fixes across compile-time constants, runtime arithmetic, UTF-8/formatter safety, control flow, and static assertions. Changes add explicit U suffixes to unsigned literals, cast comparisons to prevent sign-extension issues, add exhaustive else branches, and modernize compile-time assertions to C11 _Static_assert. All changes preserve existing behavior; tests verify invariants. Two new MISRA deviations (D.011, D.012) are documented and suppressed.

Changes

Unsigned Literal and Type Safety Fixes

Layer / File(s) Summary
Public interface header compile-time constants
Core/Interface/SolidSyslog*.h, Platform/*/Interface/SolidSyslog*.h
Enum constants and macro expressions updated to use unsigned integer literals (U suffixes) in storage-size calculations and array-length formulas (e.g., sizeof(intptr_t) * 32U, ... - 1U). Applies across 27 header files (BlockStore, CircularBuffer, FileBlockDevice, Formatter, SecurityPolicy, StreamSender, Tunables, FatFs, FreeRtos Datagram/Mutex/Resolver/TcpStream, OpenSsl TlsStream, Posix File/Mutex/TcpStream, Windows File/Mutex/WinsockTcpStream).
Core UTF-8, formatter, and CRC safety casts
Core/Source/SolidSyslogFormatter.c, Core/Source/SolidSyslogUtf8.h, Core/Source/SolidSyslogCrc16.c, Core/Source/SolidSyslogMacros.h
Type-safe updates: explicit (unsigned char) casts in UTF-8 byte classification and BOM detection, unsigned mask constants (0xEFU, 0xC0U, 0xE0U, etc.), capacity checks using 0U, and CRC constants with U suffixes. Prevents sign-extension issues in character comparisons and UTF-8 sequence validation.
Core source arithmetic and enum constant updates
Core/Source/BlockSequence.c, Core/Source/RecordStore.h, Core/Source/SolidSyslog.c, Core/Source/SolidSyslogAtomicCounter.c, Core/Source/SolidSyslogCircularBuffer.c, Core/Source/SolidSyslogMetaSd.c, Core/Source/SolidSyslogOriginSd.c, Core/Source/SolidSyslogTimeQualitySd.c
Enum constants (e.g., SEQUENCE_MODULUSU), sequence/block counters, UTC offset formatting (cast absolute offset to uint32_t), structured-data field checks (use 0U), and boundary/rounding arithmetic updated to use U-suffixed unsigned literals. 34 ranges covering arithmetic consistency across core modules.
Platform UDP, messaging, and hostname unsigned updates
Platform/Posix/Source/SolidSyslogPosixHostname.c, Platform/Posix/Source/SolidSyslogPosixMessageQueueBuffer.c, Platform/Windows/Source/SolidSyslogWindowsFile.c, Platform/Windows/Source/SolidSyslogWindowsHostname.c
Platform utilities updated: UDP payload sizing uses U-suffixed constants; message queue uses new named permission constant (OWNER_READ_WRITE); hostname buffers and file-size fallbacks return explicit 0U instead of 0; function result checks use explicit != FALSE comparisons.

Control Flow Clarification: Explicit Else Branches

Layer / File(s) Summary
Networking and connection exhaustive failure handling
Platform/Posix/Source/SolidSyslogPosixDatagram.c, Platform/Posix/Source/SolidSyslogPosixTcpStream.c, Platform/Windows/Source/SolidSyslogWinsockDatagram.c, Platform/Windows/Source/SolidSyslogWinsockTcpStream.c, Platform/OpenSsl/Source/SolidSyslogTlsStream.c
TCP/UDP send and connect operations now include explicit else branches for generic (non-special-case) failures: POSIX sendto errors other than EMSGSIZE, TCP connect failures other than EINPROGRESS, Windows sendto non-WSAEMSGSIZE failures, and Windows connect non-WSAEWOULDBLOCK failures. Result remains Failed or false in those paths; branches clarify exhaustive handling with inline comments.
Block sequence and circular buffer exhaustive cases
Core/Source/BlockSequence.c
BlockSequence internal functions (ScanForBlockPresence, PrepareForWrite, NotifyThresholdCrossed) add explicit else branches documenting "no change needed" paths (already-notified threshold, current block has room, absent run already recorded). Code flow and results unchanged; documentation clarified.

Static Assertion Modernization

Layer / File(s) Summary
SOLIDSYSLOG_STATIC_ASSERT C11 modernization
Core/Source/SolidSyslogMacros.h, Core/Source/SolidSyslogCircularBuffer.c
Replaces portable negative-array-size typedef mechanism with C11 _Static_assert, including stringification helper macros (SOLIDSYSLOG_STATIC_ASSERT_STRING_INNER, SOLIDSYSLOG_STATIC_ASSERT_STRING). Assertion layout check in SolidSyslogCircularBuffer.c updated to reflect new overhead-size expression. Enables readable compile-time error messages.

Documentation and Deviation Records

Layer / File(s) Summary
DEVLOG entry for S10.10 mechanical MISRA sweep
DEVLOG.md
Appends dated section (2026-05-16) documenting S10.10 scope, rule-by-rule commit execution, verdict re-categorizations with new deviation IDs (D.011, D.012), and notable audit/suppression gotchas encountered during the sweep.
MISRA deviation documentation (D.011, D.012)
docs/misra-deviations.md
Introduces D.011 for rule 20.10 (stringification operator in SOLIDSYSLOG_STATIC_ASSERT_STRING_INNER macro), and D.012 for rule 2.5 (two unused public storage-size macros in SolidSyslogCircularBuffer.h retained because consumers reside outside scan scope). Includes scope, rationale, and elimination-path notes.
MISRA conformance table and suppression updates
docs/misra-conformance.md, misra_suppressions.txt
Refreshes MISRA C:2012 conformance table with updated per-rule verdicts, story references (notably S10.10), and new deviation IDs. Reconciles totals to 388 Fix + 190 Deviate = 575. Notes rule 2.5 moved from Fix to Deviate and deviations D.011/D.012 are S10.10 byproducts. Adds cppcheck-misra suppression entries for D.011 (rule 20.10) and D.012 (rule 2.5) at specified file locations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • DavidCozens/solid-syslog#348: Updates to SolidSyslogTunablesDefaults.h overlap with this PR's unsigned-literal sweep of the same tunables macro.
  • DavidCozens/solid-syslog#330: This PR's updates to FreeRTOS mutex header sizing arithmetic overlap with that PR's introduction of the mutex storage contract.
  • DavidCozens/solid-syslog#187: This PR's stream-sender compile-time sizing adjustments overlap with that PR's introduction of the storage layout.

🐰 Unsigned leaves no stone unturned,
Else branches spell intent well-learned,
Static assertions now speak clear,
Type safety whispers in each ear.
The sweep is done—no findings fear!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: a mechanical MISRA sweep addressing 10 rules across ~130 sites using structural/type-safe fixes.
Description check ✅ Passed The description comprehensively covers Purpose, Change Description (with detailed per-rule table), Test Evidence, and Areas Affected sections matching the template.
Linked Issues check ✅ Passed The PR implements all acceptance criteria from #375: cppcheck-misra zero findings for 10 rules, U-suffix sweeps, precedence parens, trailing else clauses, unsigned char casts, composite-expression casts, octal-to-hex conversion, nested-comment fixes, unused-macro deviations, updated docs/misra-conformance.md and DEVLOG, all CI passing.
Out of Scope Changes check ✅ Passed All changes are within scope: structural/type-mechanical fixes for rules 5.6/10.4/10.1/15.7/12.1/10.8/2.5/14.4/7.1/3.1, documentation updates, and suppression entries. No per-component judgmental fixes, naming sweeps, or enforcement-mode changes present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/s10-10-mechanical-misra-sweep

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1126 passed, 🙈 2 skipped)
   🚦   build-freertos-host-tdd: 100% successful (✔️ 1246 passed, 🙈 2 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1078 passed, 🙈 2 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1078 passed, 🙈 2 skipped)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu: 73% successful (✔️ 36 passed, 🙈 13 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 982 passed, 🙈 1 skipped)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1078 passed, 🙈 2 skipped)
   ⚠️   Clang-Tidy: 84 warnings (normal: 84)
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/misra-deviations.md (1)

819-825: ⚡ Quick win

Add language identifier to fenced code block.

The code fence displaying grep results should specify a language identifier (e.g., text or shell) to satisfy markdownlint MD040.

📝 Proposed fix
-```
+```text
 Tests/SolidSyslogCircularBufferTest.cpp         — both macros
 Tests/SolidSyslogTest.cpp                        — _BYTES form
 Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp — _SIZE form
 Bdd/Targets/Windows/BddTargetWindows.c           — _SIZE form
 Bdd/Targets/FreeRtos/main.c                      — _SIZE form
</details>

As per coding guidelines, markdownlint flagged this as MD040 (fenced-code-language).

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/misra-deviations.md around lines 819 - 825, The fenced code block in
docs/misra-deviations.md containing the grep results lacks a language identifier
and triggers markdownlint MD040; update that block by adding a language tag (for
example text) immediately after the opening triple backticks so the block
becomes ```text and retains the same contents (the lines listing
Tests/SolidSyslogCircularBufferTest.cpp, Tests/SolidSyslogTest.cpp,
Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp,
Bdd/Targets/Windows/BddTargetWindows.c, Bdd/Targets/FreeRtos/main.c) to satisfy
the linter.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @docs/misra-deviations.md:

  • Around line 819-825: The fenced code block in docs/misra-deviations.md
    containing the grep results lacks a language identifier and triggers
    markdownlint MD040; update that block by adding a language tag (for example
    text) immediately after the opening triple backticks so the block becomes
Tests/SolidSyslogCircularBufferTest.cpp, Tests/SolidSyslogTest.cpp,
Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp,
Bdd/Targets/Windows/BddTargetWindows.c, Bdd/Targets/FreeRtos/main.c) to satisfy
the linter.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d119fc2b-79fd-478d-aba5-d013c466690f

📥 Commits

Reviewing files that changed from the base of the PR and between f96064d and acf1a7e.

📒 Files selected for processing (48)
  • Core/Interface/SolidSyslogBlockStore.h
  • Core/Interface/SolidSyslogCircularBuffer.h
  • Core/Interface/SolidSyslogFileBlockDevice.h
  • Core/Interface/SolidSyslogFormatter.h
  • Core/Interface/SolidSyslogSecurityPolicyDefinition.h
  • Core/Interface/SolidSyslogStreamSender.h
  • Core/Interface/SolidSyslogTunablesDefaults.h
  • Core/Source/BlockSequence.c
  • Core/Source/RecordStore.h
  • Core/Source/SolidSyslog.c
  • Core/Source/SolidSyslogAtomicCounter.c
  • Core/Source/SolidSyslogCircularBuffer.c
  • Core/Source/SolidSyslogCrc16.c
  • Core/Source/SolidSyslogFileBlockDevice.c
  • Core/Source/SolidSyslogFormatter.c
  • Core/Source/SolidSyslogMacros.h
  • Core/Source/SolidSyslogMetaSd.c
  • Core/Source/SolidSyslogOriginSd.c
  • Core/Source/SolidSyslogTimeQualitySd.c
  • Core/Source/SolidSyslogUdpPayload.c
  • Core/Source/SolidSyslogUdpSender.c
  • Core/Source/SolidSyslogUtf8.h
  • DEVLOG.md
  • Platform/FatFs/Interface/SolidSyslogFatFsFile.h
  • Platform/FreeRtos/Interface/SolidSyslogFreeRtosDatagram.h
  • Platform/FreeRtos/Interface/SolidSyslogFreeRtosMutex.h
  • Platform/FreeRtos/Interface/SolidSyslogFreeRtosStaticResolver.h
  • Platform/FreeRtos/Interface/SolidSyslogFreeRtosTcpStream.h
  • Platform/OpenSsl/Interface/SolidSyslogTlsStream.h
  • Platform/OpenSsl/Source/SolidSyslogTlsStream.c
  • Platform/Posix/Interface/SolidSyslogPosixFile.h
  • Platform/Posix/Interface/SolidSyslogPosixMutex.h
  • Platform/Posix/Interface/SolidSyslogPosixTcpStream.h
  • Platform/Posix/Source/SolidSyslogPosixDatagram.c
  • Platform/Posix/Source/SolidSyslogPosixFile.c
  • Platform/Posix/Source/SolidSyslogPosixHostname.c
  • Platform/Posix/Source/SolidSyslogPosixMessageQueueBuffer.c
  • Platform/Posix/Source/SolidSyslogPosixTcpStream.c
  • Platform/Windows/Interface/SolidSyslogWindowsFile.h
  • Platform/Windows/Interface/SolidSyslogWindowsMutex.h
  • Platform/Windows/Interface/SolidSyslogWinsockTcpStream.h
  • Platform/Windows/Source/SolidSyslogWindowsFile.c
  • Platform/Windows/Source/SolidSyslogWindowsHostname.c
  • Platform/Windows/Source/SolidSyslogWinsockDatagram.c
  • Platform/Windows/Source/SolidSyslogWinsockTcpStream.c
  • docs/misra-conformance.md
  • docs/misra-deviations.md
  • misra_suppressions.txt

@DavidCozens DavidCozens merged commit 4666343 into main May 16, 2026
20 checks passed
@DavidCozens DavidCozens deleted the refactor/s10-10-mechanical-misra-sweep branch May 16, 2026 16:57
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.

S10.10: Mechanical MISRA sweep (tree-wide uniform fixes across 9 rules + Rule 5.6 polyfill)

1 participant