This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Kill duplicated warning
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Fri, 13 May 2005 02:30:30 +0200
- Subject: Kill duplicated warning
Hi,
moving noreturn checks before inliner causes noreturn7 to fail as we output
both warnings (see changelog). It probably makes more sense to supress the
other warning instead of adding the duplicated warning into testcase.
Bootstrapped/regtested i686-pc-gnu-linux, OK?
Honza
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.
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.654
diff -c -3 -p -r1.654 c-decl.c
*** c-decl.c 11 May 2005 07:33:30 -0000 1.654
--- c-decl.c 12 May 2005 23:56:48 -0000
*************** finish_function (void)
*** 6490,6496 ****
/* 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");
/* With just -Wextra, complain only if function returns both with
and without a value. */
--- 6490,6499 ----
/* 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");
! TREE_NO_WARNING (fndecl) = 1;
! }
/* With just -Wextra, complain only if function returns both with
and without a value. */