This is the mail archive of the gcc@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: binds_local question


On Mon, Aug 30, 2004 at 05:12:56PM -0700, Mike Stump wrote:
> In varasm.c we have:
> 
>   /* A variable is local if the user explicitly tells us so.  */
>   else if (DECL_VISIBILITY_SPECIFIED (exp) && DECL_VISIBILITY (exp) != 
> VISIBILITY_DEFAULT)
>     local_p = true;
>   /* Otherwise, variables defined outside this object may not be local. 
>  */
>   else if (DECL_EXTERNAL (exp))
>     local_p = false;
> 
> I was wondering if a variable that was marked with a visibility for 
> documentation purposes in a header file that was external, should be 
> considered local or not.  I'd expect that it would not be local, but 
> for that to be true, the two lines above would have to be swapped.
> 
> ?  Any downside to swapping them?
> 
> Construct found in some darwin header files.

A variable with specified visibility should be "local" whether or not
it's defined in this translation unit - that's most of the point.  We
know it will bind within this dynamic object.

-- 
Daniel Jacobowitz


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