[Bug fortran/29941] New: gfortran reports error with len of assumed size character array

william dot mitchell at nist dot gov gcc-bugzilla@gcc.gnu.org
Wed Nov 22 15:13:00 GMT 2006


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



More information about the Gcc-bugs mailing list