From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27029 invoked by alias); 9 Jun 2008 00:44:25 -0000 Received: (qmail 27019 invoked by uid 22791); 9 Jun 2008 00:44:24 -0000 X-Spam-Check-By: sourceware.org Received: from ns1.signalpunk.com (HELO ns1.signalpunk.com) (74.86.59.106) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 09 Jun 2008 00:43:55 +0000 Received: from localhost (localhost [127.0.0.1]) by ns1.signalpunk.com (Postfix) with ESMTP id 36E1058172C1A; Mon, 9 Jun 2008 00:43:53 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=localhost) by ns1.signalpunk.com; 9 Jun 2008 00:43:53 +0000 Date: Mon, 09 Jun 2008 00:44:00 -0000 From: Christopher Layne To: Axel Freyn Cc: gcc-help@gcc.gnu.org Subject: Re: G++/GCC not detetcing stupid errors in code. Message-ID: <20080609004353.GN18743@ns1.signalpunk.com> References: <48352be5.0c58560a.66c6.16bf@mx.google.com> <4835353E.4000800@cs.uni-frankfurt.de> <-457754682823264016@unknownmsgid> <8bc817ee0805220400y390d8138s91447dbeeaaf847d@mail.gmail.com> <48355ef3.1358560a.6a9d.0fc9@mx.google.com> <20080522122005.GA12930@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080522122005.GA12930@localhost.localdomain> User-Agent: Mutt/1.5.16 (2007-06-09) X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg00091.txt.bz2 On Thu, May 22, 2008 at 02:22:49PM +0200, Axel Freyn wrote: > I would expect that this warning does not exist, because omitting the return-statement in > "main" is perfectly valid in C++: (C++-Standard, 3.6.1.3) > "If control reaches the end of main without encountering a return statement, the > effect is that of executing return 0;" > > For other functions, g++ also emits a warning if you forget the return > statement. > > Axel This is something, that while valid by the C++ "Standard", I surely hope doesn't become common practice. -cl