Meissner examples - PR24276
Paul Thomas
paulthomas2@wanadoo.fr
Sat Oct 8 20:35:00 GMT 2005
The problem with the Meissner example, ArrayList, that Dominique has
been trying to bring to our attention is, in my opinion, a serious one.
I would vote to add it to the most wanted list; especially since I have
a little bit of credit for today's patch for PR18082, don't I? I have
posted it as PR24276.
program test_lex
type :: dtype
integer :: n
character*12 :: word
end type dtype
type(dtype), dimension(2) :: list
list(1) = dtype (1 , "one")
list(2) = dtype (2 , "two")
call foo (list%word)
contains
subroutine foo (slist)
character*12, dimension(*) :: slist
print *, ("\n",slist(i), i=1,2)
end subroutine foo
end program test_lex
produces the output
[prt@localhost meissner]# ./a.out
one
two
Examination of the code shows that the size of the derived type is not being used to determine the stride of the array in the function. This is one and the same as the problem with pointer arrays pointing to same kind components of a
derived type array, which Tobi is "fond" of.
It's time that we fixed this.
Paul T
More information about the Fortran
mailing list