From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7318 invoked by alias); 9 Feb 2002 19:37:45 -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 7027 invoked from network); 9 Feb 2002 19:37:37 -0000 Received: from unknown (HELO kiruna.synopsys.com) (204.176.20.18) by sources.redhat.com with SMTP; 9 Feb 2002 19:37:37 -0000 Received: from maiden.synopsys.com (maiden.synopsys.com [146.225.100.170]) by kiruna.synopsys.com (Postfix) with ESMTP id 2A54CF485; Sat, 9 Feb 2002 11:36:55 -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 LAA08498; Sat, 9 Feb 2002 11:36:54 -0800 (PST) From: Joe Buck Received: (from jbuck@localhost) by atrus.synopsys.com (8.9.3+Sun/8.9.1) id LAA24545; Sat, 9 Feb 2002 11:36:53 -0800 (PST) Message-Id: <200202091936.LAA24545@atrus.synopsys.com> Subject: Re: [PATCH] Fix PR gdb/290 To: ac131313@cygnus.com (Andrew Cagney) Date: Sat, 09 Feb 2002 11:37:00 -0000 Cc: kettenis@chello.nl, gcc@gcc.gnu.org, gdb-patches@sources.redhat.com In-Reply-To: <3C657641.1080906@cygnus.com> from "Andrew Cagney" at Feb 09, 2002 02:19:29 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/msg00281.txt.bz2 Andrew writes: > static void f3 (void) { return; } > ... > so ok so far. Hmm, I think this tells the story: > > static void f5 (int a) { return f3(); } > > Returning the result from a function that returns void (f3()) doesn't > attract a warning. > Bug or feature? For C++, it is a non-optional feature; the standard requires this to work correctly (a void function may say "return foop();" if foop's return type is void). The reason for this will become clear after you write templates for a while; without it "void" becomes more of an oddball case. 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.