From 7a013675f5c59a6fe272edcac2b0c7bb3dc6992d Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 5 Mar 2026 23:51:37 -0800 Subject: [PATCH] Fix GCC -Werror=return-type 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 --- yoga/YGNodeStyle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yoga/YGNodeStyle.cpp b/yoga/YGNodeStyle.cpp index 8bfa58c6c0..e43a38e64e 100644 --- a/yoga/YGNodeStyle.cpp +++ b/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