This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Exceptions, C, and Gcc
Kevin Atkinson <kevina at gnu dot org> writes:
> I know IF compiled with -fexceptions. But my question is WHY is that
> necessary. What exactly needs to happen in a function for an exception to
> pass through a C function. Can't it just pop the stack as would happen in
> a longjmp. Sorry for my ignorance.
For each function that might be on the call stack when an exception is
thrown, the compiler must generate static tables showing how to unwind
through that function. This removes all overhead from the 'normal'
path (where no exception is thrown).
zw