Skip to content

fix(lint): restore a green cpp_linting on master - #4136

Merged
zackees merged 1 commit into
masterfrom
fix/lint-container-data-ptr
Sep 1, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/lint-container-data-ptr

Conversation

@zackees

@zackees zackees commented Sep 1, 2026

Copy link
Copy Markdown
Member

bash lint fails on a clean checkout of master, 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

[ContainerElementAddressChecker]   7 violation(s)  (warn-only — not failing CI)
[SingletonElisionChecker]         28 violation(s)  (warn-only — not failing CI)
❌ Total violations: 19

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 explicit dsb (#3416). flexio_dma_isr reads sDmaChannel and writes sDmaComplete; 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) and platforms/shared/atomic.h (6) already marked most members FL_NO_EXCEPT — ThreadLocalReal's constructor, destructor and operator=; AtomicReal's load, store, 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(); }, 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; the canonical header is included instead.

Verification

  • 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 (422 KB flash, 22.2 KB RAM); atomic.h is shared platform code, so a host-only pass would not have covered it

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByD5ZKrnFJuchjRmPiQdd5

`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
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 1, 2026
@zackees
zackees merged commit 1cd3d3e into master Sep 1, 2026
30 checks passed
@zackees
zackees deleted the fix/lint-container-data-ptr branch September 1, 2026 22:26
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 1, 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.

1 participant