Skip to content

fix(stl): rename index_sequence_concat params that collide with pin macros - #4427

Merged
zackees merged 1 commit into
masterfrom
fix/index-sequence-pin-macro-collision
Sep 18, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/index-sequence-pin-macro-collision

Conversation

@zackees

@zackees zackees commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

The rp2350B SparkfunXRP workflow has failed on every master run since #4412 (e.g. 35329223587). Every sketch fails:

variants/sparkfun_xrp_controller/pins_arduino.h:66:12: error: expected nested-name-specifier before '(' token
lib/FastLED/fl/stl/type_traits.h:1163:20: note: in expansion of macro 'S1'
lib/FastLED/fl/stl/type_traits.h:1166:23: error: parameter pack 'I1' must be at the end of the template parameter list

Cause

arduino-pico's sparkfun_xrp_controller variant defines S1..S4 as servo pin macros. index_sequence_concat, added with the log-depth make_index_sequence in #4412, used S1/S2 as template parameter names, so the preprocessor expanded them. This is the same class of bug as #4416 (Zephyr's min3 macro).

Fix

Rename the parameters to LhsSeq/RhsSeq (and the packs I1/I2 to Lhs/Rhs), with a comment explaining why short names are avoided there. I also checked every other macro that variant defines (M3_IN_1, ML_ENC_A, …) against src/ and found no other collisions.

Validation

  • bash compile sparkfun_xrp_controller all: all examples compile locally (before: every example failed).
  • Host: bash test type_traits and bash test gamma_lut pass (gamma_lut.h builds its table with make_index_sequence).
  • bash lint --cpp passes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Improved internal naming in sequence concatenation declarations for clearer code maintenance.
    • Preserved existing behavior and public interfaces.

…acros

The SparkFun XRP controller's pins_arduino.h (arduino-pico) defines
S1..S4 as servo pin macros. index_sequence_concat, added with the
log-depth make_index_sequence in #4412, used S1/S2 as its template
parameter names. The macros expanded them and every sketch on that board
failed to compile. The rp2350B SparkfunXRP workflow has been red on
master since.

Rename them to LhsSeq/RhsSeq (and the I1/I2 packs to Lhs/Rhs).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d52ca15d-b8b6-4fd8-ac00-cc4116aaff1b

📥 Commits

Reviewing files that changed from the base of the PR and between d392393 and 3a40e58.

📒 Files selected for processing (1)
  • src/fl/stl/type_traits.h

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The change renames internal template parameters in fl::index_sequence_concat and updates its comment. The type computation and exported declarations remain unchanged.

Changes

Template Parameter Naming

Layer / File(s) Summary
Rename template parameters
src/fl/stl/type_traits.h
S1 and S2 become LhsSeq and RhsSeq. I1... and I2... become Lhs... and Rhs.... The comment explains the macro-expansion concern.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 3a40e

This is a low-risk naming-only change with no identified impact on supported behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: renaming index_sequence_concat parameters to prevent collisions with pin macros.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit 4b080e6 into master Sep 18, 2026
25 checks passed
@zackees
zackees deleted the fix/index-sequence-pin-macro-collision branch September 18, 2026 10:16
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 18, 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