Bruno Haible <bruno <at> clisp.org> writes: > > The floating-point output code crashed due to an abort() for values with > large exponents (> 1e34 for 'double'). This fixes it. > > 2007-11-04 Bruno Haible <bruno <at> clisp.org> > > * lib/vasnprintf.c (scale10_round_decimal_decoded): Fix shift loop.
Something's still fishy. Now I'm getting aborts for test-vasprintf-posix.c on cygwin, with the following sequence of instructions in vasnprintf.c: Breakpoint 1, test_function (my_asprintf=0x413052 <my_asprintf>) at ../../tests/test-vasprintf-posix.c:173 173 int retval = my_asprintf (&result, "%a %d", 3.1416015625, 33, 44, 55); 2690 if (type == TYPE_LONGDOUBLE) (gdb) 3055 double arg = a.arg[dp->arg_index].a.a_double; (gdb) 3057 if (isnan (arg)) (gdb) 3070 int sign = 0; (gdb) 3072 if (signbit (arg)) /* arg < 0.0 or negative zero */ (gdb) 3078 if (sign < 0) (gdb) 3080 else if (flags & FLAG_SHOWSIGN) (gdb) 3082 else if (flags & FLAG_SPACE) (gdb) 3085 if (arg > 0.0 && arg + arg == arg) (gdb) 3099 pad_ptr = p; (gdb) 3101 if (dp->conversion == 'f' || dp->conversion == 'F') (gdb) 3136 else if (dp->conversion == 'e' || dp- >conversion == 'E') (gdb) 3246 else if (dp->conversion == 'g' || dp- >conversion == 'G') (gdb) 3421 abort (); (gdb) -- Eric Blake