From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22853 invoked by alias); 1 Feb 2008 15:55:45 -0000 Received: (qmail 22845 invoked by uid 22791); 1 Feb 2008 15:55:45 -0000 X-Spam-Check-By: sourceware.org Received: from ics.u-strasbg.fr (HELO ics.u-strasbg.fr) (130.79.112.250) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 01 Feb 2008 15:55:18 +0000 Received: from ICSMULLER (laocoon.u-strasbg.fr [130.79.112.72]) by ics.u-strasbg.fr (Postfix) with ESMTP id 70D7018701F; Fri, 1 Feb 2008 17:01:36 +0100 (CET) From: "Pierre Muller" To: "'Daniel Jacobowitz'" Cc: References: <000c01c861c5$149352b0$3db9f810$@u-strasbg.fr> <20080131222641.GD6715@caradoc.them.org> <003801c864a4$1866bee0$49343ca0$@u-strasbg.fr> <20080201141546.GA28371@caradoc.them.org> In-Reply-To: <20080201141546.GA28371@caradoc.them.org> Subject: RE: [Patch] p-exp.y: Typecast left operand of BINOP_DIV to long double Date: Fri, 01 Feb 2008 15:55:00 -0000 Message-ID: <008301c864ea$d6387c10$82a97430$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00017.txt.bz2 > -----Original Message----- > From: 'Daniel Jacobowitz' [mailto:drow@false.org] > Sent: Friday, February 01, 2008 3:16 PM > To: Pierre Muller > Cc: gdb-patches@sourceware.org > Subject: Re: [Patch] p-exp.y: Typecast left operand of BINOP_DIV to > long double > > On Fri, Feb 01, 2008 at 08:28:52AM +0100, Pierre Muller wrote: > > > It looks OK to me. Does the type of the left operand completely > > > determine the type of the operation, or do you need to worry about > the > > > type of the right-hand exp too before you cast? > > > > But how can I do this? > > It is still not really clear to me how I can > > insert a typecast to left operand, only after > > right operand has been parsed. > > It would indeed be better to only do the typecast if both are > integral > > types. > > You could cast the right operand instead; wouldn't that work? Once the patch from Doug http://sourceware.org/ml/gdb-patches/2008-01/msg00802.html is committed, yes. Until then the ptyp '34 / 3' would still give the wrong type, that is the reason why I chose to typecast the left operand instead of the right one. As that patch is likely not to be integrated in 6.8, I thought that it would be better to have also a correct output for ptype command. Pierre Muller