From: JB on
On 2010-02-15, Berfux <berfux(a)gmail.com> wrote:
> Iin the following compilers (Sun, Intel, gfortran) I could not find
> such an option. Does it exist ? If not, do you think there is a good
> reason ?

gfortran has the -Wconversion option, about which the manual says
"Warn about implicit conversions between different types. ". Using
this option with the program you provided results in

diagnostic-conversion.f90:12.6:

x = z
1
Warning: Conversion from COMPLEX(4) to REAL(4) at (1)
diagnostic-conversion.f90:15.6:

z = x
1
Warning: Conversion from REAL(4) to COMPLEX(4) at (1)
diagnostic-conversion.f90:18.6:

i = x
1
Warning: Conversion from REAL(4) to INTEGER(4) at (1)

By using the standard type conversion intrinsics REAL, CMPLX, and INT
appropriately the above messages can be suppressed.


--
JB