You copied the Doc URL to your clipboard.

About trapping integer division-by-zero errors with __rt_raise()

By default, integer division by zero raises a signal. Therefore, to intercept division by zero, the C library help function __rt_raise() can be re-implemented to handle the signal. The function prototype for __rt_raise() is as follows:

void __rt_raise(int signal, int type);

When a divide-by-zero error occurs, __aeabi_idiv0() calls __rt_raise(2, 2). Therefore, in the implementation of __rt_raise(), (signal == 2) && (type == 2) must be checked to determine if division by zero has occurred.

Was this page helpful? Yes No