[Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions
Dominique d'Humières
dominiq@lps.ens.fr
Thu Jul 12 11:17:00 GMT 2018
Hi Janus,
> after the dust of the heated discussion around this PR has settled a
> bit, here is another attempt to implement at least some basic warnings
> about compiler-dependent behavior concerning the short-circuiting of
> logical expressions. …
IMO your patch is missing the only point I agree with you on this issue, i.e.,
the short-circuit evaluation and the related portability issues should be
documented.
With your patch what happens if check() is an external function?
Your patch is focusing on pr85599 and ignore pr57160.
What to do with
if(x>0 .and. sort(x)<10.0*log(x)) …
which is not portable to compilers computing the two expressions?
Cheers,
Dominique
More information about the Fortran
mailing list