aboutsummaryrefslogtreecommitdiffstats
path: root/libio/libioP.h
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2018-03-07 09:08:49 -0500
committerZack Weinberg <zackw@panix.com>2018-05-31 21:28:17 -0400
commit99dc7e331834f942d72c017782b8c058414cc70d (patch)
tree32dc4a6b39da3297e1f6a60f31c38f14fac92e73 /libio/libioP.h
parent665a5665924b44f5de0938e4c1a077d5bcfee061 (diff)
downloadtermbaud-zack/remove-mode-bits.tar.gz
termbaud-zack/remove-mode-bits.tar.xz
termbaud-zack/remove-mode-bits.zip
Use PRINTF_LDBL_IS_DBL instead of __ldbl_is_dbl.zack/remove-mode-bits
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.
Diffstat (limited to 'libio/libioP.h')
-rw-r--r--libio/libioP.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/libio/libioP.h b/libio/libioP.h
index 17eda383d38..07b60e3e268 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -672,8 +672,13 @@ extern int __vdprintf_internal (int d, const char *format, va_list ap,
extern int __obstack_vprintf_internal (struct obstack *ob, const char *fmt,
va_list ap, unsigned int mode_flags);
-extern int __vsprintf_internal (char *string, const char *format, va_list ap,
+/* Note: __vsprintf_internal, unlike vsprintf, does take a maxlen argument,
+ because it's called by both vsprintf and vsprintf_chk. If maxlen is
+ not set to -1, overrunning the buffer will cause a prompt crash. */
+extern int __vsprintf_internal (char *string, size_t maxlen,
+ const char *format, va_list ap,
unsigned int mode_flags);
+
extern int __vsnprintf_internal (char *string, size_t maxlen,
const char *format, va_list ap,
unsigned int mode_flags);
@@ -788,26 +793,10 @@ _IO_acquire_lock_fct (FILE **p)
_IO_funlockfile (fp);
}
-static inline void
-__attribute__ ((__always_inline__))
-_IO_acquire_lock_clear_flags2_fct (FILE **p)
-{
- FILE *fp = *p;
- fp->_flags2 &= ~(_IO_FLAGS2_FORTIFY);
- if ((fp->_flags & _IO_USER_LOCK) == 0)
- _IO_funlockfile (fp);
-}
-
#if !defined _IO_MTSAFE_IO && IS_IN (libc)
# define _IO_acquire_lock(_fp) \
- do { \
- FILE *_IO_acquire_lock_file = NULL
-# define _IO_acquire_lock_clear_flags2(_fp) \
- do { \
- FILE *_IO_acquire_lock_file = (_fp)
+ do {
# define _IO_release_lock(_fp) \
- if (_IO_acquire_lock_file != NULL) \
- _IO_acquire_lock_file->_flags2 &= ~(_IO_FLAGS2_FORTIFY); \
} while (0)
#endif