From 9f6a6f3f1a1ab44834ef5d4c3e4601e07c6287ed Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 27 Nov 2017 16:28:44 -0800 Subject: Fix compiler error on need_to_unref_constructed `need_to_unref_constructed` is not initialized, making Xcode compiler [complain on Sierra](https://sponge-qa.corp.google.com/invocation?tab=Kokoro&id=0ff33b71-2f61-4ad6-837e-5e43043c282a&searchFor=): ``` /Volumes/BuildData/tmpfs/src/github/grpc/workspace_objc_macos_dbg_native/src/core/ext/filters/client_channel/subchannel_index.cc:206:7: error: variable 'need_to_unref_constructed' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] ``` --- src/core/ext/filters/client_channel/subchannel_index.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/filters/client_channel/subchannel_index.cc b/src/core/ext/filters/client_channel/subchannel_index.cc index ae39ca394e..1624643d0b 100644 --- a/src/core/ext/filters/client_channel/subchannel_index.cc +++ b/src/core/ext/filters/client_channel/subchannel_index.cc @@ -163,7 +163,7 @@ grpc_subchannel* grpc_subchannel_index_register(grpc_exec_ctx* exec_ctx, grpc_subchannel_key* key, grpc_subchannel* constructed) { grpc_subchannel* c = nullptr; - bool need_to_unref_constructed; + bool need_to_unref_constructed = false; while (c == nullptr) { need_to_unref_constructed = false; -- cgit v1.2.3