diff --git a/gdb/dfp.c b/gdb/dfp.c index bf82114..4915543 100644 --- a/gdb/dfp.c +++ b/gdb/dfp.c @@ -237,7 +237,7 @@ decimal_from_floating (struct value *from, gdb_byte *to, int len) char *buffer; int ret; - ret = asprintf (&buffer, "%.30Lg", value_as_double (from)); + ret = asprintf (&buffer, "%.30"DOUBLEST_PRINT_FORMAT, value_as_double (from)); if (ret < 0) error (_("Error in memory allocation for conversion to decimal float.")); diff --git a/gdb/doublest.h b/gdb/doublest.h index f3ab619..52e28df 100644 --- a/gdb/doublest.h +++ b/gdb/doublest.h @@ -49,11 +49,11 @@ struct floatformat; #if (defined HAVE_LONG_DOUBLE && defined PRINTF_HAS_LONG_DOUBLE \ && defined SCANF_HAS_LONG_DOUBLE) typedef long double DOUBLEST; -# define DOUBLEST_PRINT_FORMAT "%Lg" +# define DOUBLEST_PRINT_FORMAT "Lg" # define DOUBLEST_SCAN_FORMAT "%Lg" #else typedef double DOUBLEST; -# define DOUBLEST_PRINT_FORMAT "%g" +# define DOUBLEST_PRINT_FORMAT "g" # define DOUBLEST_SCAN_FORMAT "%lg" /* If we can't scan or print long double, we don't want to use it anywhere. */