From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2285 invoked by alias); 22 Jan 2006 19:10:37 -0000 Received: (qmail 2277 invoked by uid 22791); 22 Jan 2006 19:10:36 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 22 Jan 2006 19:10:35 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-250-244.inter.net.il [83.130.250.244]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id DKK57234 (AUTH halo1); Sun, 22 Jan 2006 21:10:31 +0200 (IST) Date: Sun, 22 Jan 2006 19:10:00 -0000 Message-Id: From: Eli Zaretskii To: gdb-patches@sourceware.org In-reply-to: <20060122045617.GA14165@nevyn.them.org> (message from Daniel Jacobowitz on Sat, 21 Jan 2006 23:56:17 -0500) Subject: Re: RFC: Fix various problems with "printf" and warnings Reply-to: Eli Zaretskii References: <20060122003117.GC8088@nevyn.them.org> <20060122045617.GA14165@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00299.txt.bz2 > Date: Sat, 21 Jan 2006 23:56:17 -0500 > From: Daniel Jacobowitz > 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.