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: [BUG] BINOP_DIV and ptyp command


On Tue, Jan 29, 2008 at 07:48:00AM -0800, Doug Evans wrote:
> As I say, if the intent is to avoid the call to error(), I'd expect to
> see tests for 1 >> 3.0, etc.  That will throw error ("Integer-only
> operation on floating point number").

That's not a value-dependent error.  1 / 0 has a sensible type (it's
an int), but no sensible value; 1 >> 3.0 has no sensible type (it's a
syntax error).

I think of it this way:

drow@caradoc:~% cat a.c
int a = sizeof (1/0);
int b = sizeof (1 >> 3.0);
drow@caradoc:~% gcc -Wall -c a.c
a.c:2: error: invalid operands to binary >>

-- 
Daniel Jacobowitz
CodeSourcery


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