Bug (?) in sprintf family?

Jeff Johnston jjohnstn@redhat.com
Wed Apr 9 20:13:00 GMT 2008

I'm looking at this.  I have one patch for vfprintf.c, but there may be 
other patches required.

-- Jeff J.

Jonathan S. Shapiro wrote:
> I am not sure whether or not this is a bug; my goal is to find out.
> I have a call to vsnprintf. This is failing because isatty() is not yet
> defined by our libc port.  The call to isatty() is being made from
> within __smakebuf_r. There are also references to the reentrant versions
> of close, read, write, sbrk, fstat, and lseek.
> Now I do understand that all of these are required to do anything
> significant with stdio, but it is somewhat surprising that they are
> required for sprintf, which really doesn't need to touch the
> file-oriented logic at all.
> Is the implementation of sprintf deficient, or does the libc standard
> not require any independence between sprintf and the file system?
> I can either stub out the missing routines or supply a replacement for
> vsnprintf in our coyotos-specific library, but before I do I would like
> to understand whether this should be viewed as a newlib bug.
> Heck, vsnprintf doesn't have a FILE* to work with, so there isn't any
> fd, so I'm not entirely sure what these routines could possibly be
> getting called *on* in this case. The program makes no other use of
> stdio.
> shap

More information about the Newlib mailing list