Re: RFC: Fix various problems with "printf" and warnings

Eli Zaretskii
2006-01-22T19:10:37Z

> Date: Sat, 21 Jan 2006 23:56:17 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org
>
> > > + case long_double_arg:
> > > +#ifdef HAVE_LONG_DOUBLE
> > > + {
> > > + long double val = value_as_double (val_args[i]);
> > > + printf_filtered (current_substring, val);
> >
> > Won't `value_as_double' lose accuracy here, possibly catastrophically
> > (i.e., a non-zero number coming out as zero, etc.)?
>
> Not usually. value_as_double is somewhat misnamed; it returns a
> DOUBLEST, which will be long double if the host supports long double.

Ah, okay, thanks, I forgot about that.

Perhaps we should rename that function some day. It is IMHO a bad
mantra for a function name to lie about what it does.
`value_as_doublest' sounds like a better name.