aboutsummaryrefslogtreecommitdiff
path: root/libquadmath
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-02-14 19:49:07 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-02-14 19:49:07 +0100
commit12967872c546b0da18b13e4b1a5b1f5d3f6cee07 (patch)
tree3f066b7988902ded33b9c98f373b1a5fdbcec7d2 /libquadmath
parentce2ab24c22e3bc5a8a2993ef7de3fea3db7d4309 (diff)
downloadgcc-12967872c546b0da18b13e4b1a5b1f5d3f6cee07.zip
gcc-12967872c546b0da18b13e4b1a5b1f5d3f6cee07.tar.gz
gcc-12967872c546b0da18b13e4b1a5b1f5d3f6cee07.tar.bz2
re PR bootstrap/47736 (libquadmath build broken with pre-2.10 glibc)
PR bootstrap/47736 * configure.ac (HAVE_PRINTF_HOOKS): Test if printf_info struct has user field. * printf/quadmath-printf.c (quadmath_snprintf): Clear whole info field instead of setting individual fields to 0. Don't set info.user to -1. * configure: Regenerated. From-SVN: r170147
Diffstat (limited to 'libquadmath')
-rw-r--r--libquadmath/ChangeLog8
-rwxr-xr-xlibquadmath/configure1
-rw-r--r--libquadmath/configure.ac1
-rw-r--r--libquadmath/printf/quadmath-printf.c13
4 files changed, 17 insertions, 6 deletions
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index 45f382d..c451c8f 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,5 +1,13 @@
2011-02-14 Jakub Jelinek <jakub@redhat.com>
+ PR bootstrap/47736
+ * configure.ac (HAVE_PRINTF_HOOKS): Test if printf_info struct has
+ user field.
+ * printf/quadmath-printf.c (quadmath_snprintf): Clear whole info
+ field instead of setting individual fields to 0. Don't set info.user
+ to -1.
+ * configure: Regenerated.
+
* configure.ac (HAVE_HIDDEN_VISIBILITY): Test with -Werror in CFLAGS.
* printf/printf_fp.c: Don't include <alloca.h>.
* printf/quadmath-printf.h (_itoa): Redefine to __quadmath_itoa.
diff --git a/libquadmath/configure b/libquadmath/configure
index fa209a6..47021ff 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -12555,6 +12555,7 @@ main ()
int pa_flt128 = register_printf_type (flt128_va);
int mod_Q = register_printf_modifier (L"Q");
int res = register_printf_specifier ('f', flt128_printf_fp, flt128_ais);
+struct printf_info info = { .user = -1 };
;
return 0;
diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac
index 9a0f464..04a6e4a 100644
--- a/libquadmath/configure.ac
+++ b/libquadmath/configure.ac
@@ -241,6 +241,7 @@ extern int flt128_printf_fp (FILE *, const struct printf_info *, const void *con
int pa_flt128 = register_printf_type (flt128_va);
int mod_Q = register_printf_modifier (L"Q");
int res = register_printf_specifier ('f', flt128_printf_fp, flt128_ais);
+struct printf_info info = { .user = -1 };
],
[quadmath_printf_hooks=yes],[quadmath_printf_hooks=no])
AC_MSG_RESULT($quadmath_printf_hooks)
diff --git a/libquadmath/printf/quadmath-printf.c b/libquadmath/printf/quadmath-printf.c
index 6d17200..4f5305e 100644
--- a/libquadmath/printf/quadmath-printf.c
+++ b/libquadmath/printf/quadmath-printf.c
@@ -121,15 +121,16 @@ quadmath_snprintf (char *str, size_t size, const char *format, ...)
return -1;
/* Clear information structure. */
- info.alt = 0;
+ memset (&info, '\0', sizeof info);
+ /* info.alt = 0;
info.space = 0;
info.left = 0;
info.showsign = 0;
info.group = 0;
info.i18n = 0;
- info.extra = 0;
+ info.extra = 0; */
info.pad = ' ';
- info.wide = 0;
+ /* info.wide = 0; */
/* Check for spec modifiers. */
do
@@ -180,7 +181,7 @@ quadmath_snprintf (char *str, size_t size, const char *format, ...)
va_start (ap, format);
/* Get the field width. */
- info.width = 0;
+ /* info.width = 0; */
if (*format == '*')
{
/* The field width is given in an argument.
@@ -213,11 +214,11 @@ quadmath_snprintf (char *str, size_t size, const char *format, ...)
}
/* Check for type modifiers. */
- info.is_long_double = 0;
+ /* info.is_long_double = 0;
info.is_short = 0;
info.is_long = 0;
info.is_char = 0;
- info.user = -1;
+ info.user = 0; */
/* We require Q modifier. */
if (*format++ != 'Q')