From 76346c7f4430b9653c0e5e082192cd358c12a058 Mon Sep 17 00:00:00 2001 From: Ingrid Wang Date: Thu, 19 Mar 2026 13:43:10 -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 --- 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 2d5ddaf76185..b23f8ce56c90 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 b36c819cca85..cc45dfc44a80 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 @@ static int32_t getUniqueId() 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) {