Repository navigation
[core] Fix -Wshadow build error in GcsActorManager with clang 17-21 - #66692
Conversation
Signed-off-by: dancingactor <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 325adb3. Configure here.
There was a problem hiding this comment.
Code Review
This pull request renames actor_id to dead_actor_id in a lambda capture list within GcsActorManager::Initialize to avoid shadowing. The review feedback suggests simplifying the capture list further by capturing observability_data directly by value instead of using an init-capture, which helps prevent potential -Wshadow warnings.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Ding-Xin Chen <[email protected]>
Signed-off-by: dancingactor <[email protected]>
|
I verified the fix with a minimal example on Linux using Clang 21.1.8 and |
Signed-off-by: dancingactor <[email protected]>
|
@Sparks0219 Thanks for review! |
…ay-project#66692) ## Description Building Ray from source on current master fails with Apple clang 17 (Xcode 26) because of a `-Wshadow -Werror` error introduced in ray-project#66073: ``` src/ray/gcs/actor/gcs_actor_manager.cc:1872:21: error: declaration shadows a structured binding [-Werror,-Wshadow] 1872 | {[this, actor_id = actor_id, observability_data = observability_data]( | ^ src/ray/gcs/actor/gcs_actor_manager.cc:1784:21: note: previous declaration is here 1784 | for (const auto &[actor_id, actor_table_data] : gcs_init_data.Actors()) { | ^ 1 error generated. ``` This PR fixes the issue by renaming the inner `actor_id` variable to eliminate the shadowing. ### Verification The build passes with this fix applied. ## Related issues Fixes ray-project#66691 --------- Signed-off-by: dancingactor <[email protected]> Signed-off-by: Ding-Xin Chen <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

Description
Building Ray from source on current master fails with Apple clang 17 (Xcode 26) because of a
-Wshadow -Werrorerror introduced in #66073:This PR fixes the issue by renaming the inner
actor_idvariable to eliminate the shadowing.Verification
The build passes with this fix applied.
Related issues
Fixes #66691