Building an application without the C library
If your application does not initialize the C library, a number of functions are not available in your application.
Creating an application that has a main()
function causes the C library
initialization functions to be included as part of __rt_lib_init.
If your application does not have a main()
function, the C library is not
initialized and the following functions are not available in your application:
Low-level
stdio
functions that have the prefix _sys_.Signal-handling functions,
signal()
andraise()
in signal.h.Other functions, such as
atexit()
.
The following table shows header files, and the functions they contain, that are available with an uninitialized library. Some otherwise unavailable functions can be used if the library functions they depend on are re-implemented.
Table 1-6 Standalone C library functions
Function | Description |
---|---|
alloca.h | Functions in this file work without any library initialization or function re-implementation. You must know how to build an application with the C library to use this header file. |
assert.h | Functions listed in this file require high-level stdio,
|
ctype.h | Functions listed in this file require the locale functions. |
errno.h | Functions in this file work without the requirement for any library initialization or function re-implementation. |
fenv.h | Functions in this file work without the requirement for any
library initialization and only require the re-implementation of
|
float.h | This file does not contain any code. The definitions in the file do not require library initialization or function re-implementation. |
inttypes.h | Functions listed in this file require the locale functions. |
limits.h | Functions in this file work without the requirement for any library initialization or function re-implementation. |
locale.h | Call setlocale(LC_ALL, "C"); See the contents of locale.h for more information on the following functions and data structures:
locale.h also contains constant declarations used with locale functions. |
math.h | For functions in this file to work, you must first call
|
setjmp.h | Functions in this file work without any library initialization or function re-implementation. |
signal.h | Functions listed in this file are not available without library initialization. You must know how to build an application with the C library to use this header file.
|
stdarg.h | Functions listed in this file work without any library initialization or function re-implementation. |
stddef.h | This file does not contain any code. The definitions in the file do not require library initialization or function re-implementation. |
stdint.h | This file does not contain any code. The definitions in the file do not require library initialization or function re-implementation. |
stdio.h | The following dependencies or limitations apply to these functions:
|
stdlib.h | Most functions in this file work without any library initialization or function re-implementation. The following functions depend on other functions being instantiated correctly:
|
string.h | Functions in this file work without any library initialization,
with the exception of |
time.h |
|
wchar.h | Wide character library functions added to ISO C by Normative Addendum 1 in 1994. The following dependencies or limitations apply to these functions:
|
wctype.h | Wide character library functions added to ISO C by Normative Addendum 1 in 1994. This requires locale. |