With the following code
module cdesc
interface
function cdesc_f08(buf, expected) result (res) BIND(C, name="cdesc_c")
USE, INTRINSIC :: ISO_C_BINDING
implicit none
INTEGER(C_INT) :: res
type(*), dimension(..), INTENT(INOUT) :: buf
type(c_ptr),INTENT(IN) :: expected
end function cdesc_f08
end interface
end module
program cdesc_test
USE, INTRINSIC :: ISO_C_BINDING
use cdesc
implicit none
integer(c_int), target :: a0, a1(10), a2(10,10), a3(10,10,10)
if (cdesc_f08(a0, C_LOC(a0)) .ne. 1) stop 1
if (cdesc_f08(a1, C_LOC(a1(1))) .ne. 1) stop 2
if (cdesc_f08(a2, C_LOC(a2(1,1))) .ne. 1) stop 3
if (cdesc_f08(a3, C_LOC(a3(1,1,1))) .ne. 1) stop 4
end program
The test ISO_Fortran_binding_9.f90 executes without failure for both -m32 and
-m64.
Dominique
> Le 10 avr. 2019 à 00:42, Paul Richard Thomas <[email protected]>
> a écrit :
>
> Many thanks, sir! I will look into it.
>
> Paul