Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-227
trap_overflows (supplementary)
trap_overflows (supplementary)
The trap_overflows function allows you to control the treatment of arithmetic overflows.
enable_flag
is an integer that requests overflow trapping be enabled or disabled. If enable_flag is
nonzero, overflow trapping is enabled. If enable_flag is zero, overflows are ignored.
Return Value
none.
Usage Guidelines
If overflow trapping is enabled and an overflow occurs, the program stops executing.
If overflow trapping is disabled and an overflow occurs, the overflow condition is
simply ignored. That is, the program continues executing, but the value resulting
from the calculation is undefined.
The default is overflow trapping enabled.
The trap_overflows function is also defined in the <mathh> header.
#include <stdlibh>
void trap_overflows(short enable_flag);