This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [Patch] p-exp.y: Typecast left operand of BINOP_DIV to long double



> -----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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]