From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5410 invoked by alias); 17 Oct 2006 14:10:25 -0000 Received: (qmail 5396 invoked by uid 22791); 17 Oct 2006 14:10:23 -0000 X-Spam-Check-By: sourceware.org Received: from lon-del-04.spheriq.net (HELO lon-del-04.spheriq.net) (195.46.50.101) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Oct 2006 14:10:09 +0000 Received: from lon-out-01.spheriq.net ([195.46.50.129]) by lon-del-04.spheriq.net with ESMTP id k9HE9Um6020873 for ; Tue, 17 Oct 2006 14:09:41 GMT Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-01.spheriq.net with ESMTP id k9HE9Uaf027891 for ; Tue, 17 Oct 2006 14:09:30 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-01.spheriq.net with ESMTP id k9HE9QVN002660 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Tue, 17 Oct 2006 14:09:29 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1FAB3DA52 for ; Tue, 17 Oct 2006 14:09:05 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 416CC47478 for ; Tue, 17 Oct 2006 14:09:04 +0000 (GMT) Received: from [164.129.15.13] (bri1043.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CIC68426 (AUTH stubbsa); Tue, 17 Oct 2006 15:09:02 +0100 (BST) Message-ID: <4534E3FF.9030505@st.com> Date: Tue, 17 Oct 2006 14:10:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: GDB List Subject: Re: GDB printf command References: <4534C695.2050206@st.com> <20061017132426.GA28323@nevyn.them.org> In-Reply-To: <20061017132426.GA28323@nevyn.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00123.txt.bz2 Daniel Jacobowitz wrote: >> Specifically '%lf' is not permitted. This used to work and is permitted >> by both C90 and C99. > > I don't remember what reference I used, but in C99 I see that this is > deliberately ignored and the same as %f. Seems dumb to me, but there > you go. Sorry, I opened my C90 standard at the wrong page and read that '%lf' is accepted for scanf by mistake - C90 says it is undefined for printf. C99 however ignores it, as you say, but that is not 'bad' as defined by GDB at present. It should be either passed through or converted to '%f'. > It seems to me, as I wrote earlier, that the right thing to do would be > to change it to work on target types rather than host types. It also > seems to me that the right way to do this would be to reuse the printf > format string parser from gnulib. We will have to map target types on > to host types to get that to work, which will be a little hokey, but it > should be doable for all interesting cases. The expression parser/evaluator must use host types at some level. Does this not have similar horrors hidden away? If this can convert target types to host types (of at least the same precision) can the printf not be implemented with the same mapping somehow? Andrew