This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warning message with usage of visibility hidden with wrapper class


Hi everyone,

Attached is some example code that exhibits the issue. ?In terms of
GCC versions, I think we've seen it in everything from 4.1.2 on, but I
know for a fact that I see it in 4.4.x, and 4.5.1. ?I know that if I
add -fvisibility=hidden to compilation of anything linking to the
library resolves the warning, but as I said before, I'm trying to
understand why we're getting the warning with it as it is (in our
actual code, we can't set the default visibility to hidden on
libraries or executables linking to those libraries at the moment).

Thanks for the help,
--
Christopher Sigman



On Wed, May 23, 2012 at 10:02 PM, Christopher Sigman
<c.s.sigman@gmail.com> wrote:
>
> Hi all,
>
> My team at work and I have started to utilize the?visibility
> attributes in gcc so that we are building 'nix libraries whose public
> symbols are in-line with our Windows builds. With some of our code
> though, we're noticing warnings about parts being declared with
> greater visibility. ?As far as we've been able to determine, there's
> nothing being executed incorrectly, but we'd like to understand the
> warning before ignoring it.
>
> The code in question is basically set up like this:
>
> class?__attribute__ ((visibility ("hidden")))?SomeClass
> {
> ? ...
> }
>
> template <T>
> class WrappingSomeClass
> {
> ...
> ? void someFunc()
> ? {
> ? ? SomeClass var;
> ? ? ...
> ? }
> ...
> }
>
> Where the warning occurs on usage of SomeClass in WrappingSomeClass.
> Any code using this example links to the library with SomeClass in it.
> Any help you can give would be appreciated, and if my super
> simplification is overly so, let me know and I can give it in more
> detail.
>
> --
> CSS

Attachment: Visibility.tgz
Description: GNU Zip compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]