Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 254355 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/c-decl.c.jj (-6 / +11 lines)
Lines 781-794 pop_scope (void) Link Here
781
	      error ("nested function %q+D declared but never defined", p);
781
	      error ("nested function %q+D declared but never defined", p);
782
	      undef_nested_function = true;
782
	      undef_nested_function = true;
783
	    }
783
	    }
784
	  /* C99 6.7.4p6: "a function with external linkage... declared
785
	     with an inline function specifier ... shall also be defined in the
786
	     same translation unit."  */
787
	  else if (DECL_DECLARED_INLINE_P (p)
784
	  else if (DECL_DECLARED_INLINE_P (p)
788
		   && TREE_PUBLIC (p)
785
		   && TREE_PUBLIC (p)
789
		   && !DECL_INITIAL (p)
786
		   && !DECL_INITIAL (p))
790
		   && !flag_gnu89_inline)
787
	    {
791
	    pedwarn ("inline function %q+D declared but never defined", p);
788
	      /* C99 6.7.4p6: "a function with external linkage... declared
789
		 with an inline function specifier ... shall also be defined
790
		 in the same translation unit."  */
791
	      if (!flag_gnu89_inline)
792
		pedwarn (input_location, 0,
793
			 "inline function %q+D declared but never defined", p);
794
	      if (!DECL_EXTERNAL (p))
795
		DECL_EXTERNAL (p) = 1;
796
	    }
792
797
793
	  goto common_symbol;
798
	  goto common_symbol;
794
799
(-)gcc/testsuite/gcc.target/i386/pr39013-1.c.jj (+15 lines)
Line 0 Link Here
1
/* PR target/39013 */
2
/* { dg-do compile { target *-*-linux* } } */
3
/* { dg-options "-O2 -fpie -std=gnu89" } */
4
5
inline int foo (void);
6
extern inline int bar (void);
7
8
int
9
main (void)
10
{
11
  return foo () + bar ();
12
}
13
14
/* { dg-final { scan-assembler "foo@PLT" } } */
15
/* { dg-final { scan-assembler "bar@PLT" } } */
(-)gcc/testsuite/gcc.target/i386/pr39013-2.c.jj (+15 lines)
Line 0 Link Here
1
/* PR target/39013 */
2
/* { dg-do compile { target *-*-linux* } } */
3
/* { dg-options "-O2 -fpie -std=gnu99" } */
4
5
inline int foo (void);		/* { dg-warning "declared but never defined" } */
6
extern inline int bar (void);	/* { dg-warning "declared but never defined" } */
7
8
int
9
main (void)
10
{
11
  return foo () + bar ();
12
}
13
14
/* { dg-final { scan-assembler "foo@PLT" } } */
15
/* { dg-final { scan-assembler "bar@PLT" } } */

Return to bug 254355