This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: __builtin_return_address


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

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