Specifications

CAVR-4
244
IAR DLIB Library
AVR® IAR C/C++ Compiler
Reference Guide
LIBRARY OBJECT FILES
Most of the library definitions can be used without modification, that is, directly from
the library object files that are supplied with the product. For information about how to
choose a runtime library, see Basic settings for project configuration, page 5. The linker
will include only those routines that are required—directly or indirectly—by your
application.
REENTRANCY
A function that can be simultaneously invoked in the main application and in any
number of interrupts is reentrant. A library function that uses statically allocated data is
therefore not reentrant. Most parts of the DLIB library are reentrant, but the following
functions and parts are not reentrant:
In addition, some functions share the same storage for
errno. These functions are not
reentrant, since an
errno value resulting from one of these functions can be destroyed
by a subsequent use of the function before it has been read. Among these functions are:
exp, exp10, ldexp, log, log10, pow, sqrt, acos, asin, atan2,
cosh, sinh, strtod, strtol, strtoul
Remedies for this are:
Do not use non-reentrant functions in interrupt service routines
Guard calls to a non-reentrant function by a mutex, or a secure region, etc.
IAR DLIB Library
The IAR DLIB Library provides most of the important C and C++ library definitions
that apply to embedded systems. These are of the following types:
Adherence to a free-standing implementation of the ISO/ANSI standard for the
programming language C. For additional information, see the chapter
Implementation-defined behavior in this guide.
atexit Needs static data
heap functions Need static data for memory allocation tables
strerror Needs static data
strtok Designed by ISO/ANSI standard to need static data
I/O Every function that uses files in some way. This includes
printf, scanf, getchar, and putchar. The
functions sprintf and sscanf are not included.