SIG35-C. Do not return from a computational exception signal handler
According to the C Standard, 7.14.1.1 paragraph 3 [ ISO/IEC 9899:2024 ], if a signal handler returns when it has been entered as a result of a computational exception (that is, with the value of its argument of SIGFPE , SIGILL , SIGSEGV , or any other implementation-defined value corresponding to such an exception) returns, then the behavior is undefined . (See undefined behavior 130 .)
When a signal occurs and func points to a function, it is implementation-defined whether the equivalent of signal (sig, SIG_DFL); is executed or the implementation prevents some implementation- defined set of signals (at least including sig) from occurring until the current signal handling has completed; in the case of SIGILL, the implementation may alternatively define that no action is taken. Then the equivalent of (*func)(sig); is executed. If and when the function returns, if the value of sig is SIGFPE, SIGILL, SIGSEGV, or any other implementation-defined value corresponding to a computational exception, the behavior is undefined; otherwise