Commit edd28054 by Marek Polacek Committed by Marek Polacek

re PR c/54113 (-Wmissing-prototypes produces false alarms for C99 inline functions)

	PR c/54113
c/
	* c-decl.c (start_function): Don't warn for missing prototype for
	inline functions.
testsuite/
	* gcc.dg/pr54113.c: New test.

From-SVN: r205680
parent 5f673c6a
2013-12-04 Marek Polacek <polacek@redhat.com>
PR c/54113
* c-decl.c (start_function): Don't warn for missing prototype for
inline functions.
2013-12-03 Marek Polacek <polacek@redhat.com> 2013-12-03 Marek Polacek <polacek@redhat.com>
PR c/59351 PR c/59351
......
...@@ -7974,7 +7974,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, ...@@ -7974,7 +7974,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
&& old_decl != error_mark_node && old_decl != error_mark_node
&& TREE_PUBLIC (decl1) && TREE_PUBLIC (decl1)
&& !MAIN_NAME_P (DECL_NAME (decl1)) && !MAIN_NAME_P (DECL_NAME (decl1))
&& C_DECL_ISNT_PROTOTYPE (old_decl)) && C_DECL_ISNT_PROTOTYPE (old_decl)
&& !DECL_DECLARED_INLINE_P (decl1))
warning_at (loc, OPT_Wmissing_prototypes, warning_at (loc, OPT_Wmissing_prototypes,
"no previous prototype for %qD", decl1); "no previous prototype for %qD", decl1);
/* Optionally warn of any def with no previous prototype /* Optionally warn of any def with no previous prototype
......
2013-12-04 Marek Polacek <polacek@redhat.com>
PR c/54113
* gcc.dg/pr54113.c: New test.
2013-12-04 Jakub Jelinek <jakub@redhat.com> 2013-12-04 Jakub Jelinek <jakub@redhat.com>
PR c++/59268 PR c++/59268
......
/* { dg-do compile } */
/* { dg-options "-Wmissing-prototypes" } */
inline int foo (void) { return 42; } /* { dg-bogus "no previous prototype" } */
extern int foo(void);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment