From: Marek Polacek Date: Tue, 25 Nov 2014 08:28:45 +0000 (+0000) Subject: re PR c/63877 (- -Wmissing-declarations produces false alarms for C99 inline functions) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b286be940a8231b35ed111f6044b2bf7da471d07;p=gcc.git re PR c/63877 (- -Wmissing-declarations produces false alarms for C99 inline functions) PR c/63877 * c-decl.c (start_function): Disable -Wmissing-declarations warning for inline functions. * gcc.dg/pr63877.c: New test. From-SVN: r218039 --- diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 79d41830ee1..e2a96309c7b 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2014-11-25 Marek Polacek + + PR c/63877 + * c-decl.c (start_function): Disable -Wmissing-declarations warning + for inline functions. + 2014-11-21 Jakub Jelinek PR target/63764 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 9288e2c1e8c..6413e6f8f35 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -8353,7 +8353,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, else if (warn_missing_declarations && TREE_PUBLIC (decl1) && old_decl == 0 - && !MAIN_NAME_P (DECL_NAME (decl1))) + && !MAIN_NAME_P (DECL_NAME (decl1)) + && !DECL_DECLARED_INLINE_P (decl1)) warning_at (loc, OPT_Wmissing_declarations, "no previous declaration for %qD", decl1); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 147674e67ee..4a8d7cd3cea 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-25 Marek Polacek + + PR c/63877 + * gcc.dg/pr63877.c: New test. + 2014-11-25 Markus Trippelsdorf PR ipa/64059 diff --git a/gcc/testsuite/gcc.dg/pr63877.c b/gcc/testsuite/gcc.dg/pr63877.c new file mode 100644 index 00000000000..5969b39d21c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr63877.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-Wmissing-declarations" } */ + +inline int foo (void) { return 42; } /* { dg-bogus "no previous declaration" } */ +extern int foo (void);