Specifications

CAVR-4
60
Choosing formatters for printf and scanf
AVR® IAR C/C++ Compiler
Reference Guide
For information about how to fine-tune the formatting capabilities even further, see
Configuration symbols for printf and scanf, page 69.
Specifying print formatter in IAR Embedded Workbench
To specify the printf formatter in IAR Embedded Workbench, choose
Project>Options and select the General Options category. Select the appropriate
option on the Library options page.
Specifying printf formatter from the command line
To use any other variant than the default (_PrintfSmall), add one of the following
lines in the linker command file you are using:
-e_PrintfLarge=_Printf
-e_PrintfSmall=_Printf
-e_PrintfTiny=_Printf
CHOOSING SCANF FORMATTER
In a similar way to the printf function, scanf uses a common formatter, called
_Scanf. The default version is very large, and provides facilities that are not required
in many embedded applications. To reduce the memory consumption, two smaller,
alternative versions are also provided in the standard C/C++ library.
The following table summarizes the capabilities of the different formatters:
* Depends on which library configuration that is used.
Formatting capabilities _ScanfFull _ScanfLarge
_ScanfSmall
(default)
Basic specifiers c, d, i, o, p, s, u, X,
x, and %
Ye s Ye s Ye s
Multibyte support * * *
Floating-point specifiers a, and A Yes N o N o
Floating-point specifiers e, E, f, F, g,
and G
Ye s N o N o
Conversion specifier n Ye s N o N o
Scan set [ and ] Ye s Ye s N o
Assignment suppressing * Ye s Ye s N o
long long support Yes No No
Table 18: Formatters for scanf