This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Porting Newlib to Microchip's dsPIC series
- From: Karolina Lindqvist <karolina dot lindqvist at kramnet dot se>
- To: newlib at sourceware dot org
- Date: Mon, 2 Feb 2009 13:59:24 +0100
- Subject: Re: Porting Newlib to Microchip's dsPIC series
- References: <27ced5d00901311200p1fd1ea8eq3e92f261513d8c7@mail.gmail.com> <27ced5d00902011105w37b86b07x51514af66290b67d@mail.gmail.com> <27ced5d00902011401s720b0cd9t4e3b9f826d222509@mail.gmail.com>
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.