This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: binds_local question
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mike Stump <mrs at apple dot com>
- Cc: "gcc at gcc dot gnu dot org List" <gcc at gcc dot gnu dot org>
- Date: Mon, 30 Aug 2004 20:33:13 -0400
- Subject: Re: binds_local question
- References: <8296A215-FAE2-11D8-8516-000393941EE6@apple.com>
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