aboutsummaryrefslogtreecommitdiffstats
path: root/debug/wprintf_chk.c
Commit message (Collapse)AuthorAgeFilesLines
* Use PRINTF_LDBL_IS_DBL instead of __ldbl_is_dbl.zack/remove-mode-bitsZack Weinberg2018-05-311-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After all that prep work, nldbl-compat.c can now use PRINTF_LDBL_IS_DBL instead of __no_long_double to control the behavior of printf-like functions; this is the last thing we needed __no_long_double for, so it can go away entirely. * stdio-common/vfprintf-internal.c (__vfprintf_internal, __vfwprintf_internal): Don't use __ldbl_is_dbl. * sysdeps/generic/math_ldbl_opt.h: Remove __ldbl_is_dbl. * sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h: Remove __ldbl_is_dbl and __no_long_double. * sysdeps/ieee754/ldbl-opt/math_ldbl_opt.c: Remove file. * sysdeps/ieee754/ldbl-opt/Makefile (routines): Remove math_ldbl_opt. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl_cleanup, set_no_long_double, clear_no_long_double): Remove. (__nldbl___asprintf, __nldbl_dprintf, __nldbl_fprintf) (__nldbl_fwprintf, __nldbl_printf, __nldbl_sprintf) (__nldbl_vfprintf, __nldbl___vsprintf, __nldbl_obstack_vprintf) (__ndlbl_obstack_printf, __nldbl_snprintf, __nldbl_swprintf) (__nldbl_vasprintf, __nldbl_vdprintf, __nldbl_vfwprintf) (__nldbl_vprintf, __nldbl_vsnprintf, __ndlbl_vswprintf) (__nldbl_vwprintf, __nldbl_wprintf): Directly call the appropriate __v*printf_internal routine, passing PRINTF_LDBL_IS_DBL. Do not mess with __no_long_double. Normalize variable names. (__nldbl___fprintf_chk, __nldbl___fwprintf_chk) (__nldbl___printf_chk, __nldbl___snprintf_chk) (__nldbl___sprintf_chk, __nldbl___swprintf_chk) (__nldbl___vfprintf_chk, __nldbl___vfwprintf_chk) (__nldbl___vprintf_chk, __nldbl___vsnprintf_chk) (__nldbl___vsprintf_chk, __nldbl___vswprintf_chk) (__nldbl___vwprintf_chk, __nldbl___wprintf_chk) (__nldbl___vasprintf_chk, __nldbl___asprintf_chk) (__nldbl___vdprintf_chk, __nldbl___dprintf_chk) (__nldbl___obstack_vprintf_chk, __nldbl___obstack_printf_chk): Likewise, and also pass PRINTF_FORTIFY when appropriate. (__nldbl_syslog, __nldbl_vsyslog): Directly call __vsyslog_internal, passing PRINTF_LDBL_IS_DBL. (__nldbl_syslog_chk): Likewise, and also pass PRINTF_FORTIFY when appropriate. (__nldbl_vsyslog_chk): Likewise, and also pass PRINTF_FORTIFY when appropriate. Remove libc_hidden_proto and libc_hidden_def.
* Add __v*printf_internal with flags arguments.Zack Weinberg2018-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. 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. And as it turns out there were hardly any internal callers. _IO_vsprintf *is* exported, so that one sticks around. * 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. (LDBL_IS_DBL, DO_FORTIFY): New macros. Throughout, use LDBL_IS_DBL instead of __ldbl_is_dbl, and DO_FORTIFY instead of checking _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. * 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 for _IO_vfprintf. Remove declaration of _IO_vfwprintf. * libio/iolibio.h: Remove libc_hidden_proto for _IO_vsprintf. Remove declarations of _IO_vswprintf, _IO_obstack_printf, and _IO_obstack_printf. * include/stdio.h: Add libc_hidden_proto for __vsnprintf and prototype for __vasprintf. * argp/argp-fmtstream.c: Use __vsnprintf, not _IO_vsnprintf. * argp/argp-help.c: Use __vasprintf, not _IO_vasprintf. * argp/argp-namefrob.c: Update to match.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-2/+1
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): New function.Ulrich Drepper2007-07-191-2/+2
| | | | | | | | | | | | | | | * debug/vfwprintf_chk.c (__vfwprintf_chk): Use _IO_acquire_lock_clear_flags2 instead of _IO_acquire_lock. * debug/vprintf_chk.c (__vprintf_chk): Likewise. * debug/vwprintf_chk.c (__vwprintf_chk): Likewise. * debug/vfprintf_chk.c (__vfprintf_chk): Likewise. * debug/fwprintf_chk.c (__fwprintf_chk): Likewise. * debug/printf_chk.c (__printf_chk): Likewise. * debug/fprintf_chk.c (__fprintf_chk): Likewise. * debug/wprintf_chk.c (__wprintf_chk): Likewise. * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2): Define.
* * wcsmbs/bits/wchar2.h: New file.Ulrich Drepper2005-07-151-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/bits/wchar2.h: New file. * wcsmbs/wchar.h: Include <bits/wchar2.h> if fortification is requested. * wcsmbs/wcsncpy.c: Add __wcsncpy alias. * string/bits/string3.h: Add fortified stpncpy definitions. * sysdeps/generic/stpncpy_chk.c: New file. * libio/vswprintf.c: Move _IO_wstrnfile definition to strfile.h. Export _IO_wstrn_jumps. * libio/strfile.h: Define _IO_wstrnfile and declare _IO_wstrn_jumps. * include/wchar.h: Declare __wcsncpy and __vswprintf_chk. * debug/fgetws_chk.c: New file. * debug/fgetws_u_chk.c: New file. * debug/fwprintf_chk.c: New file. * debug/swprintf_chk.c: New file. * debug/vfwprintf_chk.c: New file. * debug/vswprintf_chk.c: New file. * debug/vwprintf_chk.c: New file. * debug/wcpcpy_chk.c: New file. * debug/wcpncpy_chk.c: New file. * debug/wcscat_chk.c: New file. * debug/wcscpy_chk.c: New file. * debug/wcsncat_chk.c: New file. * debug/wcsncpy_chk.c: New file. * debug/wmemcpy_chk.c: New file. * debug/wmemmove_chk.c: New file. * debug/wmempcpy_chk.c: New file. * debug/wmemset_chk.c: New file. * debug/wprintf_chk.c: New file. * debug/tst-chk1.c: Add tests for new functions. * debug/Versions: Export new functions. * debug/Makefile (routines): Add new functions.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-46/+0
|
* 2.5-18.1Jakub Jelinek2007-07-121-0/+46