This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
gfortran allows variable to be declared twice
- From: "Vivek Rao via fortran" <fortran at gcc dot gnu dot org>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Tue, 2 May 2017 16:22:20 +0000 (UTC)
- Subject: gfortran allows variable to be declared twice
- Authentication-results: sourceware.org; auth=none
- References: <1993568595.867747.1493742140420.ref@mail.yahoo.com>
- Reply-to: Vivek Rao <vivekrao4 at yahoo dot com>
- Reply-to: Vivek Rao <vivekrao4 at yahoo dot com>
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.