This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Avoid control reaches end warning when the frontend already issued warning about returning no value (PR c/23075)
- From: Richard Henderson <rth at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 6 Sep 2005 10:38:14 -0700
- Subject: Re: [PATCH] Avoid control reaches end warning when the frontend already issued warning about returning no value (PR c/23075)
- References: <20050905095632.GZ7403@devserv.devel.redhat.com>
On Mon, Sep 05, 2005 at 05:56:33AM -0400, Jakub Jelinek wrote:
> * c-typeck.c (c_finish_return): Set TREE_NO_WARNING on RETURN_EXPR
> if "return with no value, in function returning non-void" warning
> has been issued.
> * tree-cfg.c (execute_warn_function_return): Don't look at
> RETURN_EXPRs with TREE_NO_WARNING set.
> * typeck.c (check_return_expr): Add no_warning argument. Set
> *no_warning to true if "return-statement with no value, in function
> returning" warning has been issued.
> * cp-tree.h (check_return_expr): Adjust prototype.
> * semantics.c (finish_return_stmt): Set TREE_NO_WARNING if
> check_return_expr set *no_warning to true.
> * gcc.dg/pr23075.c: New test.
> * g++.dg/warn/pr23075.C: New test.
Ok.
r~