From e39cb740ca96da2b984c390b52c1c56f440015c3 Mon Sep 17 00:00:00 2001 From: yang-g Date: Wed, 10 Feb 2016 23:50:08 -0800 Subject: [PATCH] Add a dummy reference to prevent unused variable warning if there is no rpc method defined. --- src/compiler/cpp_generator.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index d3d6224de29..97295bed451 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -1106,6 +1106,7 @@ void PrintSourceService(grpc::protobuf::io::Printer *printer, printer->Print(*vars, "$ns$$Service$::Service::Service() {\n"); printer->Indent(); + printer->Print(*vars, "(void)$prefix$$Service$_method_names;\n"); for (int i = 0; i < service->method_count(); ++i) { const grpc::protobuf::MethodDescriptor *method = service->method(i); (*vars)["Idx"] = as_string(i);