From 722623aaebb10acb68b3de24449815c619722028 Mon Sep 17 00:00:00 2001 From: Ingrid Wang Date: Fri, 20 Mar 2026 11:06:13 -0700 Subject: [PATCH] Fixing unreachable-code-return in react-native-github (#56093) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56093 ## Changelog [iOS][Fixed] - Addressing -Wunreachable-code-return issues. Reviewed By: javache Differential Revision: D96507093 fbshipit-source-id: 58f293b4978237cffa301c5518bf6aded9c3001c --- packages/react-native/React/Profiler/RCTProfile.m | 1 + .../nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/React/Profiler/RCTProfile.m b/packages/react-native/React/Profiler/RCTProfile.m index 2d5ddaf7618..b23f8ce56c9 100644 --- a/packages/react-native/React/Profiler/RCTProfile.m +++ b/packages/react-native/React/Profiler/RCTProfile.m @@ -315,6 +315,7 @@ void RCTProfileHookModules(RCTBridge *bridge) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wtautological-pointer-compare" +#pragma clang diagnostic ignored "-Wunreachable-code-return" if (RCTProfileTrampoline == NULL) { return; } diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm index b36c819cca8..cc45dfc44a8 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm @@ -156,7 +156,6 @@ convertJSIFunctionToCallback(jsi::Runtime &rt, jsi::Function &&function, const s return ^(NSArray *args) { if (!callback) { LOG(FATAL) << "Callback arg cannot be called more than once"; - return; } callback->call([args](jsi::Runtime &rt, jsi::Function &jsFunction) {