Ping**(4./7.) patch, fortran] Warn about constant integer divisions

Thomas Koenig tkoenig@netcologne.de
Tue Jun 30 16:30:00 GMT 2015


Ping**(4./7.), NOT Ping**(4/7), which would always evalate to one
and which this patch would warn about :-)

> Am 24.06.2015 um 22:21 schrieb Harald Anlauf:
> 
>> A truncation warning is pointless for expressions like 4/2 or
>> n*(n+1)/2 with n an integer parameter.
> 
> To get more of a consensus, this version of the patch adds a
> new warning option, to be included with -Wall, called
> -Winteger-division, and only warns for when something is
> truncated.
> 
> So, no warning with n*(n+1)/2, but a warning with 3/5.
> 
> So, OK for trunk?




More information about the Fortran mailing list