Datasheet

The C and C++ Libraries
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-51
4.7 Tailoring error signaling, error handling, and program exit
All trap or error signals raised by the C library go through the
__raise()
function. You
can re-implement this function or the lower-level functions that it uses.
Caution
The IEEE 754 standard for floating-point processing states that the default response to
an exception is to proceed without a trap. You can modify floating-point error handling
by tailoring the functions and definitions in
fenv.h
. See also Chapter 5 Floating-point
Support.
See the
rt_misc.h
include file for more information on error-related functions.
The trap and error-handling functions are shown in Table 4-9. See also Tailoring the C
library to a new execution environment on page 4-20 for additional information about
application initialization and shutdown.
Table 4-9 Trap and error handling
Function Description
_sys_exit()
Called, eventually, by all exits from the library. See
_sys_exit() on page 4-52.
errno
Is a static variable used with error handling. See
errno on page 4-52.
__raise()
Raises a signal to indicate a runtime anomaly. See
__raise() on page 4-53.
__rt_errno_addr()
This function is called to obtain the address of the
variable
errno
. See __rt_errno_addr() on
page 4-53.
__rt_fp_status_addr()
This function is called to obtain the address of the
fp status word. See __rt_fp_status_addr() on
page 4-56.
__default_signal_handler()
Displays an error indication to the user. See
__default_signal_handler() on page 4-54.
_ttywrch()
The default implementation of
_ttywrch()
is
semihosted and therefore it uses the semihosting
SWI. See _ttywrch() on page 4-56.