This is the mail archive of the gcc-patches@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: [PATCH] PR c/13134


On Thu, 4 Dec 2003 17:17:48 -0800, Richard Henderson <rth@redhat.com> wrote:

> On Thu, Dec 04, 2003 at 01:57:15PM -0800, Matt Austern wrote:
>> +       /* If either declaration has a nondefault visibility, use it.
>> +          (Should we give an error if we have two different nondefault
>> +          visibilities?) */
>
> We should do something, yes.

I think an error would be appropriate.

This reminds me of the bit from the shared library discussion in Kona where
Lawrence touched on the Sun implementation of Windows-like symbol binding,
whereby symbols are normally hidden, dllexport makes them protected, and
dllimport makes them global (i.e. gives them default visibility).

I don't think that such a scheme would require two different nondefault
visibilities in the same TU; at most you would have a dllimport (default)
decl and a dllexport (protected) decl.

>> + __attribute__((visibility ("hidden")))
>> + void foo() { }
> ...
>> + __attribute__((visibility ("hidden")))
>> + int xyzzy = 5;
>
> Misplaced attributes.  They should go immediately before the name.

Attributes can now also appear as declspecs.

Jason


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