Repository navigation
fix(gfx): rename rgbw min3 helper that collides with Zephyr's min3 macro - #4422
Conversation
ArduinoCore-zephyr (Arduino UNO Q) pulls <zephyr/sys/util.h> in through Arduino.h, and it defines min3(a, b, c) as a function-like macro. The anonymous-namespace helper in rgbw.cpp.hpp was also named min3, so the macro expanded its declaration and the fl.gfx unity TU failed to compile. Rename it to rgbw_min3. CI's arduino_uno_q target builds against STM32duino, not the Zephyr core, so it could not catch this. Fixes #4416 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe local RGBW ChangesRGBW helper collision fix
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The collision fix is complete at the helper and all three call sites, with no identified build or production regression. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Fixes #4416.
ArduinoCore-zephyr (Arduino UNO Q) includes
<zephyr/sys/util.h>viaArduino.h, and that header definesmin3(a, b, c)as a function-like macro. The helpermin3insrc/fl/gfx/rgbw.cpp.hppgot macro-expanded, sofl.gfx+.cppfailed to compile (expected unqualified-id before '{' token). The reporter confirmed that removing the collision makes it build.The helper is renamed to
rgbw_min3and getsFL_NO_EXCEPT(the noexcept ratchet counts the renamed helper as a new function). I searchedsrc/for the otherutil.hfunction-like macros (max3,IN_RANGE,CLAMP,ROUND_UP, …) and found no other collisions.Why CI missed it:
build_arduino_uno_q.ymlcompiles against the STM32duino STM32U585 toolchain, not the Zephyr core (see the comment inci/boards.py).Validation
bash test rgbw(quick and--debug) passesbash lint --cpppasses🤖 Generated with Claude Code
Summary by CodeRabbit