This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [BUG] BINOP_DIV and ptyp command
- From: "Doug Evans" <dje at google dot com>
- To: "Pierre Muller" <muller at ics dot u-strasbg dot fr>
- Cc: gdb at sourceware dot org
- Date: Mon, 28 Jan 2008 20:55:46 -0800
- Subject: Re: [BUG] BINOP_DIV and ptyp command
- References: <002301c85c12$a73a4640$f5aed2c0$@u-strasbg.fr>
[for completeness sake', I sent a proposed patch to the gdb-patches list]
http://sourceware.org/ml/gdb-patches/2008-01/msg00664.html
On Jan 21, 2008 1:47 AM, Pierre Muller <muller@ics.u-strasbg.fr> wrote:
> The ptyp command returns inconsistent types for the c '/'(BINOP_DIV)
> operator:
>
> (gdb) ptyp 3 / 2
> type = int
> (gdb) p 3 / 2
> $4 = 1
> (gdb) ptyp 3.0 / 2
> type = double
> (gdb) p 3.0 / 2
> $5 = 1.5
> (gdb) ptyp 3 / 2.0
> type = int
> (gdb) p 3 / 2.0
> $6 = 1.5
>
> I suspect that this bug is due to the fact that
> the type of this binary operator is inferred from the
> left node type, but this is wrong in the case '3 / 2.0'
>
>
> Pierre Muller
>
>
>