From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12714 invoked by alias); 11 Feb 2009 20:50:54 -0000 Received: (qmail 12706 invoked by uid 22791); 11 Feb 2009 20:50:53 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Feb 2009 20:50:48 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 5A046107D1; Wed, 11 Feb 2009 20:50:46 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 4906410577; Wed, 11 Feb 2009 20:50:46 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LXM2f-0002iT-Rf; Wed, 11 Feb 2009 15:50:45 -0500 Date: Wed, 11 Feb 2009 20:50:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: jan.kratochvil@redhat.com, gdb-patches@sourceware.org Subject: Re: [patch] Fix `return' of long/long-long results with no debuginfo Message-ID: <20090211205045.GB9762@caradoc.them.org> Mail-Followup-To: Mark Kettenis , jan.kratochvil@redhat.com, gdb-patches@sourceware.org References: <20090211194511.GA9324@host0.dyn.jankratochvil.net> <200902112040.n1BKdxb3028188@brahms.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902112040.n1BKdxb3028188@brahms.sibelius.xs4all.nl> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-02/txt/msg00253.txt.bz2 On Wed, Feb 11, 2009 at 09:40:00PM +0100, Mark Kettenis wrote: > Sorry, this is wrong. Functions without return type implicitly return int. I think it's a mistake to bring this rule (from K&R C, and removed in C99) to GDB. This is a different context; it's not functions declared without a return type in source code, but functions with an unknown return type (and unknown source language). Everything we pick will be wrong some of the time, but IMO "long" is maximally useful. "long long" on 32-bit platforms is going to pick up garbage from the next register for int or void * returns. Most platforms with int != long will have the return register with sizeof(long). -- Daniel Jacobowitz CodeSourcery