This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] Warn about integer**(negative integer)
- From: FX <fxcoudert at gmail dot com>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 22 Jan 2017 22:26:41 +0100
- Subject: Re: [patch, fortran] Warn about integer**(negative integer)
- Authentication-results: sourceware.org; auth=none
- References: <f1212af8-c5a4-ae0e-247e-df273784a991@netcologne.de>
> 2017-01-22 Thomas Koenig <tkoenig@netcologne.de>
>
> * arith.c (arith_power): If simplifying integer power expression
> to zero, warn if -Winteger-division is given.
>
> 2017-01-22 Thomas Koenig <tkoenig@netcologne.de>
>
> * gfortran.dg/integer_exponentiation_7.f90: New test.
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.
FX