Compile error: array argument said to have procedure attribute
Janus Weil
janus@gcc.gnu.org
Wed Aug 31 10:52:00 GMT 2011
Hi Arjen,
> when I try to compile the program below I get the following messages:
>
> sort_mystery.f90:15.22:
>
> subroutine sort( array )
> 1
> Error: PROCEDURE attribute conflicts with INTENT attribute in 'array' at (1)
well, you should also mention that this only happens with gfortran 4.5
(though I'm not sure why). With 4.6 and trunk I get the (correct)
error message:
class(sortable), dimension(:), intent(inout), target :: array
1
Fatal Error: Polymorphic array at (1) not yet supported
Unfortunately, "CLASS(..), DIMENSION(..)" variables are still not
supported by gfortran, and I am currently not in the position to start
a project of this scale. There was a draft patch by Paul a while ago,
but I'm not sure how far this goes or if he is still working on this.
Cheers,
Janus
> --------
> ! abstract_sort.f90 --
> ! Show how to define a generic sortable type
> !
> ! Module for sortable objects
> !
> module sortable_types
>
> type, abstract :: sortable
> ! No particular data
> contains
> end type sortable
>
> contains
>
> subroutine sort( array )
> class(sortable), dimension(:), intent(inout), target :: array
>
> class(sortable), allocatable :: tmp
> class(sortable), pointer :: first_element
>
> integer :: i
> integer :: j
>
> allocate( tmp, source = array(1) )
>
> write(*,*) size(array)
> end subroutine sort
>
> end module sortable_types
>
More information about the Fortran
mailing list