From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3737 invoked by alias); 30 Apr 2010 11:26:55 -0000 Received: (qmail 3670 invoked by uid 48); 30 Apr 2010 11:26:41 -0000 Date: Fri, 30 Apr 2010 11:26:00 -0000 Message-ID: <20100430112641.3669.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/43943] "warning: no return statement in function returning non-void" should be an error In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "redi 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-04/txt/msg03339.txt.bz2 ------- Comment #5 from redi at gcc dot gnu dot org 2010-04-30 11:26 ------- The point being that it's undefined behaviour to /return/ from such a function, not to /write/ such a function. If the programmer guarantees the "missing return" will never happen then there's no error. I was wrong to say it's OK as long as the caller doesn't use the return value - but it is OK as long as control never reaches the "missing return" -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43943