This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_return_address
- To: Matt Newcomb <spock at telerama dot com>
- Subject: Re: __builtin_return_address
- From: "Zack Weinberg" <zackw at stanford dot edu>
- Date: Tue, 31 Oct 2000 19:40:44 -0800
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <20001101031821.21269.qmail@speedbuggy.telerama.com>
On Tue, Oct 31, 2000 at 10:18:21PM -0500, Matt Newcomb wrote:
> G'day,
>
> It is my interpretation that if you call
> __builtin_return_address with position in the call stack
> higher than the top of the call stack then it should
> return 0. I've been told by several people that this is
> supposed to happen and have seen at least three
> debugging/profiling packages that make this assumption.
1) main is not the top of the call stack.
2) You cannot rely on __builtin_return_address to return any
meaningful information whatsoever except when its argument is zero.
HTH.
zw