This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: sprintf without realloc?
- From: Darin Johnson <chezdj at earthlink dot net>
- To: Matt Gessner <mgessner at Avidyne dot com>, newlib at sourceware dot org
- Date: Mon, 25 Sep 2006 16:50:19 -0400 (EDT)
- Subject: RE: sprintf without realloc?
- Reply-to: Darin Johnson <darin at usa dot net>
>My original post wasn't clear; I'm prevented from using any kind of
>*alloc based function that dynamically manages memory.
Hmm, from a quick look at the code, malloc() is really only needed
to support the "%S" and "%ls" formats (wide character strings).
It's likely you don't need this support. So you could just create
_malloc_r and _free_r routines that always return an error.
If you do need the wide character support, then you can have
the _malloc_r and _free_r routines deal with a static buffer, or
change the vfprintf.c to use a static buffer directly.