-
Notifications
You must be signed in to change notification settings - Fork 108
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
ODR violation when compiling with LTO/C++17 #465
Comments
@musicinmybrain I think this is happening because the sample does not use That is, with So the solution is simple: not to use |
In other words, this does not seem to be an issue. |
I definitely agree with your assessment of the reason for this, and that the experiments in #464 showed that it’s unrelated to any test failures. We do have some mixing of C++ versions in Fedora:
In almost all cases, we are able to link together shared libraries built with different C++ standards without problems. This isn’t necessarily true across all C++ compilers, but it’s true when everything is built with GCC, because GCC specifically tries to guarantee that. There are a few cases where a design decision can subvert this – like this case, where the preprocessor is used to give a type has a different layout depending on the standard version. Even there, we don’t encounter trouble in practice because So the use of shared libraries protects us from any ODR issues in practice; they appeared in #464 because I was working in a git checkout and linking statically. I agree that “just don’t do that” is a reasonable thing to say about that. I could preemptively start build |
Well, the recommendation is of course that if c4core is linked to ryml, then both should use the same standard. In this case, I would recommend bringing up Fedora's c4core to c++14 (although I don't know if that's up to you). But anyway, this is a user problem. So I'll close this issue for now. |
It is, and since we generally defer to upstream defaults when choosing a C++ standard, I’ll cite this comment when I do it. |
I haven’t had a chance to try to minimize the compiler flags yet, but that looked interesting enough to go ahead and report it!
Originally posted by @musicinmybrain in #464 (comment)
The text was updated successfully, but these errors were encountered: