This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix `return' of long/long-long results with no debuginfo


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]