glibc/stdlib
Zack Weinberg 698fb75b9f Add __v*printf_internal with flags arguments
There are a lot more printf variants than there are scanf variants,
and the code for setting up and tearing down their custom FILE
variants around the call to __vf(w)printf is more complicated and
variable.  Therefore, I have added _internal versions of all the
v*printf variants, rather than introducing helper routines so that
they can all directly call __vf(w)printf_internal, as was done with
scanf.

As with the scanf changes, in this patch the _internal functions still
look at the environmental mode bits and all callers pass 0 for the
flags parameter.

Several of the affected public functions had _IO_ name aliases that
were not exported (but, in one case, appeared in libio.h anyway);
I was originally planning to leave them as aliases to avoid having
to touch internal callers, but it turns out ldbl_*_alias only work
for exported symbols, so they've all been removed instead.  It also
turns out there were hardly any internal callers.  _IO_vsprintf and
_IO_vfprintf *are* exported, so those two stick around.

Summary for the changes to each of the affected symbols:

  _IO_vfprintf, _IO_vsprintf:
    All internal calls removed, thus the internal declarations, as well
    as uses of libc_hidden_proto and libc_hidden_def, were also removed.
    The external symbol is now exposed via uses of ldbl_strong_alias
    to __vfprintf_internal and __vsprintf_internal, respectively.

  _IO_vasprintf, _IO_vdprintf, _IO_vsnprintf,
  _IO_vfwprintf, _IO_vswprintf,
  _IO_obstack_vprintf, _IO_obstack_printf:
    All internal calls removed, thus declaration in internal headers
    were also removed.  They were never exported, so there are no
    aliases tying them to the internal functions.  I.e.: entirely gone.

  __vsnprintf:
    Internal calls were always preceded by macros such as
      #define __vsnprintf _IO_vsnprintf, and
      #define __vsnprintf vsnprintf
    The macros were removed and their uses replaced with calls to the
    new internal function __vsnprintf_internal.  Since there were no
    internal calls, the internal declaration was also removed.  The
    external symbol is preserved with ldbl_weak_alias to ___vsnprintf.

  __vfwprintf:
    All internal calls converted into calls to __vfwprintf_internal,
    thus the internal declaration was removed.  The function is now a
    wrapper that calls __vfwprintf_internal.  The external symbol is
    preserved.

  __vswprintf:
    Similarly, but no external symbol.

  __vasprintf, __vdprintf, __vfprintf, __vsprintf:
    New internal wrappers.  Not exported.

  vasprintf, vdprintf, vfprintf, vsprintf, vsnprintf,
  vfwprintf, vswprintf,
  obstack_vprintf, obstack_printf:
    These functions used to be aliases to the respective _IO_* function,
    they are now aliases to their respective __* functions.

Tested for powerpc and powerpc64le.
2018-12-05 18:15:42 -02:00
..
bits
sys
a64l.c
abort.c
abs.c
add_n.c
addmul_1.c
alloca.h
at_quick_exit.c
atexit.c
atof.c
atoi.c
atol.c
atoll.c
bsearch.c
bug-fmtmsg1.c
bug-getcontext.c
bug-strtod2.c
bug-strtod.c
canonicalize.c Fix BZ 22786: integer addition overflow may cause stack buffer overflow 2018-05-08 18:12:41 -07:00
cmp.c
cxa_at_quick_exit.c
cxa_atexit.c stdlib: assert on NULL function pointer in atexit etc. [BZ #20544] 2018-11-30 16:18:34 -08:00
cxa_finalize.c
cxa_thread_atexit_impl.c
dbl2mpn.c
Depend
div.c
divmod_1.c
divrem.c
drand48_r.c
drand48-iter.c
drand48.c
erand48_r.c
erand48.c
errno.h
exit.c
exit.h
fmtmsg.c
fmtmsg.h
fpioconst.c
fpioconst.h
gen-fpioconst.c
gen-tst-strtod-round.c Fix strtod overflow detection (bug 23279). 2018-06-13 16:06:14 +00:00
getcontext.c
getentropy.c
getenv.c
getrandom.c
getsubopt.c
gmp-impl.h
gmp.h
grouping.c
grouping.h
groupingwc.c
inlines.c
isomac.c Avoid insecure usage of tmpnam in tests. 2018-07-18 21:04:12 +00:00
jrand48_r.c
jrand48.c
l64a.c
labs.c
lcong48_r.c
lcong48.c
ldbl2mpn.c
ldiv.c
llabs.c
lldiv.c
longlong.h
lrand48_r.c
lrand48.c
lshift.c
makecontext.c
Makefile stdlib: assert on NULL function pointer in atexit etc. [BZ #20544] 2018-11-30 16:18:34 -08:00
mblen.c
mbstowcs.c mbstowcs: Remove outdated comment 2018-08-13 14:05:01 +02:00
mbtowc.c
mod_1.c
monetary.h
mp_clz_tab.c
mpn2dbl.c
mpn2flt.c
mpn2ldbl.c
mrand48_r.c
mrand48.c
msort.c
mul_1.c
mul_n.c
mul.c
nrand48_r.c
nrand48.c
old_atexit.c
on_exit.c stdlib: assert on NULL function pointer in atexit etc. [BZ #20544] 2018-11-30 16:18:34 -08:00
putenv.c
qsort.c
quick_exit.c
rand_r.c
rand.c
random_r.c Fix signed integer overflow in random_r (bug 17343). 2018-03-20 18:25:24 +00:00
random.c
rpmatch.c
rshift.c
secure-getenv.c
seed48_r.c
seed48.c
setcontext.c
setenv.c
srand48_r.c
srand48.c
stdlib.h reallocarray: Declare under _DEFAULT_SOURCE 2018-08-30 14:14:53 +02:00
strfmon_l.c Use STRFMON_LDBL_IS_DBL instead of __ldbl_is_dbl. 2018-11-16 09:21:14 -02:00
strfmon.c Use STRFMON_LDBL_IS_DBL instead of __ldbl_is_dbl. 2018-11-16 09:21:14 -02:00
strfrom-skeleton.c Add __v*printf_internal with flags arguments 2018-12-05 18:15:42 -02:00
strfromd.c
strfromf.c
strfroml.c
strtod_l.c Fix sign of NaN returned by strtod (bug 23007). 2018-06-15 17:35:17 +00:00
strtod_nan_main.c math: Merge strtod_nan_*.h into math-type-macros-*.h 2018-05-16 06:03:08 +02:00
strtod_nan_narrow.h
strtod_nan_wide.h
strtod_nan.c math: Merge strtod_nan_*.h into math-type-macros-*.h 2018-05-16 06:03:08 +02:00
strtod.c
strtof_l.c
strtof_nan.c math: Merge strtod_nan_*.h into math-type-macros-*.h 2018-05-16 06:03:08 +02:00
strtof.c
strtoimax.c
strtol_l.c
strtol.c
strtold_l.c
strtold_nan.c math: Merge strtod_nan_*.h into math-type-macros-*.h 2018-05-16 06:03:08 +02:00
strtold.c
strtoll_l.c
strtoll.c
strtoul_l.c
strtoul.c
strtoull_l.c
strtoull.c
strtoumax.c
sub_n.c
submul_1.c
swapcontext.c
system.c
tens_in_limb.c
test-a64l.c
test-at_quick_exit-race.c
test-atexit-race-common.c
test-atexit-race.c
test-bz22786.c stdlib/test-bz22786: Avoid memory leaks in the test itself 2018-10-30 13:56:40 +01:00
test-canon2.c
test-canon.c
test-cxa_atexit-race.c
test-dlclose-exit-race-helper.c
test-dlclose-exit-race.c
test-on_exit-race.c
testdiv.c
testdiv.input
testmb2.c
testmb.c
testrand.c
testsort.c
tst-at_quick_exit.c
tst-atexit-common.c
tst-atexit.c
tst-atof1.c
tst-atof2.c
tst-bsearch.c
tst-bz20544.c stdlib: assert on NULL function pointer in atexit etc. [BZ #20544] 2018-11-30 16:18:34 -08:00
tst-cxa_atexit.c
tst-empty-env.c Don't reduce test timeout to less than default 2018-10-17 09:34:13 +02:00
tst-environ.c
tst-fmtmsg.c
tst-fmtmsg.sh
tst-getrandom.c
tst-limits.c
tst-makecontext2.c
tst-makecontext3.c
tst-makecontext-align.c
tst-makecontext.c
tst-on_exit.c
tst-putenv.c
tst-putenvmod.c
tst-qsort2.c
tst-qsort.c
tst-quick_exit.cc
tst-rand48-2.c
tst-rand48.c
tst-random2.c
tst-random.c
tst-secure-getenv.c
tst-setcontext2.c
tst-setcontext3.c
tst-setcontext3.sh
tst-setcontext4.c Add another test for setcontext 2018-07-25 04:57:21 -07:00
tst-setcontext5.c Add a test for multiple setcontext calls 2018-07-25 05:00:30 -07:00
tst-setcontext6.c Add tests for setcontext on the context from makecontext 2018-07-25 05:13:16 -07:00
tst-setcontext7.c Add tests for setcontext on the context from makecontext 2018-07-25 05:13:16 -07:00
tst-setcontext8.c Add tests for setcontext on the context from makecontext 2018-07-25 05:13:16 -07:00
tst-setcontext9.c Fix stack overflow in tst-setcontext9 (bug 23717) 2018-09-27 12:31:03 +02:00
tst-setcontext.c
tst-strfmon_l.c Add long double input for strfmon test 2018-06-30 06:54:34 +05:30
tst-strfrom-locale.c
tst-strfrom.c
tst-strfrom.h
tst-strtod1i.c
tst-strtod2.c
tst-strtod3.c
tst-strtod4.c
tst-strtod5.c
tst-strtod5i.c
tst-strtod6.c
tst-strtod-nan-locale-main.c
tst-strtod-nan-locale.c
tst-strtod-nan-sign-main.c Add tests for sign of NaN returned by strtod (bug 23007). 2018-06-15 17:36:21 +00:00
tst-strtod-nan-sign.c Add tests for sign of NaN returned by strtod (bug 23007). 2018-06-15 17:36:21 +00:00
tst-strtod-overflow.c stdlib/tst-strtod-overflow: Switch to support_blob_repeat 2018-10-30 13:55:01 +01:00
tst-strtod-round-data Fix strtod overflow detection (bug 23279). 2018-06-13 16:06:14 +00:00
tst-strtod-round-data.h Fix strtod overflow detection (bug 23279). 2018-06-13 16:06:14 +00:00
tst-strtod-round-skeleton.c Fix strtod overflow detection (bug 23279). 2018-06-13 16:06:14 +00:00
tst-strtod-round.c
tst-strtod-underflow.c
tst-strtod.c
tst-strtod.h
tst-strtol-locale-main.c
tst-strtol-locale.c
tst-strtol.c
tst-strtoll.c
tst-swapcontext1.c Add a test for multiple makecontext calls 2018-07-25 04:54:00 -07:00
tst-system.c
tst-thread-quick_exit.cc
tst-tininess.c
tst-tls-atexit-lib.c
tst-tls-atexit-nodelete.c
tst-tls-atexit.c
tst-unsetenv1.c
tst-width-stdint.c
tst-width.c
tst-xpg-basename.c
ucontext.h Add <bits/indirect-return.h> 2018-07-24 07:55:47 -07:00
udiv_qrnnd.c
Versions Move __fentry__ version definition to sysdeps/{i386,x86_64} 2018-08-10 09:07:44 +02:00
wcstoimax.c
wcstombs.c
wcstoumax.c
wctomb.c
xpg_basename.c