__builtin_return_address

Eli Zaretskii eliz@delorie.com
Wed Nov 1 00:50:00 GMT 2000


> 
> 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?


More information about the Gcc-bugs mailing list