Use siprintf() in asctime_r.c

Corinna Vinschen
Tue May 24 10:08:00 GMT 2011

On May 23 13:01, Philip Munts wrote:
> When I called ctime() in a test program for an ARM9 target, I noticed that floating point libraries were linked in.
> I eventually traced this to sprintf() in asctime_r.c.  This should be changed to siprintf().  There are perhaps many other places throughout newlib where calls to xprintf() should be changed to xiprintf().

There are not many sprintf calls, except for in the Linux subtree,
which shouldn't matter, and in ldtoa, which is floating point anyway.

However, wwhile greping for sprintf in newlib, it occured to me that
on REENT_ONLY targets we don't have sprintf, nor siprintf.  Shouldn't
we call sprintf_r or siprintf_r within newlib to avoid breaking 
REENT_ONLY targets?  OTOH, it's interesting that we never had a
complaint about this before.  Does nobody build REENT_ONLY targets?


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the Newlib mailing list