diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-01-30 21:46:32 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-01-30 21:46:32 +0100 |
commit | d0728ae0d8311979f9e73498d2701bce8216adf1 (patch) | |
tree | 42cc4f5ad3330d2d1107acf8e0d1f7d1e28f942c /gcc/c-decl.c | |
parent | ac9bc18b3732f27fafb2a318e6a0ad8439551d5e (diff) | |
download | gcc-d0728ae0d8311979f9e73498d2701bce8216adf1.zip gcc-d0728ae0d8311979f9e73498d2701bce8216adf1.tar.gz gcc-d0728ae0d8311979f9e73498d2701bce8216adf1.tar.bz2 |
re PR target/39013 (Missing @PLT when -fpie is used)
PR target/39013
* c-decl.c (pop_scope): Set DECL_EXTERNAL for functions declared
inline but never defined.
* gcc.target/i386/pr39013-1.c: New test.
* gcc.target/i386/pr39013-2.c: New test.
From-SVN: r143803
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6ebee1a..9f65af4 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -781,14 +781,18 @@ pop_scope (void) error ("nested function %q+D declared but never defined", p); undef_nested_function = true; } - /* C99 6.7.4p6: "a function with external linkage... declared - with an inline function specifier ... shall also be defined in the - same translation unit." */ else if (DECL_DECLARED_INLINE_P (p) && TREE_PUBLIC (p) - && !DECL_INITIAL (p) - && !flag_gnu89_inline) - pedwarn (input_location, 0, "inline function %q+D declared but never defined", p); + && !DECL_INITIAL (p)) + { + /* C99 6.7.4p6: "a function with external linkage... declared + with an inline function specifier ... shall also be defined + in the same translation unit." */ + if (!flag_gnu89_inline) + pedwarn (input_location, 0, + "inline function %q+D declared but never defined", p); + DECL_EXTERNAL (p) = 1; + } goto common_symbol; |