This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_return_address
- To: zackw at stanford dot edu
- Subject: Re: __builtin_return_address
- From: Eli Zaretskii <eliz at delorie dot com>
- Date: Wed, 1 Nov 2000 03:50:46 -0500 (EST)
- CC: spock at telerama dot com, gcc-bugs at gcc dot gnu dot org
- References: <20001101031821.21269.qmail@speedbuggy.telerama.com> <20001031194044.F8628@wolery.stanford.edu>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
>
> 2) You cannot rely on __builtin_return_address to return any
> meaningful information whatsoever except when its argument is zero.
??? Then at least the GCC docs needs to be changed. It currently
says (in v2.95.2 release):
On some machines it may be impossible to determine the return
address of any function other than the current one; in such cases,
or when the top of the stack has been reached, this function will
return `0'.
According to this, all values but zero returned from
__builtin_return_address should be valid.
Also, is the platform the OP was talking about (Red Hat GNU/Linux)
really one of those where __builtin_return_address doesn't work?