Re: [patch, fortran] Warn about integer**(negative integer)

2017-01-23 Thread Thomas Koenig
Hi FX, The idea seems reasonable, but I am not sure about the wording (“truncated” in particular). “Integer exponentiation truncated to constant 0”? Why not “Negative integer exponent has result value zero”? Other than that, OK to commit. You're right, the error message was a bit strange.

Re: [patch, fortran] Warn about integer**(negative integer)

2017-01-22 Thread FX
> 2017-01-22 Thomas Koenig > >* arith.c (arith_power): If simplifying integer power expression >to zero, warn if -Winteger-division is given. > > 2017-01-22 Thomas Koenig > >* gfortran.dg/integer_exponentiation_7.f90: New test. The idea seems reasonable, but I am

[patch, fortran] Warn about integer**(negative integer)

2017-01-22 Thread Thomas Koenig
Hello world, a reacent thread on c.l.f showed another common error - expecting 10**(-3) to expect something different from zero. The attached patch warns about this result if -Winteger-division is active. Why -Winteger-division? Two reasons: First, 10**(-3) ist just a shorthand for integer di