The setjmp() macro should be invoked from only one of the contexts listed in subclause 7.13.12.1 of the of the C Standard [ISO/IEC 9899:20112024]. Invoking setjmp() outside of one of these contexts results in undefined behavior. (See undefined behavior 125.)
...