aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2016-02-10 23:50:08 -0800
committerGravatar yang-g <yangg@google.com>2016-02-10 23:50:08 -0800
commite39cb740ca96da2b984c390b52c1c56f440015c3 (patch)
treebb8ad2faadcf80073b57019bff7b290d221ebd25 /src/compiler
parent9c7961a01408d3228dec55a9f39a15129f57b3ed (diff)
Add a dummy reference to prevent unused variable warning if there is no rpc method defined.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/cpp_generator.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index d3d6224de2..97295bed45 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);