The longjmp function, and related functions, may be used in combination with exception handling. However, such non-local gotos do not cause the auto destructors to run as they would with exception unwinding. Also use of setjmp, blkjmp, or similar functions in a C++ functions that contain try blocks or non-trivial auto destructors could cause unpredictable results. In such cases, the internal state information used by exception handling may not be correct for the stack frame that becomes current after the non-local goto.
longjmp
setjmp
blkjmp
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.