On Wed, 31 Jan 2024, Jakub Jelinek wrote:

> On Wed, Jan 31, 2024 at 12:21:38PM -0800, Andi Kleen wrote:
> > > > +       case RID_RETURN:
> > > > +         {
> > > > +           bool musttail_p = false;
> > > > +           std_attrs = process_stmt_hotness_attribute (std_attrs, 
> > > > attrs_loc);
> > > > +           if (lookup_attribute ("", "musttail", std_attrs))
> > > > +             {
> > > > +               musttail_p = true;
> > > > +               std_attrs = remove_attribute ("", "musttail", 
> > > > std_attrs);
> > > > +             }
> 
> Using "" looks wrong to me, that is for standard attributes which
> are also gnu attributes, say [[noreturn]]/[[gnu::noreturn]].
> That is not the case here.  Even the __attribute__((musttail)) form will have
> gnu namespace.

And it's incorrect to use [[musttail]] (C23 syntax, no namespace) in any 
circumstances, at least for C, as it's not a standard attribute - so tests 
should verify that [[musttail]] is diagnosed as ignored even in contexts 
where [[gnu::musttail]] is valid.  (It can't be standardized as 
[[musttail]] because of the rule that standard attributes must be 
ignorable; the proposed syntax for a TS and possible future 
standardization after that is "return goto".)

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to