Integer division-by-zero errors in C code

You can trap and identify integer division-by-zero errors by re-implementing the appropriate C library helper functions.

The run-time divide routines have weak references to __aeabi_idiv0(). If __aeabi_idiv0() is not defined, then the reference is ignored and the divide routines return zero.

If you provide your own version of __aebi_idiv0(), then the divide routines call this function. The default library version of __aeabi_idiv0() calls __rt_raise() to raise SIGFPE with type DIVBYZERO.

Show/hideSee also

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0472F
Non-ConfidentialID091611