This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
----------------------------------^


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]