-
Notifications
You must be signed in to change notification settings - Fork 99
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
Warnings on GCC 10 + LTO #597
Comments
I've investigated the errors and as far as I can see, the static analyzer GCC uses when lto is enabled is kind of faulty. If the library is built in debug mode gcc do see stuff better and the warning doesn't appear. I recommend you to disable the warning (at least, when building Json). |
Is this an shipping release of GCC or is it a beta? |
@vinniefalco @grisumbras Like https://github.com/chriskohlhoff/asio/blob/master/asio/include/asio/detail/push_options.hpp and https://github.com/chriskohlhoff/asio/blob/master/asio/include/asio/detail/pop_options.hpp in ASIO? |
Do you think that's best? |
I'm not sure it's actually doable. The warning is emitted by the linker and it seems LTO "objects" don't store pragma information, so disabling this warning with a pragma doesn't do anything. The only way I've managed to disable the warning is to pass "-Wno-stringop-overflow" to the linker. I guess, we could add linking flags to tests via build scripts. |
@grisumbras, you're right, pragma doesn't work. Linker flag required. |
I'm inclined to do nothing here. |
Commit: 26cedfa
GCC:
gcc version 10.2.1 20200825 [revision c0746a1beb1ba073c7981eb09f55b3d993b32e5c] (SUSE Linux)
CMake command:
Warnings:
The text was updated successfully, but these errors were encountered: