aboutsummaryrefslogtreecommitdiff
path: root/include/coff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2023-11-16 20:34:55 +0100
committerCorinna Vinschen <corinna@vinschen.de>2023-11-17 13:10:20 +0100
commit61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d (patch)
tree6e7febc78b3b9e3984341c385f5f7c4d3603bbf6 /include/coff
parent7e4840bc459d5105a9d6290df1323ba1360ba081 (diff)
downloadnewlib-61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d.zip
newlib-61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d.tar.gz
newlib-61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d.tar.bz2
v{fs}printf/v{fs}wprintf: create external output helpers
So far, the printf family of functions has two output helper functions called __sprint_r and __sfputs_r. Both are called from all variants of vfprintf as well as vfwprintf. There are also analogue helper functions for the string-creating functions vsprintf/vswprintf called __ssprint_r and __ssputs_r. However, the helpers are built once when building vfprintf/vsprintf with the INTEGER_ONLY flag, and then they are part of the vfiprintf.c and vsiprintf.c files. The problem is this: Even if a process only calls vfwprintf or the non-INTEGER_ONLY vfprintf it will always have to include the INTEGER_ONLY vfiprintf. Otherwise the helper functions are undefined. Analogue for the string-creating functions. That's a useless waste of space by including one (or two) big, unused function, if newlib is linked in statically. Create new files to define the printf output helpers separately and split them into byte-oriented and wide-char-oriented functions. This allows to link only the required functions. Also, simplify the string output helpers and fix a potential (but unlikely) buffer overflow in __ssprint_r. Fixes: 8a0efa53e449 ("import newlib-2000-02-17 snapshot") Fixes: 6121968b198d ("* libc/include/stdio.h (__VALIST): Guard against multiple definition.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'include/coff')
0 files changed, 0 insertions, 0 deletions