]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix conditions on checking versions of dprintf (bug 13775).
authorJoseph Myers <joseph@codesourcery.com>
Thu, 3 May 2012 18:42:37 +0000 (18:42 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 3 May 2012 18:42:37 +0000 (18:42 +0000)
ChangeLog
NEWS
libio/bits/stdio-ldbl.h
libio/bits/stdio2.h

index db2f8bd29c311948d4fecbe3e25f506fa000aef0..fa804a5a0bf9ce8d9f18f2a16ce6d19e4bdee418 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2012-05-03  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #13775]
+       * libio/bits/stdio-ldbl.h [__USE_XOPEN2K8] (__dprintf_chk):
+       Redirect under this condition.
+       [__USE_XOPEN2K8] (__vdprintf_chk): Likewise.
+       [__USE_GNU] (__dprintf_chk): Not under this condition.
+       [__USE_GNU] (__vdprintf_chk): Likewise.
+       * libio/bits/stdio2.h [__USE_XOPEN2K8] (__dprintf_chk): Declare
+       under this condition.
+       [__USE_XOPEN2K8] (__vdprintf_chk): Likewise.
+       [__USE_XOPEN2K8] (dprintf): Define under this condition.
+       [__USE_XOPEN2K8] (vdprintf): Likewise.
+       [__USE_GNU] (__dprintf_chk): Not under this condition.
+       [__USE_GNU] (__vdprintf_chk): Likewise.
+       [__USE_GNU] (dprintf): Likewise.
+       [__USE_GNU] (vdprintf): Likewise.
+
 2012-05-03  Roland McGrath  <roland@hack.frob.com>
 
        * elf/Makefile (common-generated): Set this instead of generated for
diff --git a/NEWS b/NEWS
index 12045f64149eb75637a02d3b5277826dbc40ec8e..218319712f012b1c4524a33b5e0f7eabc9e02599 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,12 +18,12 @@ Version 2.16
   12047, 12340, 13058, 13525, 13526, 13527, 13528, 13529, 13530, 13531,
   13532, 13533, 13547, 13551, 13552, 13553, 13555, 13559, 13566, 13583,
   13592, 13618, 13637, 13656, 13658, 13673, 13691, 13695, 13704, 13705,
-  13706, 13726, 13738, 13739, 13758, 13760, 13761, 13786, 13792, 13806,
-  13824, 13840, 13841, 13844, 13846, 13851, 13852, 13854, 13871, 13872,
-  13873, 13879, 13883, 13886, 13892, 13895, 13908, 13910, 13911, 13912,
-  13913, 13915, 13916, 13917, 13918, 13919, 13920, 13921, 13924, 13926,
-  13927, 13928, 13938, 13941, 13942, 13963, 13967, 13970, 13973, 14027,
-  14033, 14034, 14040, 14055
+  13706, 13726, 13738, 13739, 13758, 13760, 13761, 13775, 13786, 13792,
+  13806, 13824, 13840, 13841, 13844, 13846, 13851, 13852, 13854, 13871,
+  13872, 13873, 13879, 13883, 13886, 13892, 13895, 13908, 13910, 13911,
+  13912, 13913, 13915, 13916, 13917, 13918, 13919, 13920, 13921, 13924,
+  13926, 13927, 13928, 13938, 13941, 13942, 13963, 13967, 13970, 13973,
+  14027, 14033, 14034, 14040, 14055
 
 * ISO C11 support:
 
index 3cc6ec416dcf301198bf2bf5df8cf6612926bebb..4ee043e42c49b36d566c36ee0cbb031248e32e4e 100644 (file)
@@ -87,11 +87,13 @@ __LDBL_REDIR_DECL (__fprintf_chk)
 __LDBL_REDIR_DECL (__printf_chk)
 __LDBL_REDIR_DECL (__vfprintf_chk)
 __LDBL_REDIR_DECL (__vprintf_chk)
+#  ifdef __USE_XOPEN2K8
+__LDBL_REDIR_DECL (__dprintf_chk)
+__LDBL_REDIR_DECL (__vdprintf_chk)
+#  endif
 #  ifdef __USE_GNU
 __LDBL_REDIR_DECL (__asprintf_chk)
 __LDBL_REDIR_DECL (__vasprintf_chk)
-__LDBL_REDIR_DECL (__dprintf_chk)
-__LDBL_REDIR_DECL (__vdprintf_chk)
 __LDBL_REDIR_DECL (__obstack_printf_chk)
 __LDBL_REDIR_DECL (__obstack_vprintf_chk)
 #  endif
index 2aca88d02993ca2a33725107891d3ae5818563da..7383604b30340376d83376838263132914e43bd2 100644 (file)
@@ -127,6 +127,32 @@ vfprintf (FILE *__restrict __stream,
   return __vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
 }
 
+# ifdef __USE_XOPEN2K8
+extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
+                         ...) __attribute__ ((__format__ (__printf__, 3, 4)));
+extern int __vdprintf_chk (int __fd, int __flag,
+                          const char *__restrict __fmt, _G_va_list __arg)
+     __attribute__ ((__format__ (__printf__, 3, 0)));
+
+#  ifdef __va_arg_pack
+__fortify_function int
+dprintf (int __fd, const char *__restrict __fmt, ...)
+{
+  return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
+                       __va_arg_pack ());
+}
+#  elif !defined __cplusplus
+#   define dprintf(fd, ...) \
+  __dprintf_chk (fd, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+#  endif
+
+__fortify_function int
+vdprintf (int __fd, const char *__restrict __fmt, _G_va_list __ap)
+{
+  return __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
+# endif
+
 # ifdef __USE_GNU
 
 extern int __asprintf_chk (char **__restrict __ptr, int __flag,
@@ -135,11 +161,6 @@ extern int __asprintf_chk (char **__restrict __ptr, int __flag,
 extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
                            const char *__restrict __fmt, _G_va_list __arg)
      __THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur;
-extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
-                         ...) __attribute__ ((__format__ (__printf__, 3, 4)));
-extern int __vdprintf_chk (int __fd, int __flag,
-                          const char *__restrict __fmt, _G_va_list __arg)
-     __attribute__ ((__format__ (__printf__, 3, 0)));
 extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
                                 int __flag, const char *__restrict __format,
                                 ...)
@@ -166,13 +187,6 @@ __NTH (__asprintf (char **__restrict __ptr, const char *__restrict __fmt,
                         __va_arg_pack ());
 }
 
-__fortify_function int
-dprintf (int __fd, const char *__restrict __fmt, ...)
-{
-  return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
-                       __va_arg_pack ());
-}
-
 __fortify_function int
 __NTH (obstack_printf (struct obstack *__restrict __obstack,
                       const char *__restrict __fmt, ...))
@@ -185,8 +199,6 @@ __NTH (obstack_printf (struct obstack *__restrict __obstack,
   __asprintf_chk (ptr, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
 #   define __asprintf(ptr, ...) \
   __asprintf_chk (ptr, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
-#   define dprintf(fd, ...) \
-  __dprintf_chk (fd, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
 #   define obstack_printf(obstack, ...) \
   __obstack_printf_chk (obstack, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
 #  endif
@@ -198,12 +210,6 @@ __NTH (vasprintf (char **__restrict __ptr, const char *__restrict __fmt,
   return __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
 }
 
-__fortify_function int
-vdprintf (int __fd, const char *__restrict __fmt, _G_va_list __ap)
-{
-  return __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
-}
-
 __fortify_function int
 __NTH (obstack_vprintf (struct obstack *__restrict __obstack,
                        const char *__restrict __fmt, _G_va_list __ap))