Fix GCC -Werror=return-type#1910
Closed
NickGerleman wants to merge 1 commit into
Closed
Conversation
Summary: GCC emits `-Wreturn-type` for `gridTrackSizeFromTypeAndValue` and `styleSizeLengthFromTypeAndValue` because it does not suppress the warning for exhaustive switches over C-style enums (unlike Clang). Add `fatalWithMessage` after each switch to satisfy `-Werror=return-type`, matching the existing pattern used in `Style.h` for similar exhaustive switches. Differential Revision: D95513063
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@NickGerleman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95513063. |
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Mar 6, 2026
Summary: X-link: react/yoga#1910 GCC emits `-Wreturn-type` for `gridTrackSizeFromTypeAndValue` and `styleSizeLengthFromTypeAndValue` because it does not suppress the warning for exhaustive switches over C-style enums (unlike Clang). Add `fatalWithMessage` after each switch to satisfy `-Werror=return-type`, matching the existing pattern used in `Style.h` for similar exhaustive switches. Differential Revision: D95513063
cortinico
approved these changes
Mar 6, 2026
cortinico
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
This pull request has been merged in 8484a8c. |
meta-codesync Bot
pushed a commit
to react/react-native
that referenced
this pull request
Mar 6, 2026
Summary: Pull Request resolved: #55967 X-link: react/yoga#1910 GCC with `-Wall -Werror` emits `-Wreturn-type` for `gridTrackSizeFromTypeAndValue` and `styleSizeLengthFromTypeAndValue` because it does not suppress the warning for exhaustive switches over C-style enums (unlike Clang). Add `fatalWithMessage` after each switch to satisfy `-Werror=return-type`, matching the existing pattern used in `Style.h` for similar exhaustive switches. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D95513063 fbshipit-source-id: aab3635b34ff2ca57bf138b92b7378f2608e605d
zoontek
pushed a commit
to zoontek/react-native
that referenced
this pull request
Mar 9, 2026
Summary: Pull Request resolved: react#55967 X-link: react/yoga#1910 GCC with `-Wall -Werror` emits `-Wreturn-type` for `gridTrackSizeFromTypeAndValue` and `styleSizeLengthFromTypeAndValue` because it does not suppress the warning for exhaustive switches over C-style enums (unlike Clang). Add `fatalWithMessage` after each switch to satisfy `-Werror=return-type`, matching the existing pattern used in `Style.h` for similar exhaustive switches. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D95513063 fbshipit-source-id: aab3635b34ff2ca57bf138b92b7378f2608e605d
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:
GCC emits
-Wreturn-typeforgridTrackSizeFromTypeAndValueandstyleSizeLengthFromTypeAndValuebecause it does not suppress thewarning for exhaustive switches over C-style enums (unlike Clang).
Add
fatalWithMessageafter each switch to satisfy-Werror=return-type,matching the existing pattern used in
Style.hfor similar exhaustiveswitches.
Differential Revision: D95513063