Compile error: array argument said to have procedure attribute

Janus Weil janus@gcc.gnu.org
Wed Aug 31 11:04:00 GMT 2011


Hi,

> yes, somewhere in the back of my head the thought lingered that I did not
> mention which version of gfortran I used. But it was a 4.6 version:
>
> Built by Equation Solution <http://www.Equation.com>.
> Using built-in specs.
> COLLECT_GCC=gfortran
> COLLECT_LTO_WRAPPER=d:/gcc4.6/bin/../libexec/gcc/i686-pc-mingw32/4.6.0/lto-wrapper.exe
> Target: i686-pc-mingw32
> Thread model: win32
> gcc version 4.6.0 20110101 (experimental) (GCC)

well, 4.6.0 was only released in March, so what you have is not
"release 4.6.0" at all, but rather an 'experimental' (as written)
pre-4.6 trunk version. With the actual 4.6.0 I hope you should get the
correct error message. I tried it with

gcc version 4.6.2 20110805 (prerelease) [gcc-4_6-branch revision 177433] (GCC)

where it works fine.

Cheers,
Janus



> 2011/8/31 Janus Weil <janus@gcc.gnu.org>:
>> 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