This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: Patch for extern inline in mainline
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 ?
> @@ -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.
Other than that it looks good to me.
Jakub