This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30746] New: 50th Anniversary Bug - scoping error
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Feb 2007 15:18:04 -0000
- Subject: [Bug fortran/30746] New: 50th Anniversary Bug - scoping error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Malcolm Cohen's talk to the BCS 50th anniversary of FORTRAN meeting has this
example:
MODULE m
REAL :: x(3) = (/ 1.5, 2.5, 3.5 /)
CONTAINS
SUBROUTINE s
CALL inner
CONTAINS
SUBROUTINE inner
PRINT *,x(7) ! This is not an error!
END SUBROUTINE
FUNCTION x(n)
x = REAL(n)**n
END FUNCTION
END SUBROUTINE
END MODULE
use m
call s()
end
to which, gfortran incorrectly returns
PRINT *,x(7) ! This is not an error!
1
Warning: Array reference at (1) is out of bounds
unless subroutine inner and function x are interchanged.
Paul
--
Summary: 50th Anniversary Bug - scoping error
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pault at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30746