Repository navigation
fix(lint): restore a green cpp_linting on master - #4136
Merged
Merged
Conversation
`bash lint` has been failing on a clean checkout, which quietly trains everyone
to skip it or pass --skip-lint. All 19 hard failures came from one checker,
NoexceptAstChecker, across three files.
The 35 other findings the run prints are warn-only and are left alone:
[ContainerElementAddressChecker] 7 violations (warn-only — not failing CI)
[SingletonElisionChecker] 28 violations (warn-only — not failing CI)
Worth stating plainly, because the file list at the top of the output makes
them look like the problem: they are not what fails the build. Acting on them
would have meant rewriting ISR-shared DMA state in two Teensy FlexIO drivers
into fl::Singleton<T> -- a lazy-initialized indirection reachable from an
interrupt handler, in code whose own comments document an IMPRECISERR bus fault
from a freed channel pointer (#3410) and a posted-store race needing an
explicit dsb (#3416). The checker's message sanctions exactly that case with
FL_LINT_ALLOW_GLOBAL. Nothing here needs it today, so nothing is annotated;
that is a separate judgement for whoever owns those drivers.
What actually changed:
- fl/stl/thread_local.h (12) and platforms/shared/atomic.h (6) already marked
most of their members FL_NO_EXCEPT -- ThreadLocalReal's constructor,
destructor and operator=; AtomicReal's load, store and exchange -- and simply
missed the rest. FL_NO_EXCEPT is a no-op on every platform by design
(fl/stl/noexcept.h), so these are annotations with no semantic effect and no
terminate-on-throw risk on the allocating paths.
- platforms/stub/thread_stub_stl.h carried its own `namespace fl { void
yield(); }` forward declaration, duplicating fl/system/yield.h. Annotating a
second copy of a declaration is the wrong repair: the copies then have to be
kept in step by hand, and the day FL_NO_EXCEPT stops being a no-op a stale one
becomes a mismatched exception specification -- a compile error at the point
of use, far from the duplicate that caused it. The duplicate is gone and the
canonical header is included instead.
Verified: cpp_linting exits 0; 288/288 unit tests, and again from a clean
rebuild since swapping a forward declaration for a real include can only fail
on include order; esp32c6 Blink builds, atomic.h being shared platform code.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ByD5ZKrnFJuchjRmPiQdd5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bash lintfails on a clean checkout ofmaster, which quietly trains everyone to skip it or pass--skip-lint.All 19 hard failures came from one checker,
NoexceptAstChecker, across three files.The 35 other findings are not the problem
Worth stating explicitly, because the file list at the top of the output makes those 35 look like the failure — 11 files spanning asset, spi adapter, BLE, FlexIO, Teensy4 mocks. They fail nothing.
Acting on them would have meant rewriting ISR-shared DMA state in two Teensy FlexIO drivers into
fl::Singleton<T>— a lazy-initialized indirection reachable from an interrupt handler. That code's own comments document an IMPRECISERR data bus fault from a freed channel pointer (#3410) and a posted-store race needing an explicitdsb(#3416).flexio_dma_isrreadssDmaChanneland writessDmaComplete; a singleton there could be constructed from interrupt context.The checker's message sanctions exactly that case via
FL_LINT_ALLOW_GLOBAL. Nothing here needs it today, so nothing is annotated — that judgement belongs to whoever owns those drivers, not to a lint-cleanup PR.What actually changed
fl/stl/thread_local.h(12) andplatforms/shared/atomic.h(6) already marked most membersFL_NO_EXCEPT—ThreadLocalReal's constructor, destructor andoperator=;AtomicReal'sload,store,exchange— and simply missed the rest.FL_NO_EXCEPTis a no-op on every platform by design (fl/stl/noexcept.h), so these are annotations with no semantic effect and no terminate-on-throw risk on the allocating paths.platforms/stub/thread_stub_stl.hcarried its ownnamespace fl { void yield(); }, duplicatingfl/system/yield.h. Annotating a second copy of a declaration is the wrong repair: the copies then have to be kept in step by hand, and the dayFL_NO_EXCEPTstops being a no-op a stale one becomes a mismatched exception specification — a compile error at the point of use, far from the duplicate that caused it. The duplicate is gone; the canonical header is included instead.Verification
cpp_lintingexits 0atomic.his shared platform code, so a host-only pass would not have covered it🤖 Generated with Claude Code
https://claude.ai/code/session_01ByD5ZKrnFJuchjRmPiQdd5