Datasheet

The C and C++ Libraries
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-21
2. Calls
__rt_lib_init()
to initialize referenced library functions, initialize the
locale and, if necessary, set up
argc
and
argv
for
main()
. For C++, calls the
constructors for any top-level objects.
3. Calls
main()
, the user-level root of the application.
From
main()
, your program might call, among other things, library functions. See
Library functions called from main() for more information.
4. Calls
exit()
with the value returned by
main()
.
Library functions called from main()
The function
main()
is the user-level root of the application. It requires the execution
environment to be initialized, and that input/output functions can be called. While in
main()
the program might perform one of the following actions that calls
user-customizable functions in the C library:
Extend the stack or heap. See Tailoring the runtime memory model on page 4-67.
Call library functions that require a callout to a user-defined function,
__rt_fp_status_addr()
or
clock()
for example. See Tailoring other C library
functions on page 4-85.
Call library functions that use
LOCALE
or
CTYPE
. See Tailoring locale and CTYPE
on page 4-26.
Perform floating-point calculations that require the fpu or fp library.
Input or output directly through low-level functions,
putc()
for example, or
indirectly through high-level input/output functions and input/output support
functions,
fprintf()
or
sys_open()
for example. See Tailoring the input/output
functions on page 4-75.
Raise an error or other signal,
ferror
for example. See Tailoring error signaling,
error handling, and program exit on page 4-51.