diff options
author | Zack Weinberg <zackw@panix.com> | 2018-03-07 14:32:01 -0500 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.eti.br> | 2018-12-05 18:15:42 -0200 |
commit | 698fb75b9ff5ae454a1344b5f9fafa0ca367c555 (patch) | |
tree | cf2b4ff04c4acd8af7bedacc0f42db69f6303f0d /ChangeLog | |
parent | d91798b31ac79914c234c4da7f7e7396bde2d85c (diff) | |
download | glibc-698fb75b9ff5ae454a1344b5f9fafa0ca367c555.tar glibc-698fb75b9ff5ae454a1344b5f9fafa0ca367c555.tar.gz glibc-698fb75b9ff5ae454a1344b5f9fafa0ca367c555.tar.bz2 glibc-698fb75b9ff5ae454a1344b5f9fafa0ca367c555.zip |
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.
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 82 |
1 files changed, 82 insertions, 0 deletions
@@ -1,6 +1,88 @@ 2018-12-05 Zack Weinberg <zackw@panix.com> Gabriel F. T. Gomes <gabriel@inconstante.eti.br> + * libio/libioP.h (__vfprintf_internal, __vfwprintf_internal) + (__vasprintf_internal, __vdprintf_internal, __obstack_vprintf_internal) + (__vsprintf_internal, __vsnprintf_internal, __vswprintf_internal): + New functions. + (PRINTF_LDBL_IS_DBL, PRINTF_FORTIFY): New constants. + (_IO_vasprintf, _IO_vdprintf, _IO_vsnprintf): Remove prototypes. + + * stdio-common/vfprintf-internal.c: Rename from vfprintf.c. + Include wctype.h here if COMPILE_WPRINTF is defined. + Define __vfprintf_internal or __vfwprintf_internal, depending + on COMPILE_WPRINTF. + Temporarily, on entry to this function, update mode_flags + according to the environmental settings corresponding to + PRINTF_LDBL_IS_DBL and PRINTF_FORTIFY. + Throughout, check mode_flags instead of __ldbl_is_dbl and + _IO_FLAGS2_FORTIFY on the destination FILE. + * stdio-common/vfwprintf-internal.c: Rename from vfwprintf.c. + Include vfprintf-internal.c. Don't include wctype.h. + * stdio-common/vfprintf.c: New file. Just define __vfprintf + as a wrapper around __vfprintf_internal, with aliases _IO_vfprintf + and vfprintf. + * stdio-common/vfwprintf.c: New file. Just define __vfwprintf + as a wrapper around __vfwprintf_internal, with aliases _IO_vfwprintf + and vfwprintf. + * stdio-common/Makefile: Add vfprintf-internal and vfwprintf-internal. + + * libio/iovdprintf.c (_IO_vdprintf): Rename to __vdprintf_internal + and add mode_flags argument; use __vfprintf_internal. + (__vdprintf): New function. Alias vdprintf to this. + * libio/iovsprintf.c (_IO_vsprintf, __vsprintf): Similarly. + * libio/vasprintf.c (_IO_vasprintf, __vasprintf): Similarly. + * libio/obprintf.c (_IO_obstack_vprintf, __obstack_vprintf): Similarly. + (__obstack_printf): Use __obstack_printf_internal. + * libio/vsnprintf.c (_IO_vsnprintf, ___vsnprintf): Similarly, with + public aliases __vsnprintf and vsnprintf. + Remove use of ldbl_hidden_def, since __vsnprintf is no longer + called internally. + * libio/vswprintf (_IO_vswprintf, __vswprintf): Similarly, with + public aliases _IO_vsprintf and vsprintf. + * libio/swprintf.c (__swprintf): Use __vswprintf_internal. + * stdio-common/asprintf.c (__asprintf): Use __vasprintf_internal. + * stdio-common/dprintf.c (__dprintf): Use __vdprintf_internal. + * stdio-common/snprintf.c (__snprintf): Use __vsprintf_internal. + * stdio-common/sprintf.c (__sprintf): Use __vsprintf_internal. + + * debug/obprintf_chk.c, debug/vasprintf_chk.c, debug/vdprintf_chk.c + * debug/vsnprintf_chk.c, debug/vsprintf_chk.c, hurd/vpprintf.c + * stdio-common/fprintf.c, stdio-common/fxprintf.c + * stdio-common/printf.c: Use __vfprintf_internal. + + * debug/fwprintf_chk.c, debug/vfwprintf_chk.c, debug/vswprintf_chk.c + * debug/vwprintf_chk.c, debug/wprintf_chk.c, libio/fwprintf.c + * libio/vwprintf.c, libio/wprintf.c: Use __vfwprintf_internal. + + * sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Use __vsprintf_internal, + __obstack_vprintf_internal, __vasprintf_internal, __vdprintf_internal, + __vsnprintf_internal, __vswprintf_internal, __vfprintf_internal, and + __vfwprintf_internal. + + * libio/libio.h: Remove libc_hidden_proto and declaration for + _IO_vfprintf. + Remove declaration of _IO_vfwprintf. + * libio/iolibio.h: Remove libc_hidden_proto and declaration for + _IO_vsprintf. + Remove declarations of _IO_vswprintf, _IO_obstack_printf, and + _IO_obstack_printf. + * include/stdio.h: Add prototype for __vasprintf. + (__vsnprintf): Remove declaration, because there are no more + internal calls. + * include/wchar.h (__vfwprintf, __vswprintf): Remove + declaration, because there are no more internal calls. + + * argp/argp-fmtstream.c (__argp_fmtstream_printf): Use + __vsnprintf_internal, instead of _IO_vsnprintf. + * argp/argp-help.c (__argp_error, __argp_failure): Use + __vasprintf_internal, instead of _IO_vasprintf. + * argp/argp-namefrob.h (__vsnprintf): Do not undefined then + redefine, because there are no more internal calls. + +2018-12-05 Zack Weinberg <zackw@panix.com> + Gabriel F. T. Gomes <gabriel@inconstante.eti.br> + * stdio-common/vfscanf-internal.c: Don't look at __ldbl_is_dbl. * sysdeps/ieee754/ldbl-opt/ndlbl-compat.c: Include libio/strfile.h instead of libioP.h. |