This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Use siprintf() in asctime_r.c
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sourceware dot org
- Date: Mon, 23 May 2011 13:55:54 +0200
- Subject: Re: Use siprintf() in asctime_r.c
- References: <4DDA3E77.7010704@munts.net>
- Reply-to: newlib at sourceware dot org
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
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat