* stabsread.c (get_substring): Declare second arg as int.
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index 9070a0581685ae91deacf2f9c641043e54888543..03691ef709459ef692843bc67b4bfdca17fccb64 100644 (file)
@@ -38,7 +38,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 %{
 
 #include "defs.h"
-#include <string.h>
+#include "gdb_string.h"
+#include <ctype.h>
 #include "expression.h"
 #include "value.h"
 #include "parser-defs.h"
@@ -942,7 +943,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).  */
 
This page took 0.023709 seconds and 4 git commands to generate.