This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c/6343 (was: Re: GCC 3.1 Prerelease)
- From: Jason Merrill <jason at redhat dot com>
- To: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>,Alan Modra <amodra at bigpond dot net dot au>,Mark Mitchell <mark at codesourcery dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 25 Apr 2002 20:54:45 +0100
- Subject: Re: [PATCH] Fix PR c/6343 (was: Re: GCC 3.1 Prerelease)
- References: <5.1.1.2.2.20020423130143.04a21008@mail.lauterbach.com><200204242101.39393@enzo.bigblue.local><wvly9fcvpb9.fsf@prospero.cambridge.redhat.com><200204252121.58902@enzo.bigblue.local>
>>>>> "Franz" == Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
> On Wednesday 24 April 2002 22:01, Jason Merrill wrote:
>> The latter. We don't want to warn about the C++ frontend's internal
>> trickery with DECL_WEAK.
> What kind of trickery? Can I detect that in declare_weak?
In the C++ frontend, in general an entity with vague linkage (such as a
template instantion) has DECL_EXTERNAL set until EOF, at which point we
decide what to do with it. If we can't tell whether or not this is the One
True translation unit for the entity, we mark it weak/comdat and emit it as
needed.
>> I'd prefer to omit the warning entirely on the branch.
> Well, I prefer overzealous warnings over no warning at all in the same way I
> prefer ICEs over miscompiled code :-). Besides that extra warning, I'm really
> satisfied now with my patch otherwise and unless you think it's overly
> complicated to get rid of it, I would like to fix it even for the branch.
The warning should only apply to weak externs; the address of a weak
definition is never 0. That should fix the C++ case above.
Jason