Keil Logo

Differences between microlib and the default C library

2.2 Differences between microlib and the default C library

There are a number of differences between microlib and the default C library.

The main differences are:
  • Microlib is not compliant with the ISO C library standard. Some ISO features are not supported and others have less functionality.
  • Microlib is not compliant with the IEEE 754 standard for binary floating-point arithmetic.
  • Microlib is highly optimized for small code size.
  • Locales are not configurable. The default C locale is the only one available.
  • main() must not be declared to take arguments and must not return. In main, argc and argv parameters are undefined and cannot be used to access command-line arguments.
  • Microlib provides limited support for C99 functions. Specifically, microlib does not support the following C99 functions:
    • <fenv.h> functions:
      feclearexcept      fegetenv           fegetexceptflag
      fegetround         feholdexcept       feraiseexcept
      fesetenv           fesetexceptflag    fesetround
      fetestexcept       feupdateenv
    • Wide characters in general:
      btowc         fgetwc         fgetws         fputwc
      fputws        fwide          fwprintf       fwscanf
      getwc         getwchar       iswalnum       iswalpha 
      iswblank      iswcntrl       iswctype       iswdigit 
      iswgraph      iswlower       iswprint       iswpunct 
      iswspace      iswupper       iswxdigit      mblen 
      mbrlen        mbsinit        mbsrtowcs      mbstowcs 
      mbtowc        putwc          putwchar       swprintf 
      swscanf       towctrans      towlower       towupper 
      ungetwc       vfwprintf      vfwscanf       vswprintf 
      vswscanf      vwprintf       vwscanf        wcscat 
      wcschr        wcscmp         wcscoll        wcscspn 
      wcsftime      wcslen         wcsncat        wcsncmp 
      wcsncpy       wcspbrk        wcsrchr        wcsrtombs 
      wcsspn        wcsstr         wcstod         wcstof 
      wcstoimax     wcstok         wcstol         wcstold 
      wcstoll       wcstombs       wcstoul        wcstoull 
      wcstoumax     wcsxfrm        wctob          wctomb 
      wctrans       wctype         wmemchr        wmemcmp 
      wmemcpy       wmemmove       wmemset        wprintf 
    • Auxiliary <math.h> functions:
      ilogb              ilogbf             ilogbl 
      lgamma             lgammaf            lgammal 
      logb               logbf              logbl 
      nextafter          nextafterf         nextafterl 
      nexttoward         nexttowardf        nexttowardl
    • Functions relating to program startup and shutdown and other OS interaction:
      _Exit              atexit             exit
      system             time
  • Microlib does not support C++.
  • Microlib does not support operating system functions.
  • Microlib does not support position-independent code.
  • Microlib does not provide mutex locks to guard against code that is not thread safe.
  • Microlib does not support wide characters or multibyte strings.
  • Microlib does not support selectable one or two region memory models as the standard library (stdlib) does. Microlib provides only the two region memory model with separate stack and heap regions.
  • Microlib does not support the bit-aligned memory functions _membitcpy[b|h|w][b|l]() and membitmove[b|h|w][b|l]().
  • Microlib can be used with either --fpmode=std or --fpmode=fast.
  • The level of ANSI C stdio support that is provided can be controlled with #pragma import(__use_full_stdio).
  • #pragma import(__use_smaller_memcpy) selects a smaller, but slower, version of memcpy().
  • setvbuf() and setbuf() always fail because all streams are unbuffered.
  • feof() and ferror() always return 0 because the error and EOF indicators are not supported.
Non-ConfidentialPDF file icon PDF versionARM DUI0378H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 

Related Knowledgebase Articles

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.