...
- the entire controlling expression of a selection or iteration statement
- one operand of a relational or equality operator with the other operand an integer constant expression, with the resulting expression being the entire controlling expression of a selection or iteration statement
- the operand of a unary
!
operator with the resulting expression being the entire controlling expression of a selection or iteration statement - the entire expression of an expression statement (possibly cast to void)
Invoking setjmp
outside of one of these contexts results in undefined behavior (see Undefined Behavior #119).
After invoking longjmp
, non-volatile-qualified local objects should not be accessed if their values could have changed since the invocation of setjmp
. Their value in this case is considered indeterminate and accessing them is undefined behavior (see Undefined Behavior #121).
longjmp
should never be used to return control to a function that has terminated execution (see Undefined Behavior #120).
This recommendation is related to SIG32-C. Do not call longjmp() from inside a signal handler and ENV32-C. All atexit handlers must return normally.
...