Porting Newlib to Microchip's dsPIC series

Karolina Lindqvist karolina.lindqvist@kramnet.se
Mon Feb 2 12:59:00 GMT 2009


söndagen den 1 februari 2009 skrev Leo Singer:
> Here is the file that gets built from "printf.c".  It gets put in my
> build directory under "pic30/newlib/libc/stdio/lib_a-printf.o".  I see
> no mention of the symbol "printf", just "printf_r" and "iprintf".
> This is very strange because "iprintf" is not invoked directly
> anywhere inside the file "printf.c".  Does anyone know what is going
> on?

It is an options for pic30-gcc:
       -msmart-io
           This option attempts to statically analyze format strings passed to         
           printf,  scanf and the f and v variations of these functions. Uses
           of nonfloating point  format arguments will be converted to use an
           integer-only variation of the library functions.

To disable it, use the option -msmart-io=0

Depending on the option, the printf() routine will be named
_printf, _iprintf or _dprintf.
The same for fscanf, scanf, snprintf, sprintf, sscanf, vfprintf, vprintf, 
vsnprintf and vsprintf

Which means that to use this feature, all those routines come in three 
flavours.



More information about the Newlib mailing list