"division by zero", overflow / underflow, etc. lead to undefined behavior in the first place. If the system, however, generates a signal for this, the UB effect โpausesโ. Instead, a signal handler is executed. But if the handler returns, the UB effect will โresumeโ.
Therefore, the standard prohibits returning from such a situation.
Think about how the program should recover, for example. Div0? An abstract machine has no idea about FPU registers or status flags, and even if - what result should be generated?
C also has no provisions to properly open the stack, like C ++.
We also note that the generation of signals for arithmetic exceptions is optional, therefore there is no guarantee that the signal will actually be generated. The handler is mainly intended for event notification and, possibly, for cleaning up external resources.
The behavior is different for signals that do not come from undefined behavior, but simply interrupt program execution. This is well defined, as the state of the program is clearly defined.
Edit:
If you need to rely on a program to continue under any circumstances, you should check all the arguments of arithmetic operations before performing the actual operation and / or use only safe operations (reorder, use larger intermediate types, etc.). One example for integers might be to use unsigned instead of signed integers, as for those overflow operations are correctly defined (wraps), so the intermediate overflow results will not cause problems if this is fixed later and the wrapper is not too much. (Disclaimer: this does not always work, of course).
Update:
Although Iโm still not quite sure, according to the comments, the standard may allow, at least for a hosted environment, to use LIA-1 traps and restore them (see Appendix H. Since this is not necessarily accurate, I suspect that recovery is not possible with any In addition, math.h may present additional aspects that need to be carefully evaluated.
Finally: I still think that with this approach nothing works, but some uncertainty has been added compared to using safe algorithms. It would be different if not many different components were involved. For an embedded system with white metal, the appearance may be completely different.