&gt; Also, I would guess that also runs the risk of making it less portable across compilers (you need non-standard compiler features to implement this in C). Is that a concern?<p>Actually, no.  My code implements just enough in asm that the C part is a normal function using the normal C ABI.<p>There are some microoptimizations that would be possible if I were to rely on __builtin_frame_address, but GCC has some highly questionable optimizations (or arguably outright bugs) that make me quite nervous about using it.