From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2805 invoked by alias); 22 Oct 2008 18:21:13 -0000 Received: (qmail 724 invoked by uid 48); 22 Oct 2008 18:19:53 -0000 Date: Wed, 22 Oct 2008 18:21:00 -0000 Message-ID: <20081022181953.723.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/36254] wrong "control reaches end of non-void function" warning In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg01474.txt.bz2 ------- Comment #7 from manu at gcc dot gnu dot org 2008-10-22 18:19 ------- The return is generated because we generate one (if there is none) everytime we reach the end of a function. This is used later to produce "control reaches end of non-void function". The compiler-generated try-catch forces the creation of this extra return. The problem is that we do not want to mark all generated return with no_warning, because we will miss valid warnings. Not sure yet how to detect which ones were generated because we naturally reach the end of a function or they are forced because of compiler-generated code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36254