diff options
author | Jan Hubicka <jh@suse.cz> | 2005-05-13 16:00:55 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-05-13 14:00:55 +0000 |
commit | 9da588842969af9a82a8bde6347078d03974ccb9 (patch) | |
tree | 9ada393a1c3728eecc09d94cd9e363a5a168845c /gcc | |
parent | 81cfbbc23c53d29b16cae24c98eb0a7d15e2c3fc (diff) | |
download | gcc-9da588842969af9a82a8bde6347078d03974ccb9.zip gcc-9da588842969af9a82a8bde6347078d03974ccb9.tar.gz gcc-9da588842969af9a82a8bde6347078d03974ccb9.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-decl.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 61d9861..03261dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6c9ab45..e189d36 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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. */ |