Skip to content

Mark loaderRequest __unused in RCTSyncImageManager to fix release-build unused-variable error#57227

Open
sammy-SC wants to merge 1 commit into
react:mainfrom
sammy-SC:export-D108445102
Open

Mark loaderRequest __unused in RCTSyncImageManager to fix release-build unused-variable error#57227
sammy-SC wants to merge 1 commit into
react:mainfrom
sammy-SC:export-D108445102

Conversation

@sammy-SC

Copy link
Copy Markdown
Contributor

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

…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
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 16, 2026
@meta-codesync

meta-codesync Bot commented Jun 16, 2026

Copy link
Copy Markdown

@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108445102.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant