Skip to content

fix: suppress warning around a constructor function#2840

Merged
Saadnajmi merged 1 commit intomicrosoft:mainfrom
eschwieb:user/eriksc/global_constructors
Feb 26, 2026
Merged

fix: suppress warning around a constructor function#2840
Saadnajmi merged 1 commit intomicrosoft:mainfrom
eschwieb:user/eriksc/global_constructors

Conversation

@eschwieb
Copy link
Copy Markdown

@eschwieb eschwieb commented Feb 25, 2026

Summary:

Xcode 26.4 now warns about functions annotated as constructors if the -Wglobal-constructors flag is enabled. We want that on as an error by default so that we don't trivially get new ones added, but we need to suppress the warning around existing code. Add this to ReactNative.

Test Plan

No testing needed; this only suppresses a compiler warning in a narrow location.

Xcode 26.4 now warns about functions annotated as constructors if the -Wglobal-constructors flag is enabled. We want that on as an error by default so that we don't trivially get new ones added, but we need to suppress the warning around existing code. Add this to ReactNative.
@eschwieb eschwieb requested a review from a team as a code owner February 25, 2026 18:50
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 25, 2026

⚠️ No Changeset found

Latest commit: ebf1c53

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Saadnajmi Saadnajmi changed the title Suppress warning around a constructor function fix: suppress warning around a constructor function Feb 25, 2026
@Saadnajmi Saadnajmi merged commit 0193af3 into microsoft:main Feb 26, 2026
26 of 39 checks passed
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Mar 10, 2026
## Summary: 

Xcode 26.4 now warns about functions annotated as constructors if the
-Wglobal-constructors flag is enabled. We want that on as an error by
default so that we don't trivially get new ones added, but we need to
suppress the warning around existing code. Add this to ReactNative.

<!-- Explain the **motivation** for making this change. What existing
problem does the pull request solve? -->

## Test Plan

No testing needed; this only suppresses a compiler warning in a narrow
location.

<!-- Demonstrate the code is solid. Example: The exact commands you ran
and their output, screenshots / videos if the pull request changes the
user interface. -->
Saadnajmi added a commit that referenced this pull request Mar 12, 2026
Backport #2840

Co-authored-by: Erik Schwiebert <eriksc@microsoft.com>
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.

2 participants