This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch] p-exp.y: Typecast left operand of BINOP_DIV to long double
- From: 'Daniel Jacobowitz' <drow at false dot org>
- To: Pierre Muller <muller at ics dot u-strasbg dot fr>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 1 Feb 2008 09:15:46 -0500
- Subject: Re: [Patch] p-exp.y: Typecast left operand of BINOP_DIV to long double
- References: <000c01c861c5$149352b0$3db9f810$@u-strasbg.fr> <20080131222641.GD6715@caradoc.them.org> <003801c864a4$1866bee0$49343ca0$@u-strasbg.fr>
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?
--
Daniel Jacobowitz
CodeSourcery