Hi,
I have a question regarding the file generated by c++ Protobuf compiler i.e 
*.pb.h file

Previously I was using Protobuf 2.3.0 and my generated .pb.h used to look 
like this (I'm pasting the last few lines of the .pb.h file):

.
.
.
template <>
inline const EnumDescriptor* GetEnumDescriptor< rwmp::SLNetSpace>() {
  return rwmp::SLNetSpace_descriptor();
}

}  // namespace google
}  // namespace protobuf
#endif  // SWIG

#endif  // PROTOBUF_abcd_2eproto__INCLUDED


Now I have upgraded my Protobuf to 3.11.0 and newer generated .pb.h  looks 
like this (last few lines of the .pb.h file):

.
.
.
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::rwmp::SLNetSpace>() {
  return ::rwmp::SLNetSpace_descriptor();
}

PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)

#include <google/protobuf/port_undef.inc>
#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_abcd_2eproto

Now the problem is I want an empty line between *#include* and *#endif*
I don't want to do it manually and want to make changes in protobuf 
compiler code itself

The reason for this change is a compilation problem with GCC 8.2
Previously when I was using protobuf 2.3.0, my code used to compile without 
any warnings and now when using protobuf 3.11.0, I get following warnings
'*warning: file "xyz.h" linemarker ignored due to incorrect nesting'*
*xyz.h *is a file in which* abcd.pb.h *is included

I googled the above warning and found that there's a bug in GCC itself and 
is been solved but I don't want to update GCC to a newer version.
Here's a link discussing about the above bug: 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83173
Due to this warning, GCC is also generating incorrect line mappings in the 
debug symbols.

Can someone help me in how can I patch Protobuf compiler 3.11.0 so that 
extra line is added between *#include* and 
*#endif ?*
Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/389cb55d-489a-41e3-a769-d9e4fed446df%40googlegroups.com.

Reply via email to