Hello,
for a helper function I had defined the following interface:
INTERFACE
FUNCTION gasnetf90_ptr_add (ptr, bytes) &
BIND (C) RESULT (retval)
USE, INTRINSIC :: ISO_C_BINDING
IMPLICIT NONE
TYPE (C_PTR) :: retval
TYPE (C_PTR), INTENT (IN) :: ptr
INTEGER (KIND=C_INTPTR_T), INTENT (IN) :: bytes
END FUNCTION gasnetf90_ptr_add
END INTERFACE
Having this interface block verbatim in the calling program, everything
works fine, but as soon as I put this block into a module and USE that
in the caller, the functions return value is always zero.
I changed the interface block into this definition
INTERFACE
FUNCTION gasnetf90_ptr_add (ptr, bytes) &
BIND (C)
USE, INTRINSIC :: ISO_C_BINDING
IMPLICIT NONE
TYPE (C_PTR) :: gasnetf90_ptr_add
TYPE (C_PTR), INTENT (IN) :: ptr
INTEGER (KIND=C_INTPTR_T), INTENT (IN) :: bytes
END FUNCTION gasnetf90_ptr_add
END INTERFACE
and now everything works. Compilers are the current Intel ones:
Intel(R) Fortran Compiler for applications running on Intel(R) 64,
Version 10.1 Build 20080212 Package ID: l_fc_p_10.1.013
Intel(R) C Compiler for applications running on Intel(R) 64, Version
10.1 Build 20080212 Package ID: l_cc_p_10.1.013
The machines are our Itanium systems (IA64 cluster with GE and an Altix
3700) as well as our Opteron cluster.
Is this a compiler bug or have I gotten something wrong?
Sebastian


|