This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] GCC tree linkage types
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Matt Austern <austern at apple dot com>
- Cc: gcc at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>
- Date: 06 Nov 2003 14:10:01 -0800
- Subject: Re: [C++] GCC tree linkage types
- References: <Pine.LNX.4.44.0310271019520.5698-100000@nondot.org><2B2F383D-109A-11D8-BDB6-00039390D9E0@apple.com>
Matt Austern <austern@apple.com> writes:
> On Oct 27, 2003, at 8:24 AM, Chris Lattner wrote
>
> > Specifically, if I comment out the maybe_make_one_only call, the
> > function
> > ends up with strong external linkage, and solves my problem. The
> > question
> > is, however, what is the right solution to this? Why does Win32 want
> > explicit instantiations in linkonce sections? Can you have multiple
> > explicit instantiations of the same template in the same program?
> >
> > Perhaps DECL_COMDAT is the right answer to this?
>
> I've actually got a more general question. We've got DECL_WEAK,
> DECL_ONE_ONLY, and DECL_COMDAT. They're not quite the same,
> but they're very similar.
>
> So my question: since we've got three flags, in principle we've got
> 2^3 = eight possible combinations of flags. I bet most of those eight
> don't make any sense. Which combinations are errors, which are
> meaningful, and what are the distinctions between the meaningful
> combinations? Should the answer to that question be documented
> somewhere?
Please!
Also, we have TREE_PUBLIC and DECL_EXTERNAL, which can appear only in
some combinations with the previous three flags...
--
- Geoffrey Keating <geoffk@geoffk.org>