4.3.5. The standalone C library functions

The following sections list the include files and the functions in them that are available with an uninitialized library. Some otherwise unavailable functions can be used if the library functions they depend on are re-implemented.

alloca.h

Functions listed in this file are not available without library initialization. See Building an application with the C library for instructions.

assert.h

Functions listed in this file require high-level stdio, __rt_raise(), and _sys_exit(). See Tailoring error signaling, error handling, and program exit for instructions.

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 __rt_raise().

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() before calling any function that uses locale functions. For example call:

 setlocale(LC_ALL, "C")

See the contents of locale.h for details of the following functions and data structures:

setlocale()

Selects the appropriate locale as specified by the category and locale arguments.

lconv

Is the structure used by locale functions for formatting numeric quantities according to the rules of the current locale.

localeconv()

Creates an lconv structure and returns a pointer to it.

_get_lconv()

Fills the lconv structure pointed to by the parameter. This ANSI extension removes the requirement for static data within the library.

locale.h also contains constant declarations used with locale functions. See Tailoring locale and CTYPE for more information.

math.h

Functions in this file work without the requirement for any library initialization and only require the re-implementation of __rt_raise(). You must call _fp_init() to use floating-point functions.

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. See Building an application with the C library for instructions on building an application that uses library initialization.

__rt_raise() can be re-implemented for error and exit handling. See Tailoring error signaling, error handling, and program exit for instructions.

stdarg.h

Functions 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 files:

  • The high-level functions such as printf(), scanf(), puts(), fgets(), fread(), fwrite(), perror() and so on require high-level stdio. See Tailoring the input/output functions for instructions.

  • The printf() and scanf() family of functions require locale.

  • The remove() and rename() functions are system-specific and probably not usable in your application.

stdlib.h

Most functions in this file work without any library initialization or function re-implementation. The following functions are not available, or require implementation of a support function:

ato*()

Requires locale.

strto*()

Requires locale.

malloc()

malloc(), calloc(), realloc(), and free() require heap functions.

atexit()

Is not available.

string.h

Functions in this file work without any library initialization, with the exception of strcoll() and strxfrm(), which require locale.

time.h

mktime() and localtime() can be used immediately.

time() and clock() are system-specific and probably not usable unless re-implemented.

asctime(), ctime(), and strftime() require locale.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D
Non-Confidential