This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] attribute copy, leaf, weakref and -Wmisisng-attributes (PR 88546)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Marek Polacek <polacek at redhat dot com>, Jason Merrill <jason at redhat dot com>, Richard Biener <rguenther at suse dot de>, <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 21 Dec 2018 19:10:54 +0000
- Subject: Re: [PATCH] attribute copy, leaf, weakref and -Wmisisng-attributes (PR 88546)
- References: <email@example.com> <20181221100509.GY23305@tucnak> <firstname.lastname@example.org>
On Fri, 21 Dec 2018, Martin Sebor wrote:
> That said, I'm also not sure the warning is necessarily the best way
> to deal with the attribute mismatches in these cases (declarations
> of aliases in .c files). Wouldn't it make more sense to copy
> the attributes from targets to their aliases unconditionally?
> Joseph, any thoughts based on your experience with the warning (and
> attribute copy) in Glibc?
My expectation is that the normal case is that the same attributes should
apply to all names for a function (except for the ones already excluded
from copying because they're properties of a symbol rather than of the
function that symbol points to), but there may be niche cases where you
deliberately want calls to different names for a function to be handled
differently based on different attributes (and so have deliberately
different declarations for both names in a header which is included in the
translation unit defining the function and alias, say).
Joseph S. Myers