gfortran allows variable to be declared twice

Vivek Rao via fortran fortran@gcc.gnu.org
Tue May 2 16:26:00 GMT 2017


The code

function foo(fp, m) result(ft)real   , intent(in) :: fp(m)
integer, intent(in) :: m
integer             :: m
ft = 0.0

end function foo

declares "m" twice, but GNU Fortran (GCC) 7.0.1 20170122 (experimental) on Windows 10 compiles it.
If fp(m) is replace by fp, gfortran catches the error.

Thanks to the gfortran developers for their efforts.



More information about the Fortran mailing list