Skip to content

Silence Clang-tidy "reinterpret-cast" and "make-member-function-const" warnings#370

Merged
JanPetterMG merged 4 commits intomainfrom
silence-some-reintrepet-warnings
Feb 22, 2026
Merged

Silence Clang-tidy "reinterpret-cast" and "make-member-function-const" warnings#370
JanPetterMG merged 4 commits intomainfrom
silence-some-reintrepet-warnings

Conversation

@JanPetterMG
Copy link
Copy Markdown
Collaborator

Added "NOLINT" comments to silence some Clang-tidy warnings on lines that can't be optimized further.

For context: reinterpret-cast can technically be replaced by two static-casts, but that is even worse, and the canonical fix for those findings are to use reinterpret-cast instead.

Key changes

  • cppcoreguidelines-pro-type-reinterpret-cast
  • readability-make-member-function-const

Impact

Reduces the warning count, and avoids false positives. Most of all, it functions as a signal that people shouldn't try to fix the warnings, because someone already tried and met an dead-end in the process.

@JanPetterMG JanPetterMG added the chore This issue or pull request is a maintenance task label Feb 22, 2026
@JanPetterMG JanPetterMG added this to the v2.3.0 milestone Feb 22, 2026
@github-actions github-actions Bot added the firmware C++ related label Feb 22, 2026
@JanPetterMG JanPetterMG changed the title Added NOLINT comments Silence some Clang-tidy warnings Feb 22, 2026
@JanPetterMG JanPetterMG changed the title Silence some Clang-tidy warnings Silence Clang-tidy "reinterpret-cast" and "make-member-function-const" warnings Feb 22, 2026
@JanPetterMG JanPetterMG marked this pull request as ready for review February 22, 2026 16:52
@JanPetterMG JanPetterMG merged commit 6650569 into main Feb 22, 2026
201 of 250 checks passed
@JanPetterMG JanPetterMG deleted the silence-some-reintrepet-warnings branch February 22, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore This issue or pull request is a maintenance task firmware C++ related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant