This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
gfortran triumphs with wrong code
- From: THOMAS Paul Richard 169137 <prthomas at drfccad dot cea dot fr>
- To: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Tue, 19 Jul 2005 14:23:47 +0200
- Subject: gfortran triumphs with wrong code
gfortran (and g95) happily chomp away on an automatic object in the main
program that is dimensioned by a variable furnished by a module.
f90 and ifc correctly reject this.
Paul T
Andrew, I could not find this; is there already a PR on this?
$ cat "d:\gfortran\assumed_wrong.f90"
module foo
integer :: i
end module foo
program bar
use foo
integer, dimension (i) :: j
end program bar
$ gfc d:/gfortran/assumed_wrong.f90
$ ./f90 "d:\gfortran\assumed_wrong.f90"
DIGITAL Visual Fortran Optimizing Compiler Version 5.0 (Update D)
Copyright (C) 1997,1998 Digital Equipment Corp. All rights reserved.
d:\gfortran\assumed_wrong.f90
d:\gfortran\assumed_wrong.f90(6) : Error: An automatic object is invalid in
a ma
in program. [J]
integer, dimension (i) :: j
----------------------------------^