From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22788 invoked by alias); 10 Feb 2002 01:39:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22682 invoked from network); 10 Feb 2002 01:39:01 -0000 Received: from unknown (HELO boden.synopsys.com) (204.176.20.19) by sources.redhat.com with SMTP; 10 Feb 2002 01:39:01 -0000 Received: from maiden.synopsys.com (maiden.synopsys.com [146.225.100.170]) by boden.synopsys.com (Postfix) with ESMTP id 2DB8BDBB1; Sat, 9 Feb 2002 17:39:01 -0800 (PST) Received: from atrus.synopsys.com (localhost [127.0.0.1]) by maiden.synopsys.com (8.9.1/8.9.1) with ESMTP id RAA05930; Sat, 9 Feb 2002 17:39:00 -0800 (PST) From: Joe Buck Received: (from jbuck@localhost) by atrus.synopsys.com (8.9.3+Sun/8.9.1) id RAA25290; Sat, 9 Feb 2002 17:38:59 -0800 (PST) Message-Id: <200202100138.RAA25290@atrus.synopsys.com> Subject: Re: [PATCH] Fix PR gdb/290 To: schwab@suse.de (Andreas Schwab) Date: Sat, 09 Feb 2002 17:39:00 -0000 Cc: jbuck@synopsys.COM (Joe Buck), ac131313@cygnus.com (Andrew Cagney), kettenis@chello.nl, gcc@gcc.gnu.org, gdb-patches@sources.redhat.com In-Reply-To: from "Andreas Schwab" at Feb 09, 2002 09:18:39 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg00290.txt.bz2 > Joe Buck writes: > > |> For C89, I don't think it's legal though it may be reasonable to accept > |> as an extension; I don't know about C99. > > The C99 standard is quite clear about this: > > 6.8.6.4[#1] A return statement with an expression shall not appear in > a function whose return type is void. A return statement without an > expression shall only appear in a function whose return type is void. OK, then this can only be done in C++. Any C code should avoid it. for void foo(); void bar() { return foo();} (which is legal C++) I've just checked, and gcc 2.95.2 and 3.0.3 reject this type of C code iff -ansi -pedantic is specified. By default they accept it. Anyone developing code that must compile with many compilers probably should be using -pedantic.