From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14706 invoked by alias); 9 Jan 2010 19:10:55 -0000 Received: (qmail 14612 invoked by uid 48); 9 Jan 2010 19:10:40 -0000 Date: Sat, 09 Jan 2010 19:10:00 -0000 Subject: [Bug middle-end/42674] New: Bogus "no return statement in function returning non-void" warning X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "davek 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: 2010-01/txt/msg01073.txt.bz2 Simple testcase not even worth attaching preprocessed source for, using HEAD@155680. Note that this only arises in C++, not when compiled as C: ------------------------------------------------------------------------ $ cat badwarn.cpp extern void bar (void); int foo (void) __attribute__ ((__noreturn__)); int foo (void) { while (1) { bar (); } } $ g++-4 -c badwarn.cpp -Wall badwarn.cpp: In function 'int foo()': badwarn.cpp:12:1: warning: no return statement in function returning non-void ------------------------------------------------------------------------ Discussed on the list at http://gcc.gnu.org/ml/gcc/2010-01/threads.html#00180; Ross Smith identified this as a regression as it does not arise with 4.0.1, 4.2.1 and 4.3.4, and HJ tracked it to r.138140: http://gcc.gnu.org/ml/gcc-cvs/2008-07/msg00852.html -- Summary: Bogus "no return statement in function returning non- void" warning Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: davek at gcc dot gnu dot org GCC build triplet: i686-pc-cygwin GCC host triplet: i686-pc-cygwin GCC target triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42674