Instructs the compiler to generate traps for signed arithmetic overflow on addition, subtraction, and multiplication operations.
Default
-ftrapv is disabled by default.
Usage
The compiler inserts code that checks for overflow and traps the overflow with an undefined instruction. An undefined instruction handler must be provided for the overflow to get caught at run-time.
Note:
When both -fwrapv and -ftrapv are used in a single command, the
furthest-right option overrides the other.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.