Skip to content

Fix MISRA C++ RULE-7-0-1 conversions from bool - #1440

Merged
castler merged 1 commit into
mainfrom
fix/misra-7-0-1-bool-conversions
Oct 26, 2026
Merged

castler merged 1 commit into
mainfrom
fix/misra-7-0-1-bool-conversions

Conversation

@castler

@castler castler commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes the genuine no-conversion-from-bool findings (TransactionLogSlot, message_passing LogConvert, ReadMaskSet). Behavior unchanged; affected tests pass. Remaining alerts are bool-to-reference FPs fixed upstream in github/codeql-coding-standards#1176 (2.63.0) or structured-binding FPs.

- TransactionLogSlot: convert bool to the stored uint8_t via an explicit
  conditional instead of static_cast<uint8_t>(bool).
- message_passing LogConvert: add a dedicated bool overload that logs
  0/1 (unchanged output) instead of casting bool through the unsigned
  integer overload.
- ReadMaskSet: the bitmask operator& already yields bool, so return it
  directly instead of casting to the underlying type and comparing.

No functional change. The remaining alerts for this rule are bool-to-
bool-reference bindings, already fixed in codeql-coding-standards
(github/codeql-coding-standards#1176) and expected in 2.63.0, and
reference bindings in structured bindings that are query false positives.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@castler
castler marked this pull request as ready for review October 26, 2026 10:32
@castler
castler enabled auto-merge October 26, 2026 10:32
@castler
castler added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 0bed7b2 Oct 26, 2026
19 checks passed
@castler
castler deleted the fix/misra-7-0-1-bool-conversions branch October 26, 2026 13:40
@github-project-automation github-project-automation Bot moved this from Backlog to Done in COM - Communication FT Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants