This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]