Mark loaderRequest __unused in RCTSyncImageManager to fix release-build unused-variable error#57227
Open
sammy-SC wants to merge 1 commit into
Open
Mark loaderRequest __unused in RCTSyncImageManager to fix release-build unused-variable error#57227sammy-SC wants to merge 1 commit into
sammy-SC wants to merge 1 commit into
Conversation
…ld unused-variable error Summary: WARNING: Generated by Autopilot (alpha) — review carefully, verify the underlying claim before accepting. Agent: Default: IROC Investigator | Trajectory: https://www.internalfb.com/intern/devai/devmate/inspector/e67dfb9b-9e79-4eb6-b114-2346948d1358/ | SC job: https://www.internalfb.com/intern/sandcastle/instance/4503602361875877/ --- In `-[RCTSyncImageManager requestImage:surfaceId:priority:]` the local `loaderRequest` is read only inside an `RCTLogWarn` call on the image-timeout path. In release/profile builds the logging macros compile down to a no-op (`do {} while (0)` when `RCTLOG_ENABLED == 0`), so the binding is never read and a stricter `-Werror,-Wunused-variable` check in the newer toolchain (LLVM 21) flags it as a hard compilation error. Mark the variable `__unused`, the established idiom already used throughout this codebase, so it is accepted whether or not logging is compiled in, while keeping the side-effecting loader call and the timeout-path log intact. This is not diagnostic suppression — `__unused` precisely documents that the binding is legitimately read only in builds where logging is enabled, and it does not hide unused-variable issues anywhere else in the file. Changelog: [Internal] Differential Revision: D108445102
|
@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108445102. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
WARNING: Generated by Autopilot (alpha) — review carefully, verify the underlying claim before accepting.
Agent: Default: IROC Investigator | Trajectory: https://www.internalfb.com/intern/devai/devmate/inspector/e67dfb9b-9e79-4eb6-b114-2346948d1358/ | SC job: https://www.internalfb.com/intern/sandcastle/instance/4503602361875877/
In
-[RCTSyncImageManager requestImage:surfaceId:priority:]the localloaderRequestis read only inside anRCTLogWarncall on the image-timeout path. In release/profile builds the logging macros compile down to a no-op (do {} while (0)whenRCTLOG_ENABLED == 0), so the binding is never read and a stricter-Werror,-Wunused-variablecheck in the newer toolchain (LLVM 21) flags it as a hard compilation error.Mark the variable
__unused, the established idiom already used throughout this codebase, so it is accepted whether or not logging is compiled in, while keeping the side-effecting loader call and the timeout-path log intact. This is not diagnostic suppression —__unusedprecisely documents that the binding is legitimately read only in builds where logging is enabled, and it does not hide unused-variable issues anywhere else in the file.Changelog: [Internal]
Differential Revision: D108445102