This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29941] New: gfortran reports error with len of assumed size character array
- From: "william dot mitchell at nist dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Nov 2006 15:13:01 -0000
- Subject: [Bug fortran/29941] New: gfortran reports error with len of assumed size character array
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
With this subroutine:
subroutine whatever(str)
character(len=*), dimension(*) :: str
integer :: i
i = len(str)
end subroutine whatever
gfortran reports:
i = len(str)
1
Error: The upper bound in the last dimension must appear in the reference to
the assumed size array 'str' at (1)
The subroutine is valid -- you can pass an assumed size whole array to any
subroutine that does not need to know the shape of the array, and len can
accept either a scalar or an array.
The subroutine compiles if either an explicit length is given, i.e.
character(len=10), or the array is assumed shape, i.e. dimension(:).
--
Summary: gfortran reports error with len of assumed size
character array
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: william dot mitchell at nist dot gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29941