You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The include guards created by protobuf are of the form "PROTOBUF__2eproto__INCLUDED". However, identifiers with two consecutive underscores are reserved in C++ according to [lex.name]/3.1.
This is annoying as I'm using Clang with all warnings enabled (-Weverything) and warnings treated as errors (-Werror). It is not much of a problem to add -Wno-reserved-id-macro to the compiler flags for the protobuf generated .cc files. For my own code, however, I don't want to generically disable that warning for every file that includes protobuf headers and instead disable that warning only for the protobuf header so that I get the warning if I myself use a reserved identifier in my own code. So there are two options: Wrapping every include of a protobuf header in
The include guards created by protobuf are of the form "PROTOBUF__2eproto__INCLUDED". However, identifiers with two consecutive underscores are reserved in C++ according to [lex.name]/3.1.
This is annoying as I'm using Clang with all warnings enabled (-Weverything) and warnings treated as errors (-Werror). It is not much of a problem to add
-Wno-reserved-id-macro
to the compiler flags for the protobuf generated .cc files. For my own code, however, I don't want to generically disable that warning for every file that includes protobuf headers and instead disable that warning only for the protobuf header so that I get the warning if I myself use a reserved identifier in my own code. So there are two options: Wrapping every include of a protobuf header inor create my own header that is included instead of the protobuf generated header whose content is nothing but the pattern above.
Both these options aren't optimal and I'd prefer if the naming scheme for include guards is changed.
The text was updated successfully, but these errors were encountered: