I\'m a C++ programmer and used to OO languages with good exception handling.
From what I can understand, setjmp and longjmp are essentially a c-style way to propogate ex
setjmp
and longjmp
are macros used to bypass normal function call and return flow.
The setjmp
saves the calling env to be used by longjmp
Use of these macros correctly is really hard and you can easily end up with undefined behavior.
Because of this, it is mandated for example to restrict longjmp
to 1 level of signal handler (best actually to not be called at all).
In critical systems it is required not to be used at all.