Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'GOOGLE_PREDICT_FALSE' macro redefined from google-glog #208

Closed
schroederc opened this issue Feb 12, 2015 · 1 comment
Closed

'GOOGLE_PREDICT_FALSE' macro redefined from google-glog #208

schroederc opened this issue Feb 12, 2015 · 1 comment

Comments

@schroederc
Copy link
Contributor

In the 3.0.0-alpha-1 include 'google/protobuf/stubs/common.h', the GOOGLE_PREDICT_FALSE macro is defined. Likewise, in 'glog/logging.h' from https://code.google.com/p/google-glog/, GOOGLE_PREDICT_FALSE is also defined, causing a compilation warning (and error with -Werror).

This currently affects the https://github.com/google/kythe repository when upgrading to 3.0.0-alpha-1. Full compilation error below:

In file included from kythe/cxx/common/index_pack.cc:28:
third_party/glog/include/glog/logging.h:132:9: error: 'GOOGLE_PREDICT_FALSE' macro redefined [-Werror]
#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0))
        ^
third_party/protobuf/include/google/protobuf/stubs/common.h:253:9: note: previous definition is here
#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(!!(x), 1))
        ^
1 error generated.
@schroederc
Copy link
Contributor Author

This is mostly an error on glog's part since they don't guard their definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant