ISO C features missing from microlib
Microlib does not support all ISO C90 features.
Major ISO C90 features not supported by microlib are:
- Wide character and multibyte support
- All functions dealing with wide characters or multibyte strings are not supported
by microlib. A link error is generated if these are used. For example,
mbtowc()
,wctomb()
,mbstowcs()
andwcstombs()
. All functions defined in Normative Addendum 1 are not supported by microlib. - Operating system interaction
- Almost all functions that interact with an operating system are not supported by
microlib. For example,
abort()
,exit()
,atexit()
,assert()
,time()
,system()
andgetenv()
. An exception isclock()
. A minimal implementation ofclock()
has been provided, which returns only –1, not the elapsed time. You may reimplementclock()
(and_clock_init()
, which it needs), if required. - File I/O
-
By default, all the
stdio
functions that interact with a file pointer return an error if called. The only exceptions to this are the three standard streamsstdin
,stdout
andstderr
.You can change this behavior using
__asm(".global __use_full_stdio\n\t")
. Use of this assembler directive provides a microlib version ofstdio
that supports ANSI C, with only the following exceptions:- The error and
EOF
indicators are not supported, sofeof()
andferror()
return0
. - All streams are unbuffered, so
setvbuf()
andsetbuf()
fail.
- The error and
- Configurable locale
- The default C locale is the only one available.
- Signals
- The functions
signal()
andraise()
are provided but microlib does not generate signals. The only exception to this is if the program explicitly callsraise()
. - Floating-point support
Floating-point support diverges from IEEE 754 in the following ways, but uses the same data formats and matches IEEE 754 in operations involving only normalized numbers:
- Operations involving NaNs, infinities or input denormals produce indeterminate results. Operations that produce a result that is nonzero but very small in value, return zero.
- IEEE exceptions cannot be flagged by microlib, and there is no
fp_status()
register in microlib. - The sign of zero is not treated as significant by microlib, and zeroes that are output from microlib floating-point arithmetic have an unknown sign bit.
- Only the default rounding mode is supported.
- Position independent and thread safe code
Microlib has no reentrant variant. Microlib does not provide mutex locks to guard against code that is not thread safe. Use of microlib is not compatible with position independent compilation modes.
Although ROPI code can be linked with microlib, the resulting binary is not ROPI-compliant overall.
- Command-line arguments
- In
main
,argc
andargv
parameters are undefined and cannot be used to access command-line arguments.