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

[C++] protobuf 3.7 defines EXPECT_OK that clashes with Arrow's macro #21279

Closed
asfimport opened this issue Mar 4, 2019 · 3 comments
Closed
Assignees
Milestone

Comments

@asfimport
Copy link

This fails for me with the following error:

/home/travis/build/xhochy/arrow/cpp/src/arrow/flight/test-util.cc
In file included from /home/travis/build/xhochy/arrow/cpp-toolchain/include/google/protobuf/util/type_resolver.h:39:0,
                 from /home/travis/build/xhochy/arrow/cpp-toolchain/include/google/protobuf/util/json_util.h:37,
                 from /home/travis/build/xhochy/arrow/cpp-toolchain/include/grpcpp/impl/codegen/config_protobuf.h:70,
                 from /home/travis/build/xhochy/arrow/cpp/src/arrow/flight/customize_protobuf.h:23,
                 from /home/travis/build/xhochy/arrow/cpp/src/arrow/flight/protocol-internal.h:20,
                 from /home/travis/build/xhochy/arrow/cpp/src/arrow/flight/internal.h:23,
                 from /home/travis/build/xhochy/arrow/cpp/src/arrow/flight/test-util.cc:35:
/home/travis/build/xhochy/arrow/cpp-toolchain/include/google/protobuf/stubs/status.h:111:0: error: "EXPECT_OK" redefined [-Werror]
 #define EXPECT_OK(value) EXPECT_TRUE((value).ok())
 
In file included from /home/travis/build/xhochy/arrow/cpp/src/arrow/ipc/test-common.h:35:0,
                 from /home/travis/build/xhochy/arrow/cpp/src/arrow/flight/test-util.cc:30:
/home/travis/build/xhochy/arrow/cpp/src/arrow/testing/gtest_util.h:80:0: note: this is the location of the previous definition
 #define EXPECT_OK(expr)         \
 
cc1plus: all warnings being treated as errors

I would workaround this by renaming our EXPECT_OK to ARROW_EXPECT_OK.

Reporter: Uwe Korn / @xhochy
Assignee: Uwe Korn / @xhochy

Note: This issue was originally created as ARROW-4760. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Is there an upstream bug report? They shouldn't be exporting a macro named like that

@asfimport
Copy link
Author

Uwe Korn / @xhochy:
This has been there for over 4 years now. This error simply popped up as I didn't include protobuf headers using include(SYSTEM …). Using SYSTEM will let the compiler ignore all warnings in third-party headers. We have been using this for now and I'll also switched to using this now in my CMake refactor as there is an awful lot of warnings in the thirdparty headers.

@asfimport
Copy link
Author

Uwe Korn / @xhochy:
Resolved by PR #3688

@asfimport asfimport added this to the 0.13.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants