Hi Dominique,

Yes indeed - I used int(kind(loc(res))) to achieve the same effect.

I am looking for but failing to find a similar problem for PR89846.
Tomorrow I turn my attention to an incorrect cast in the compiler.

Regards

Paul

On Thu, 11 Apr 2019 at 14:54, Dominique d'Humières <domi...@lps.ens.fr> wrote:
>
>
> 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 
> > <paul.richard.tho...@gmail.com> a écrit :
> >
> > Many thanks, sir! I will look into it.
> >
> > Paul
>


-- 
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein

Reply via email to