This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Bug in _VFPRINTF_R
- From: Eric Blake-1 <ebb9 at byu dot net>
- To: newlib at sourceware dot org
- Date: Fri, 14 Sep 2007 15:32:30 -0700 (PDT)
- Subject: Re: Bug in _VFPRINTF_R
- References: <46EAD80E.5050201@laposte.net>
> I think there is a bug in _VFPRINTF_R (vfprintf.c) in the string case.
Not a bug.
> I think if cp equals NULL, cp just should be empty.
Why? POSIX and C99 are both clear - if cp is NULL, your
program is invoking undefined behavior. Newlib is allowed
to do whatever it wants, including reformat your hard
drive. However, for debuggability purposes, we have
instead chosen to copy glibc, and print "(null)" to point
out your non-compliant program a little more nicely.
--
Eric Blake
--
View this message in context: http://www.nabble.com/Bug-in-_VFPRINTF_R-tf4444608.html#a12684943
Sent from the Sourceware - newlib list mailing list archive at Nabble.com.