-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
visibility warnings with ARM GCC 7.3 #1973
Comments
Forgot to mention that this problem is not new, it's not related to the latest {fmt} release, for instance simplified code example with {fmt} v5.0.0 also produce this warning: |
My dirty patch to work around it:
But can't say it's a proper solution. And I don't want to patch every {fmt} version we use this way. |
It just checks if "visibility" attribute available in GCC. I thought that even warning is not produced, there is no harm in explicitly making visibility "default" for this struct. But this assumption may be false. |
I don't think that's a good idea. It means that when people build shared libraries and link a static library version of fmt, this will become part of the public interface. If they are trying to carefully control the public symbols of their shared libraries by setting hidden on the compile line, this is a problem. I don't think the fmt library should enforce any specific visibility in the code. |
Closing as the fact that the warning is gone in newer gcc versions indicates that it's a compiler bug. That said a PR with a workaround would be welcome. The easiest workaround is to mark |
There is a weird warning related to the visibility of some classes of {fmt} on GCC 6.4 and 7.3 on ARM. These
-Wattributes
warnings produced with-fvisibility=hidden
only.For example, there is no warning for:
But if I want to use literals then there is a warning telling that visibility of
FMT_COMPILE_STRING
struct (defined inside theFMT_STRING
's lambda) is greater than the visibility of its basefmt::compile_string
struct:https://godbolt.org/z/vfGanM
Same warning, simplified code:
https://godbolt.org/z/Pr8xKz
ARM GCC 7.3 output:
And no warning without template in a simplified version:
https://godbolt.org/z/4TsdWx
Looks more like it is a GCC bug, also it's specific to the ARM version because x86-64 GCC 7.3 (and down to 5.3 at least) does not produce any warning. So the question is: should it be handled somehow in {fmt}?
The text was updated successfully, but these errors were encountered: