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

Is -fno-strict-aliasing really necessary? #143

Open
Kojoley opened this issue Mar 7, 2021 · 3 comments
Open

Is -fno-strict-aliasing really necessary? #143

Kojoley opened this issue Mar 7, 2021 · 3 comments

Comments

@Kojoley
Copy link

Kojoley commented Mar 7, 2021

The library builds with -fno-strict-aliasing on GCC:

<toolset>gcc:<cxxflags>-fno-strict-aliasing # avoids strict aliasing violations in other Boost components

The comment says that it is because of other Boost libraries but does not name them or link bug reports, making it hard to justify the flag. It should be a good thing to re-raise the issue on the libraries that still had not fixed it, as strict aliasing is a severe violation.

@Lastique
Copy link
Member

Lastique commented Mar 7, 2021

At this point I can't remember where these violations were, I just remember compilers throwing warnings about strict aliasing violations in code other than Boost.Log. Maybe these were fixed by now.

@ClaymorePT
Copy link

I'm also seeing this

[build] /home/claymore/.conan/data/boost/1.79.0/_/_/package/1671931156455a119d7c3f14d951ac5fdbc5cd10/include/boost/mpl/aux_/integral_wrapper.hpp:73:88: error: the result of the conversion is unspecified because ‘(0 - 1)’ is outside the range of type ‘boost::log::v2s_mt_posix::lock_access_mode’ [-Werror=conversion]
[build]    73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
[build]       |                                                                                 ~~~~~~~^~~~
[build] /home/claymore/.conan/data/boost/1.79.0/_/_/package/1671931156455a119d7c3f14d951ac5fdbc5cd10/include/boost/mpl/integral_c.hpp:31:54: note: in definition of macro ‘AUX_WRAPPER_INST’
[build]    31 | #define AUX_WRAPPER_INST(value) AUX_WRAPPER_NAME< T, value >
[build]       |                                                      ^~~~~
[build] /home/claymore/.conan/data/boost/1.79.0/_/_/package/1671931156455a119d7c3f14d951ac5fdbc5cd10/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: note: in expansion of macro ‘BOOST_MPL_AUX_STATIC_CAST’
[build]    73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
[build]       |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
[build] compilation terminated due to -Wfatal-errors.

@Lastique
Copy link
Member

Lastique commented Jun 5, 2022

@ClaymorePT This is off-topic here, but should be resolved with 77f1e20.

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

3 participants