-
Notifications
You must be signed in to change notification settings - Fork 163
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 violations in boost::filesystem::path #279
Comments
Duplicates #243. Yes, this is formally an ODR violation. In practice, though, it works due to forced inlining of these methods. This will get resolved when v3 is dropped. |
For the record, there is no inlining in a debug build. Also, I suspect LTO is interacting with inlining in unexpected ways, at least with msvc. I'm happy to resolve the issues I'm seeing on my end by moving to version 4. I just wanted to make sure the upstream maintainers were aware. |
Yes, debug build needs fixing. |
The previous strategy of force-inlining methods that are dependent on the library version is not effective with MSVC in debug mode, when linking the static library. The compiler does not inline methods despite the markup, and during linking the static library with the user's module the linker may or may not pick up user's definitions of these methods. When building the library, do not define path methods that depend on the library version. Instead, explicitly call v4 internal methods throughout the implementation. This way the compiled library does not contain v4 versions of these methods, and therefore does not conflict with user's definitions of these methods. Fixes #279.
The previous strategy of force-inlining methods that are dependent on the library version is not effective with MSVC in debug mode, when linking the static library. The compiler does not inline methods despite the markup, and during linking the static library with the user's module the linker may or may not pick up user's definitions of these methods. When building the library, do not define path methods that depend on the library version. Instead, explicitly call v4 internal methods throughout the implementation. This way the compiled library does not contain v4 versions of these methods, and therefore does not conflict with user's definitions of these methods. Fixes #279.
The previous strategy of force-inlining methods that are dependent on the library version is not effective with MSVC in debug mode, when linking the static library. The compiler does not inline methods despite the markup, and during linking the static library with the user's module the linker may or may not pick up user's definitions of these methods. When building the library, do not define path methods that depend on the library version. Instead, explicitly call v4 internal methods throughout the implementation. This way the compiled library does not contain v4 versions of these methods, and therefore does not conflict with user's definitions of these methods. Fixes #279.
The previous strategy of force-inlining methods that are dependent on the library version is not effective with MSVC in debug mode, when linking the static library. The compiler does not inline methods despite the markup, and during linking the static library with the user's module the linker may or may not pick up user's definitions of these methods. When building the library, do not define path methods that depend on the library version. Instead, explicitly call v4 internal methods throughout the implementation. This way the compiled library does not contain v4 versions of these methods, and therefore does not conflict with user's definitions of these methods. Fixes #279.
There are a number of inline member functions in
boost::filesystem::path
that have different implementations depending on the definition ofBOOST_FILESYSTEM_VERSION
. When compiling boost.filesystem,BOOST_FILESYSTEM_VERSION
is always set to 4. If a program uses boost.filesystem withBOOST_FILESYSTEM_VERSION
set to 3, which is the default, then I believe this is an ODR violation because the program now has multiple definitions of the same function that do not consist of the same sequence of tokens.The text was updated successfully, but these errors were encountered: