[PATCH] Fix PR c/6343 (was: Re: GCC 3.1 Prerelease)
Jason Merrill
jason@redhat.com
Sun Apr 28 14:57:00 GMT 2002
>>>>> "Franz" == Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
> + if (SUPPORTS_WEAK
> + && DECL_EXTERNAL (newdecl) && DECL_EXTERNAL (olddecl)
> + && (TREE_CODE (decl) != VAR_DECL
> + || ! TREE_STATIC (decl))
> + && TREE_USED (decl)
> + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
> + warning_with_decl (decl, "weak declaration of `%s' after first use may result in unspecified behaviour");
I intended that TREE_SYMBOL_REFERENCED should be used rather than
TREE_USED, not in addition. I'd probably check DECL_ASSEMBLER_NAME_SET_P
here, too; if the name hasn't been generated, it hasn't been referenced.
Perhaps we want a new macro, say
#define DECL_SYMBOL_REFERENCED(DECL) \
(DECL_ASSEMBLER_NAME_SET_P (DECL) \
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)))
Thanks,
Jason
More information about the Gcc-patches
mailing list