This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Porting Newlib to Microchip's dsPIC series


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]