From 69df1dcde343a91745f5ca4cbb0d170fec95e3f3 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 5 Mar 2026 23:53:35 -0800 Subject: [PATCH] Fix GCC -Werror=return-type Summary: X-link: https://github.com/facebook/yoga/pull/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 --- packages/react-native/ReactCommon/yoga/yoga/YGNodeStyle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactCommon/yoga/yoga/YGNodeStyle.cpp b/packages/react-native/ReactCommon/yoga/yoga/YGNodeStyle.cpp index 8bfa58c6c0b..e43a38e64eb 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/YGNodeStyle.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/YGNodeStyle.cpp @@ -622,6 +622,7 @@ GridTrackSize gridTrackSizeFromTypeAndValue(YGGridTrackType type, float value) { case YGGridTrackTypeMinmax: return GridTrackSize::auto_(); } + fatalWithMessage("Unknown YGGridTrackType"); } StyleSizeLength styleSizeLengthFromTypeAndValue( @@ -639,6 +640,7 @@ StyleSizeLength styleSizeLengthFromTypeAndValue( case YGGridTrackTypeMinmax: return StyleSizeLength::ofAuto(); } + fatalWithMessage("Unknown YGGridTrackType"); } } // namespace