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


>   Date: Thu, 2 Nov 2000 00:19:47 -0800
>   From: "Zack Weinberg" <zackw@Stanford.EDU>
>
>   You're missing the point here.  Yes, on x86/linux without
>   -fomit-frame-pointer, __builtin_return_address(N) for N>0 is more
>   likely to work than on some other platforms.  It still isn't
>   guaranteed.  It might return zero back when there's still stack
>   frames, skip over active frames, surprise you with frames you didn't
>   expect, or crash instead of returning 0 when you run out of frames.
>   And I wouldn't be too shocked if it made demons fly out of my nose,
>   either.

All I've said originally was that the current GCC docs does not say
anything about undefined/unguaranteed behavior, and neither does it
mention demons flying out of your nose.  It says that
__builtin_return_address either returns a valid address, or, if it
can't get a valid address, it returns zero.

Therefore, I suggested to amend the docs.

Now, what point does this observation miss?

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