From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7352 invoked by alias); 9 Feb 2002 19:19:34 -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 7259 invoked from network); 9 Feb 2002 19:19:33 -0000 Received: from unknown (HELO localhost.redhat.com) (24.114.26.18) by sources.redhat.com with SMTP; 9 Feb 2002 19:19:33 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 1323F3E6A; Sat, 9 Feb 2002 14:19:30 -0500 (EST) Message-ID: <3C657641.1080906@cygnus.com> Date: Sat, 09 Feb 2002 11:19:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 X-Accept-Language: en-us MIME-Version: 1.0 To: kettenis@chello.nl, gcc@gcc.gnu.org Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix PR gdb/290 References: <20020209172736.38606.qmail@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg00280.txt.bz2 [added gcc] > Checked in as obvious. Wonder why GCC didn't warn about this. Should > we add some more -Wxxx flags? I was looking at it and wondering the same thing - I know I've fixed botched return type warnings. Trying: static int f1 (void) { return 1; } static void f2 (void) { return 1; } static void f3 (void) { return; } static int f4 (void) { return; } I get: -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Werror doublest.c: In function `f2': doublest.c:741: warning: `return' with a value, in function returning void doublest.c: In function `f4': doublest.c:743: warning: `return' with no value, in function returning non-void 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? Andrew > Mark > > > Index: ChangeLog > from Mark Kettenis > > * doublest.c (store_typed_floating): Don't try to return a value. > Fixes PR gdb/290. > > Index: doublest.c > =================================================================== > RCS file: /cvs/src/src/gdb/doublest.c,v > retrieving revision 1.8 > diff -u -p -r1.8 doublest.c > --- doublest.c 2002/01/22 19:57:40 1.8 > +++ doublest.c 2002/02/09 17:24:44 > @@ -732,9 +732,9 @@ store_typed_floating (void *addr, const > memset (addr, 0, TYPE_LENGTH (type)); > > if (TYPE_FLOATFORMAT (type) == NULL) > - return store_floating (addr, TYPE_LENGTH (type), val); > - > - floatformat_from_doublest (TYPE_FLOATFORMAT (type), &val, addr); > + store_floating (addr, TYPE_LENGTH (type), val); > + else > + floatformat_from_doublest (TYPE_FLOATFORMAT (type), &val, addr); > } > > /* Convert a floating-point number of type FROM_TYPE from a > >