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

Daniel Jacobowitz
2009-02-11T20:50:54Z

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