PATCH RFA: Patch for extern inline in mainline

Ian Lance Taylor iant@google.com
Fri Mar 2 02:06:00 GMT 2007


Jakub Jelinek <jakub@redhat.com> writes:

> On Thu, Mar 01, 2007 at 10:58:05AM -0800, Ian Lance Taylor wrote:
> > Fair enough.  How about this version?
> 
> > +This attribute should be used with a function with is also declared
>                                                ^ which ?

Thanks, fixed.


> > @@ -803,7 +797,7 @@ pop_scope (void)
> >           else if (DECL_DECLARED_INLINE_P (p)
> >                    && TREE_PUBLIC (p)
> >                    && !DECL_INITIAL (p)
> > -                  && flag_isoc99)
> > +                  && !flag_gnu89_inline)
> >             pedwarn ("inline function %q+D declared but never defined", p);
> > 
> >           goto common_symbol;
> 
> I'm not 100% sure about this change.  Declaring something inlining and
> not defining it doesn't sound like a useful extension, so if not pedwarn,
> we should at least just issue normal warning.
> 
> > @@ -1553,7 +1545,7 @@ diagnose_mismatched_decls (tree newdecl,
> >          we still shouldn't warn.)  */
> >        if (DECL_DECLARED_INLINE_P (newdecl) && !DECL_DECLARED_INLINE_P (olddecl)
> >           && same_translation_unit_p (olddecl, newdecl)
> > -         && ! flag_isoc99)
> > +         && flag_gnu89_inline)
> >         {
> >           if (TREE_USED (olddecl))
> >             {
> 
> Here I'd say we just should never warn with -std=gnu99 or -std=c99, no
> matter whether -fgnu89-inline or -fno-gnu89-inline is used.

I don't agree in either case.  I think -fgnu89-inline should cause the
compiler to handle inline functions just as it did for gnu89.  I think
we can reasonably discuss changing the behaviour in either or both
cases for gnu89 mode, and thus make gnu89 and c99 the same.  But
unless and until we do that (which should be discussed in a separate
patch), I think my proposed patch does the right thing.

Ian



More information about the Gcc-patches mailing list