diff options
author | Fred Fish <fnf@specifix.com> | 1996-03-31 01:04:37 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1996-03-31 01:04:37 +0000 |
commit | 07b77f5ca4f7a43b63646c28d06e2261394cd78c (patch) | |
tree | e9b88d67f89b406ad16f44ad308af4d98ad6c9ba /gdb/c-exp.y | |
parent | 452ad97eb9e9a08f0e46a8608a2b7b1b5eaf5e18 (diff) | |
download | gdb-07b77f5ca4f7a43b63646c28d06e2261394cd78c.zip gdb-07b77f5ca4f7a43b63646c28d06e2261394cd78c.tar.gz gdb-07b77f5ca4f7a43b63646c28d06e2261394cd78c.tar.bz2 |
* configure.in: Check whether printf family supports printing
long doubles or not and define PRINTF_HAS_LONG_DOUBLE if so.
* acconfig.h: Provide default undef for PRINTF_HAS_LONG_DOUBLE.
* configure: Regenerate.
* valprint.c (print_floating): Use PRINTF_HAS_LONG_DOUBLE.
* c-exp.y (parse_number): Use PRINTF_HAS_LONG_DOUBLE.
* configure.in: Fix have_gregset and have_fpregset autoconf
variable names so that they match the pattern required to
cache them.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 9070a05..3c7c690 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -942,7 +942,18 @@ parse_number (p, len, parsed_float, putithere) else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) sscanf (p, "%lg", &putithere->typed_val_float.dval); else - sscanf (p, "%Lg", &putithere->typed_val_float.dval); + { +#ifdef PRINTF_HAS_LONG_DOUBLE + sscanf (p, "%Lg", &putithere->typed_val_float.dval); +#else + /* Scan it into a double, then assign it to the long double. + This at least wins with values representable in the range + of doubles. */ + double temp; + sscanf (p, "%lg", &temp); + putithere->typed_val_float.dval = temp; +#endif + } /* See if it has `f' or `l' suffix (float or long double). */ |