Specifications

input through stdin. You can control the assignment of stdin, stdout, and stderr channels by
manipulating BSP settings.
Use a Smaller File I/O Library
Use the Small newlib C Library
The full newlib ANSI C standard library is often unnecessary for embedded systems. The GNU Compiler
Collection (GCC) provides a reduced implementation of the newlib ANSI C standard library, omitting
features of newlib that are often superfluous for embedded systems. The small newlib implementation
requires a smaller code footprint. When you use nios2-elf-gcc at the command line, the -msmallc
command-line option enables the small C library.
You can select the small newlib library through BSP settings.
Table 6-9: Limitations of the Nios II Small newlib C Library
Limitation Functions Affected
No floating-point support for printf() family of routines. The
functions listed are implemented, but %f and %g options are not
supported.
asprintf()
fiprintf()
fprintf()
iprintf()
printf()
siprintf()
snprintf()
sprintf()
No floating-point support for vprintf() family of routines. The
functions listed are implemented, but %f and %g options are not
supported.
vasprintf()
vfiprintf()
vfprintf()
vprintf()
vsnprintf()
vsprintf()
No support for scanf() family of routines. The functions listed
are not supported.
fscanf()
scanf()
sscanf()
vfscanf()
vscanf()
vsscanf()
No support for seeking. The functions listed are not supported. fseek()
ftell()
NII5V2
2015.05.14
Use a Smaller File I/O Library
6-29
Developing Programs Using the Hardware Abstraction Layer
Altera Corporation
Send Feedback