• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "different visibility" warning?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "different visibility" warning?


  • Subject: Re: "different visibility" warning?
  • From: Chris Espinosa <email@hidden>
  • Date: Tue, 30 Oct 2007 15:14:30 -0700


On Oct 30, 2007, at 1:46 PM, Alexander von Below wrote:

Am 30.10.2007 um 21:13 schrieb Rich Siegel:


On 10/30/07 at 1:47 PM, email@hidden (Steve Mills) wrote:


What does the following warning mean? I have a few hundred of them

showing up in Xcode 3.0:


I ran into this during Leopard testing a while back, and received the following helpful response from an Xcode team member:


Me too.


Usually these are inconsistent use of various visibility controls.


I do not see any visibility controls. Maybe I am ingnorant, but I was not able to find anything about this in the gcc manuals. Could someone point me to "visibility for dummies", so I can see what exactly is causing this in my code?


http://developer.apple.com/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html

The visibility controls are threefold:

• Directives in source code.  These take the form of
  __attribute__((visibility("hidden"))) void MyFunction2() {}
 and designate that the following symbol is to be hidden from linkage with other compilation units at link time.

• Pragmas in source code.  These take the form of 

#pragma GCC visibility push(default)

void g() { }
void h() { }

#pragma GCC visibility pop

 and designate that all symbols declared in the #pragma section will have the designated visibility at link time.

In both above cases, "default" refers not to a particular visibility, but to the default visibility as passed on the command line by Xcode build settings.

• Command-line flags controlled by Xcode build settings

The gcc flag -fvisibility=hidden sets the default visibility of all symbols compiled in that pass.  It can be set per-file in the Compiler Flags, or set for an entire target or project with the Symbols Hidden by Default build setting.

• Ex-post-facto stripping

Even if you have declared a symbol to be visible with an __attribute__ or #pragma and are not hiding it by default with the build setting, a symbol may still be rendered unexported by stripping of the binary, either with use of an Exported Symbols File or Unexported Symbols File, or by use of Strip Linked Product and Strip Style.


Apart from the bug Rich mentioned, one way to get the above error is to have a symbol declared "default" visibility in a heaer file, then #include that header from two different source files, one built with -fvisibility=hidden and one not.  That gets conflicting definitions for the "default" visibility for that symbol.

Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: "different visibility" warning? (From: Rich Siegel <email@hidden>)
 >Re: "different visibility" warning? (From: Alexander von Below <email@hidden>)

  • Prev by Date: Xcode 3 Debugger Breakpoints
  • Next by Date: Re: Does Xcode 3 svn support existing sandboxes?
  • Previous by thread: Re: "different visibility" warning?
  • Next by thread: Re: "different visibility" warning?
  • Index(es):
    • Date
    • Thread