This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: Fix various problems with "printf" and warnings
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 21 Jan 2006 23:56:17 -0500
- Subject: Re: RFC: Fix various problems with "printf" and warnings
- References: <20060122003117.GC8088@nevyn.them.org> <uhd7wq42y.fsf@gnu.org>
On Sun, Jan 22, 2006 at 06:28:05AM +0200, Eli Zaretskii wrote:
> > Date: Sat, 21 Jan 2006 19:31:17 -0500
> > From: Daniel Jacobowitz <drow@false.org>
> >
> > + else if (*f == ' ')
> > + seen_space = 1;
> > + else if (*f == ' ')
> > + seen_plus = 1;
>
> A typo in the second "else if" clause.
Oops. Thank you.
> > + 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.
Now, if the target has a long double with a greater precision (or just
different precision, due to different format) than the host long
double, this will lose out a bit. But this isn't the only place in GDB
that will lose in that case.
--
Daniel Jacobowitz
CodeSourcery