Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

problems with the TRANSFER function

Robert_van_Amerongen
New Contributor III
600 Views

I do have a problem with the TRANSFER intrinsic function., When I try to get the result of a C_LOC function in the form of a regular integer variable then it works fine under 32 bits programming. Under 64 bits it depends on the mold argument what result is returned. When using NULL the result of the function is a 32 bit and it seems that only the lower 32 bits are used and the rest is ignored. That is strange under 64 bits! What is going wrong here? An example file is added.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
600 Views

Thanks. This seems to be caused by using a PARAMETER as the MOLD= argument to TRANSFER. Exactly why that should be, I don't know. If you use a variable of the correct kind instead it works, or 0_C_INTPTR_T, as you found. I have escalated this as issue DPD200243578.

0 Kudos
Steven_L_Intel1
Employee
600 Views

This has been fixed in our sources. The fix should appear in the next major version planned for the second half of 2015.

0 Kudos
Robert_van_Amerongen
New Contributor III
600 Views

Thanks Steve.

 

0 Kudos
Reply