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
When turning on extra warnings (-Wextra) and enabling warnings as errors (-Werror) protobuf3 map implementation hits a G++ (version 5.2.0, on Linux) error on the following line
include/google/protobuf/map.h|677 col 31| error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
|| value_type* const value() const { return v_; }
|| ^
|| cc1plus: all warnings being treated as errors
The problem with that line is that it's making the pointer itself const, not the value pointed to.
That's what G++ complains about.
Example to reproduce:
#include <include/protobuf/map.h>
int main () { return 0; }
And compile with
g++ -Wextra -Werror file.cpp
The fix should be to either remove that 'const' keyword, as it does nothing, or if const-ness of the pointed value is desired, change it to:
const value_type * value() const { return v_; }
The text was updated successfully, but these errors were encountered:
0
down vote
you can try this gcc command utility on github , it basically expand the debugg info for c++ debugging . Here is the link its a executable file called TESTZ.CPP
When turning on extra warnings (-Wextra) and enabling warnings as errors (-Werror) protobuf3 map implementation hits a G++ (version 5.2.0, on Linux) error on the following line
include/google/protobuf/map.h|677 col 31| error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
|| value_type* const value() const { return v_; }
|| ^
|| cc1plus: all warnings being treated as errors
The problem with that line is that it's making the pointer itself const, not the value pointed to.
That's what G++ complains about.
Example to reproduce:
#include <include/protobuf/map.h>
int main () { return 0; }
And compile with
g++ -Wextra -Werror file.cpp
The fix should be to either remove that 'const' keyword, as it does nothing, or if const-ness of the pointed value is desired, change it to:
const value_type * value() const { return v_; }
The text was updated successfully, but these errors were encountered: