c-decl.c (finish_function): Suppress "control reaches end of non-void function" when...

* c-decl.c (finish_function): Suppress "control reaches end of
	non-void function" when "no return statement in function
	returning non-void" is issued.

From-SVN: r99659
This commit is contained in:
Jan Hubicka 2005-05-13 16:00:55 +02:00 committed by Jan Hubicka
parent 81cfbbc23c
commit 9da5888429
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2005-05-13 Jan Hubicka <jh@suse.cz>
* c-decl.c (finish_function): Suppress "control reaches end of
non-void function" when "no return statement in function
returning non-void" is issued.
* tree-inline.c (copy_body_r): Simplify substituted ADDR_EXPRs.
* tree-optimize.c (pass_gimple): Kill.
(init_tree_optimization_passes): Kill pass_gimple.

View File

@ -6490,7 +6490,10 @@ finish_function (void)
/* Normally, with -Wreturn-type, flow will complain. Unless we're an
inline function, as we might never be compiled separately. */
&& DECL_INLINE (fndecl))
warning (0, "no return statement in function returning non-void");
{
warning (0, "no return statement in function returning non-void");
TREE_NO_WARNING (fndecl) = 1;
}
/* With just -Wextra, complain only if function returns both with
and without a value. */