------- Comment #1 from sfilippone at uniroma2 dot it  2007-09-19 17:29 -------
A version with an inner pointer to a derived type instead of allocatable array
fails as well.
-----------------
module c_vhandle_mod
  use iso_c_binding
  type foo
    integer :: i
  end type foo  
  type foo_item
    type(foo), pointer  :: v=> null()
  end type foo_item
  type(foo_item), allocatable :: foo_pool(:)

contains 

  type(c_ptr) function get_foo_address(handle)
    integer(c_int), intent(in) :: handle    
    get_foo_address = c_loc(foo_pool(handle)%v)    
  end function get_foo_address

end module c_vhandle_mod
------------------------- 
[EMAIL PROTECTED] bugtest]$ /usr/local/gcc43/bin/gfortran -c c_vh_2_mod.f90 
c_vh_2_mod.f90:18.28:

    get_foo_address = c_loc(foo_pool(handle)%v)
                           1
Error: Parameter 'foo_pool' to 'c_loc' at (1) must be either a TARGET or an
associated pointer


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33497

Reply via email to