This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] attribute copy, leaf, weakref and -Wmisisng-attributes (PR 88546)


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
joseph@codesourcery.com


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