Skip to content

Commit

Permalink
Add a dummy reference to prevent unused variable warning if there is …
Browse files Browse the repository at this point in the history
…no rpc method defined.
  • Loading branch information
yang-g committed Feb 11, 2016
1 parent 9c7961a commit e39cb74
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/compiler/cpp_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e39cb74

Please sign in to comment.