Re: [BUG] BINOP_DIV and ptyp command

Daniel Jacobowitz
2008-01-29T16:37:23Z

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