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]

Re: .weak vs. C++ templates. was: SCO 5.0.2 error


Well, I have another example of a system that needs this, I put this
into my tree for this system (a new unreleased OS).  The case is
shared libraries that might have weak, and the inability to have the
real definition (say from an explicit instantiation request) override
the weak definition.

:-(

I say :-(, as I'm not sure I really like this, maybe those systems
should say they are odd via a new #define in the tm.h file?  I'm not
sure.  This system is not SVR4 derived.

I just though I would share the experience.

> From: Jason Merrill <jason@cygnus.com>
> Date: 22 Oct 1999 17:48:27 -0700

> Does this do the trick?

> !   /* We used to say that this was not necessary on targets that support weak
> !      symbols, because the implicit instantiations will defer to the explicit
> !      one.  However, that's not actually the case in SVR4; a strong definition
> !      after a weak one is an error.  Also, not making explicit
> !      instantiations one_only means that we can end up with two copies of
> !      some template instantiations. */
> !   if (! supports_one_only ())
>       return;


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