Skip to content

chore: fix build warnings from compiler-flagged always-true/dead-code issues - #7697

Open
pfeerick wants to merge 5 commits into
mainfrom
pfeerick/fix-build-warnings
Open

chore: fix build warnings from compiler-flagged always-true/dead-code issues#7697
pfeerick wants to merge 5 commits into
mainfrom
pfeerick/fix-build-warnings

Conversation

@pfeerick

Copy link
Copy Markdown
Member

Summary

These have their origins in the same warning cleanup done for the 2.12.3 backport PR (#7687) — that PR carries the backport-appropriate subset of these fixes; this PR is the main-targeted equivalent plus the pa01/st16 SDRAM chore, which only applies to main.

Test plan

  • pl18ev, gx12, pa01, v12, st16 all rebuilt locally, confirmed the targeted warnings are gone and no new warnings introduced
  • fix(lua) hardware-tested on gx12
  • fix(pa01) hardware-tested on pa01
  • No functional/UI testing needed beyond the above — all fixes are warning-only preprocessor/type/dead-code adjustments with no intended behavior change

🤖 Generated with Claude Code

pfeerick and others added 5 commits August 23, 2026 05:11
…nly targets

The internal/external module OR-guard was added in #5703 without a
matching case for HARDWARE_EXTERNAL_MODULE-only targets (pl18/pl18ev/pl18u)
in cliSerialPassthrough's switch — the functions were compiled but never
called there, producing -Wunused-function warnings. Serial passthrough
over an external module isn't implemented yet, so narrow the guard to
match the only call site.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…g-less targets

Introduced in #6095: on targets with only a CFS LED strip and no
bling strip (BLING_LED_STRIP_LENGTH == 0, e.g. gx12/mt12/tx12mk2/boxer
sharing the RADIO_GX12 hal config), `id >= BLING_LED_STRIP_LENGTH` is
always true for the unsigned uint8_t id, triggering -Wtype-limits.
Nest the bling-specific check and offset adjustment inside their own
BLING_LED_STRIP_LENGTH > 0 guard, with an early return for the bling
case, so bling-less targets never compile the tautological comparison
at all; the CFS-handling body stays written once, shared by both
paths, matching existing runtime behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…gingInfo

Introduced in #6392: pa01 defines LED_CHARGING_START as 0, so
`i >= LED_CHARGING_START` with the loop's unsigned uint8_t i is
always true, triggering -Wtype-limits. Use a plain int loop variable
so the comparisons are ordinary signed comparisons instead of testing
a constant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Introduced already-dead in #7114: the `timeout` variable and its four
busy-wait loops were commented out from the start (copy-pasted from a
pre-#6952 st16/pa01 sdram_driver.cpp), leaving `timeout` unused and
triggering -Wunused-variable. No H750 target actually polls the SDRAM
BUSY flag - they all rely on the delay_ms(100) after CLK_ENABLE - so
this just catches helloradio-h750 up to jumper-h750/rm-h750/c14, which
already dropped the same dead block outright rather than commenting
it out (as #6952 did for st16/pa01).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Same dead code as helloradio-h750 (fixed in 8309ba5): the commented-out
`timeout`/busy-wait blocks in SDRAM_InitSequence() left over from before
#6952 commented out just the declaration on these two targets seven months
ago, but never removed the four dead wait-loop comment blocks themselves.
No functional change - the loops were already commented out - this just
brings pa01/st16 in line with jumper-h750/rm-h750/c14, which never had
this scaffolding in the first place.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pfeerick pfeerick added this to the 3.0 milestone Aug 23, 2026
@pfeerick pfeerick added compilation Related to compiling the firmware and firmware options house keeping 🧹 Cleanup of code and house keeping labels Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compilation Related to compiling the firmware and firmware options house keeping 🧹 Cleanup of code and house keeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant