From 944fa4d6357daf4248448a3446e21ac8bc3308f1 Mon Sep 17 00:00:00 2001 From: James Ide Date: Thu, 24 Sep 2015 02:47:43 -0700 Subject: [PATCH] Suppress warning when checking for `JSGlobalContextSetName` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This API is defined only on iOS 8 and newer. There is a warning that the function is defined when checking if it exists since it is always defined in the iOS 8 SDK but not necessarily on iOS 7 phones. Use pragmas to silence the warning. Closes https://github.com/facebook/react-native/pull/2475 Reviewed By: @​trunkagent, @vjeux Differential Revision: D2443432 Pulled By: @tadeuzagallo --- React/Executors/RCTContextExecutor.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/React/Executors/RCTContextExecutor.m b/React/Executors/RCTContextExecutor.m index c3654d198..971d10111 100644 --- a/React/Executors/RCTContextExecutor.m +++ b/React/Executors/RCTContextExecutor.m @@ -587,7 +587,10 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) RCT_EXPORT_METHOD(setContextName:(nonnull NSString *)name) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-pointer-compare" if (JSGlobalContextSetName != NULL) { +#pragma clang diagnostic pop JSStringRef JSName = JSStringCreateWithCFString((__bridge CFStringRef)name); JSGlobalContextSetName(_context.ctx, JSName); JSStringRelease(JSName);