Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > RESULT attribut...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 8184 of 8551
Post > Topic >>

RESULT attribute not working

by Sebastian Hanigk <hanigk@[EMAIL PROTECTED] > Apr 27, 2008 at 10:18 AM

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
 




 3 Posts in Topic:
RESULT attribute not working
Sebastian Hanigk <hani  2008-04-27 10:18:23 
Re: RESULT attribute not working
Steve Lionel <Steve.Li  2008-04-28 11:48:26 
Re: RESULT attribute not working
Sebastian Hanigk <hani  2008-04-28 21:37:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 22:36:05 CDT 2008.