aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-06-20 14:01:07 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-06-20 14:01:07 -0700
commit36a58a7928e6a10b44b6cffdc118337ef7e0b8c1 (patch)
tree607e11cd9b7da405489fb748365e334a11662a80
parentdbe2b9e976d50ce7971df32dc9a3122525dad3ce (diff)
Enable treating warnings as errors for target gRPC
-rw-r--r--src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h4
-rw-r--r--src/objective-c/ProtoRPC/ProtoMethod.h3
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.h3
-rw-r--r--src/objective-c/ProtoRPC/ProtoService.h3
-rw-r--r--src/objective-c/ProtoRPC/ProtoService.m6
-rw-r--r--src/objective-c/tests/Podfile21
6 files changed, 32 insertions, 8 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h b/src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h
index 343dd48a14..ac2a37d75f 100644
--- a/src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h
+++ b/src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h
@@ -41,7 +41,7 @@
*/
+ (BOOL)setTLSPEMRootCerts:(nullable NSString *)pemRootCert
forHost:(nonnull NSString *)host
- error:(NSError **)errorPtr;
+ error:(NSError * _Nullable * _Nullable)errorPtr;
/**
* Configures @c host with TLS/SSL Client Credentials and optionally trusted root Certificate
* Authorities. If @c pemRootCerts is nil, the default CA Certificates bundled with gRPC will be
@@ -51,6 +51,6 @@
withPrivateKey:(nullable NSString *)pemPrivateKey
withCertChain:(nullable NSString *)pemCertChain
forHost:(nonnull NSString *)host
- error:(NSError **)errorPtr;
+ error:(NSError * _Nullable * _Nullable)errorPtr;
@end
diff --git a/src/objective-c/ProtoRPC/ProtoMethod.h b/src/objective-c/ProtoRPC/ProtoMethod.h
index f9fdbb35ff..ae3a2723fc 100644
--- a/src/objective-c/ProtoRPC/ProtoMethod.h
+++ b/src/objective-c/ProtoRPC/ProtoMethod.h
@@ -54,6 +54,9 @@ __attribute__((deprecated("Please use GRPCProtoMethod.")))
* This subclass is empty now. Eventually we'll remove ProtoMethod class
* to avoid potential naming conflict
*/
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@interface GRPCProtoMethod : ProtoMethod
+#pragma clang diagnostic pop
@end
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h
index 5f91f6bce1..04fc1e45f1 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.h
+++ b/src/objective-c/ProtoRPC/ProtoRPC.h
@@ -56,6 +56,9 @@ __attribute__((deprecated("Please use GRPCProtoCall.")))
* This subclass is empty now. Eventually we'll remove ProtoRPC class
* to avoid potential naming conflict
*/
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@interface GRPCProtoCall : ProtoRPC
+#pragma clang diagnostic pop
@end
diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h
index 87d06e1ae5..7faae1b49c 100644
--- a/src/objective-c/ProtoRPC/ProtoService.h
+++ b/src/objective-c/ProtoRPC/ProtoService.h
@@ -55,6 +55,9 @@ __attribute__((deprecated("Please use GRPCProtoService.")))
* This subclass is empty now. Eventually we'll remove ProtoService class
* to avoid potential naming conflict
*/
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@interface GRPCProtoService : ProtoService
+#pragma clang diagnostic pop
@end
diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m
index 597c3cf0fe..4a14570d81 100644
--- a/src/objective-c/ProtoRPC/ProtoService.m
+++ b/src/objective-c/ProtoRPC/ProtoService.m
@@ -65,14 +65,14 @@
return self;
}
-- (ProtoRPC *)RPCToMethod:(NSString *)method
+- (GRPCProtoCall *)RPCToMethod:(NSString *)method
requestsWriter:(GRXWriter *)requestsWriter
responseClass:(Class)responseClass
responsesWriteable:(id<GRXWriteable>)responsesWriteable {
- ProtoMethod *methodName = [[ProtoMethod alloc] initWithPackage:_packageName
+ GRPCProtoMethod *methodName = [[GRPCProtoMethod alloc] initWithPackage:_packageName
service:_serviceName
method:method];
- return [[ProtoRPC alloc] initWithHost:_host
+ return [[GRPCProtoCall alloc] initWithHost:_host
method:methodName
requestsWriter:requestsWriter
responseClass:responseClass
diff --git a/src/objective-c/tests/Podfile b/src/objective-c/tests/Podfile
index 508641d681..53edf8c890 100644
--- a/src/objective-c/tests/Podfile
+++ b/src/objective-c/tests/Podfile
@@ -1,9 +1,9 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
-pod 'Protobuf', :path => "../../../third_party/protobuf"
-pod 'BoringSSL', :podspec => ".."
-pod 'CronetFramework', :podspec => ".."
+pod 'Protobuf', :path => "../../../third_party/protobuf", :inhibit_warnings => true
+pod 'BoringSSL', :podspec => "..", :inhibit_warnings => true
+pod 'CronetFramework', :podspec => "..", :inhibit_warnings => true
pod 'gRPC', :path => "../../.."
pod 'RemoteTest', :path => "RemoteTestClient"
@@ -30,3 +30,18 @@ end
target 'InteropTestsLocalCleartext' do
end
+
+post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ target.build_configurations.each do |config|
+ config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES'
+ end
+ if target.name == 'gRPC'
+ target.build_configurations.each do |config|
+ # GPR_UNREACHABLE_CODE causes "Control may reach end of non-void
+ # function" warning
+ config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO'
+ end
+ end
+ end
+end