Skip to content

fix(native-core): silence unused block parameter warnings in macOS FocusZone - #4365

Closed
Saad Najmi (Saadnajmi) wants to merge 1 commit into
microsoft:mainfrom
Saadnajmi:saadnajmi-upstream-furn-focuszone-fix
Closed

Saad Najmi (Saadnajmi) wants to merge 1 commit into
microsoft:mainfrom
Saadnajmi:saadnajmi-upstream-furn-focuszone-fix

Conversation

@Saadnajmi

Copy link
Copy Markdown
Collaborator

Platforms Impacted

  • iOS
  • macOS
  • win32 (Office)
  • windows
  • android

Description of changes

The block passed to indexOfObjectPassingTest: in -[RCTFocusZone nextViewToFocusInHierarchyForAction:] never reads its index or stop parameters, so clang reports -Wunused-parameter for both. Builds that treat that warning as an error, such as Office's macOS build, fail to compile RCTFocusZone.m.

  • packages/agentic/native-core/macos/components/FocusZone/shared/RCTFocusZone.m: mark both parameters __unused. No behavior change; this is the only copy of the block on main.
  • .changeset/native-core-focuszone-unused-params.md: patch changeset for @fluentui-react-native/native-core.

Verification

Compiled the exact block from RCTFocusZone.m (before and after this change) inside a stub function with Xcode 26.4.1:

xcrun clang -fsyntax-only -fobjc-arc -Wall -Wextra -Wunused-parameter -Werror repro.m

Before After
Failed: unused parameter 'index' and unused parameter 'stop' [-Werror,-Wunused-parameter] Passed with no diagnostics

Not run locally: a full macOS app build and yarn change:check (CI runs the changeset check).

Pull request checklist

This PR has considered (when applicable):

  • Automated Tests
  • Documentation and examples
  • Keyboard Accessibility
  • Voiceover
  • Internationalization and Right-to-left Layouts

…cusZone

Mark the unused `index` and `stop` parameters of the
indexOfObjectPassingTest: block in RCTFocusZone.m as `__unused` so the file
compiles cleanly when -Wunused-parameter is treated as an error.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d7aea072-fc8e-4a8d-890a-81311025130d
@Saadnajmi

Copy link
Copy Markdown
Collaborator Author

Folded into #4364, which now includes this change and its changeset.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle size report

Tree-shaken, minified production esbuild bundles with React and React Native runtimes externalized.

Scenario Modules-Mac (Δ) Modules-Win (Δ) Size-Mac (Δ) Size-Win (Δ)
components-button 62 (+0) 63 (+0) 49.94k (+0b) 49.87k (+0b)
components-catalog 159 (+0) 160 (+0) 155.26k (+0b) 155.19k (+0b)
design-theme-state 33 (+0) 34 (+0) 30.11k (+0b) 30.03k (+0b)
design-themed-root 37 (+0) 38 (+0) 32.07k (+0b) 32.00k (+0b)
design-color-lib 6 (+0) 6 (+0) 6.33k (+0b) 6.33k (+0b)
design-theme-state-legacy-source 34 (+0) 35 (+0) 31.77k (+0b) 31.69k (+0b)
design-legacy-theme-from-flex 57 (+0) 58 (+0) 97.72k (+0b) 97.59k (+0b)

The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail.


View bundle-size workflow run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant