-
Notifications
You must be signed in to change notification settings - Fork 402
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
cxx::Expects macro conflicts with Microsoft GSL Expects macro #2080
Comments
Just wanted to add another note here - there are other third party libraries as well that themselves depend on GSL so... 🙁 |
@gpalmer-latai this is one of our early sins when we did not prefix our macros. The long term plan is to move to the macros defined in |
So in other words you would be fine with changing all occurrences of I suppose it will look weird to see |
Sure. We need to prefix all macros with the Yes it will be just namespace foo {
void bar() {}
}
#define BAR() bar()
int main() {
foo::BAR();
} The macro itself is not namespaced but the namespace must be added in order to use it. It is against the autosar guidelines though ... for good reasons. |
Luckily it is a simple search and replace and therefore easy to fix |
…-and-ensures iox-#2080 Prefix 'Expects' and 'Ensures' with `IOX`
Thanks for taking care of this already! |
Required information
When compiling a C++ library that depends transitively both on iceoryx_hoofs/cxx/requires.hpp and
<gsl/gsl_assert>
, andiceoryx
libraries are included after gsl ones, the following error message will result:Operating system:
Ubuntu 20.04 LTS
Compiler version:
GCC 9.4.0
Eclipse iceoryx version:
Slightly out of date master (just a few commits)
Observed result or behaviour:
Code fails to compile because GSL calls the
Expects
macro expecting it to be the one that gsl defined, but it is not because that macro has been overwritten by the one in iceoryx.Expected result or behaviour:
Somehow, there is no conflict and code is able to depend both on gsl and iceoryx.
The only solution within this project I could think of is to name
Expects
to something less duplicatable in Iceoryx - likeIOX_EXPECTS
. Curious what folks' thoughts about this are.Obviously I'm aware that I have solutions in my use case to either not depend on gsl (because hoofs covers mostly the same use cases) or be careful about how/where I import things.
Conditions where it occurred / Performed steps:
The text was updated successfully, but these errors were encountered: