This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Error: Parameter array ... cannot be automatic or assumed shape
- From: Florian Ladstaedter <flad at gmx dot at>
- To: fortran at gcc dot gnu dot org
- Date: Thu, 26 Jul 2007 18:41:06 +0200
- Subject: Error: Parameter array ... cannot be automatic or assumed shape
Hi, I am trying to get a software project compiling with gfortran, this
is the first error I am running in (example code):
--------------------------------------------
program test_gfortran
implicit none
!test case 1, similar to PR26074
integer, parameter :: len = 1
integer, parameter :: arr(max(len,1)) = (/1/)
!test case 2
character(len=*), dimension (1), parameter :: specStr =
(/'string'/)
double precision, dimension (size(specStr)), parameter :: specNum =
(/99.0d0/)
end
--------------------------------------------
This results in:
--------------------------------------------
$gfortran-4.2 -c test_gfortran.f90
test_gfortran.f90:7.39:
integer,parameter :: arr(max(len,1)) = (/1/)
1
Error: Parameter array 'arr' at (1) cannot be automatic or assumed shape
test_gfortran.f90:11.68:
double precision, dimension (size(specStr)), parameter :: specNum =
(/99.0d0
1
Error: Parameter array 'specnum' at (1) cannot be automatic or assumed shape
--------------------------------------------
I am on a Debian testing machine (using the slightly newer gfortran
version from unstable, testing has a pre-version of 4.2.1 at the moment)
$ gfortran-4.2 --version
GNU Fortran (GCC) 4.2.1 (Debian 4.2.1-0)
This is somehow similar to PR26074 (which is fixed and works). NAG and
Lahey Fortran compiler work with this code. Is this a gfortran bug or do
you have any suggestion (apart from using simply a number in the
dimension specification)?
thanks Florian