Example generated code:
void XyzMessage::RegisterArenaDtor(::google::protobuf::Arena* arena) {
}
Compiler warning/error:
XyzProtocol.pb.cc:3321:64: error: unused parameter ‘arena’ [-Werror=unused-parameter]
void XyzMessage::RegisterArenaDtor(::google::protobuf::Arena* arena) {
Unfortunately we typically don't make the generated methods free of unused-parameter warning. This would require additional logic in the protoc compiler to if the definition is empty etc. I'd suggest allow unused-parameter for pb.h and pb.cc compilation. We do make the unused-parameter free in our runtime though.
Treating warnings as errors is a very commonly used compiler tool. For something as widely used as Google protocol buffers, I don't think it is an unreasonable request to ask that the generated code be free of the most common warnings.
It seems the project has accepted fixes occasionally in the past (e.g. for #2032 and #2326, but not for #719 or #68). Would you not even accept a pull request for this bug?
How about wrapping your generated code in a #pragma GCC diagnostic ignored "-Wunused-parameter"?
Most helpful comment
Treating warnings as errors is a very commonly used compiler tool. For something as widely used as Google protocol buffers, I don't think it is an unreasonable request to ask that the generated code be free of the most common warnings.
It seems the project has accepted fixes occasionally in the past (e.g. for #2032 and #2326, but not for #719 or #68). Would you not even accept a pull request for this bug?