11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IntroductionLIBRARY OBJECT FILESMost of the library definitions can be used without modification, that is, directly fromthe library object files that are supplied with the product. For information about how tochoose a runtime library, see Basic settings for project configuration, page 5. The linkerwill include only those routines that are required—directly or indirectly—by yourapplication.REENTRANCYA function that can be simultaneously invoked in the main application and in anynumber of interrupts is reentrant. A library function that uses statically allocated data istherefore not reentrant.Most parts of the DLIB library are reentrant, but the following functions and parts arenot reentrant as they need static data:● Heap functions—malloc, free, realloc, calloc, as well as the <strong>C++</strong> operatorsnew and delete● Time functions—asctime, localtime, gmtime, mktime● Multibyte functions—mbrlen, mbrtowc, mbsrtowc, wcrtomb, wcsrtomb,wctomb● The miscellaneous functions setlocale, rand, atexit, strerror, strtok● Functions that use files in some way. This includes printf, scanf, getchar, andputchar. The functions sprintf and sscanf are not included.For the CLIB library, the qsort function is non-reentrant, as well as functions that usefiles in some way. This includes printf, scanf, getchar, and putchar. Thefunctions sprintf and sscanf are not included.In addition, some functions share the same storage for errno. These functions are notreentrant, since an errno value resulting from one of these functions can be destroyedby 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, strtoulRemedies for this are:●●Do not use non-reentrant functions in interrupt service routinesGuard calls to a non-reentrant function by a mutex, or a secure region, etc.232<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!