This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sprintf question


On Wed 28 Feb 2007 11:10, Anders Lindgren pondered:
> ÂÂ There are a bunch of *printf variants in stdlib, so it makes sense to
>  have a single function doing all the (messy!) work and make the others
>  simple wrappers around that function.
>
>  ÂÂ Virtually all stdio implementations I have come across do this the same
>  way[0]: They construct a dummy stdio FILE object with a special flag
>  indicating that it's really just a buffer, and then call vfprintf to do
>  the job. This is a plain dumb convention in many embedded systems, as you
>  have just noticed...

Yeah, I put some stubs in my application,

/* stubs */
int _close(int fd) {}
int _fstat (int filedes, struct stat *buf) {}
int isatty (int desc) {}
off_t _lseek(int fildes, off_t offset, int whence) {}
ssize_t _read(int fd, void *buf, size_t count) {}
ssize_t _write(int fd, const void *buf, size_t count) {}

and it fixed things up. Compiles, and runs without issue now. (It is a little 
stack heavy, but at least it works).

Thanks.

-Robin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]