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

error #7226: An integer pointer variable has been explicitly given a data type that is not the integer type

philippe_bernier
Beginner
623 Views

Hi,

I am working on compiling some functionnal Win32 code to x64. I am encoutering the following error:

error #7226: An integer pointer variable has been explicitly given a data type that is not the integer type and kind for an address on the current platform.

Here is an example of the code that gives me this problem:

      SUBROUTINE ABCD
      IMPLICIT NONE
      INTEGER*4 i , ij , j , k , kxx , li
      INTEGER pt10
      POINTER (pt10,pt10p)
      RECORD /NRSTRUC10/ pt10p

I am not quite familiar with the use of pointers in fortran... Can you give me a hint on what to look for to fix this issue ?

Thank you

Philippe

 

 

0 Kudos
5 Replies
philippe_bernier
Beginner
623 Views

Never mind... I found it... A pointer under x64 is... 8 BYTES long... my default size for type INTEGER was set to 4...

0 Kudos
Steven_L_Intel1
Employee
623 Views

Yep.  This is why we invented INT_PTR_KIND(). 

0 Kudos
mecej4
Honored Contributor III
623 Views

Your program does not use Fortran 9X or Fortran200x pointers. The pointers used are what are called Cray pointers. It is best for you to do away with Cray pointers, if that is feasible.

If you want to keep the Cray pointers, note that in the 64 bit world pointers should be INTEGER*8, so change the declaration of ptr10p accordingly.

0 Kudos
FortranFan
Honored Contributor III
623 Views

Philippe,

Do you have a particular reason as to why you need to use the non-standard extension of Cray pointers?  If not, as suggested by mecej4, you should consider moving to "modern Fortran" and adapt your code to work with POINTERs (better viewed as aliases) offered in current standard Fortran and you'll benefit enormously.  There is a lot of information out there; you may already know about Dr Fortran's blog:  https://software.intel.com/en-us/blogs/2013/12/30/doctor-fortran-in-its-a-modern-fortran-world

 

 

 

0 Kudos
philippe_bernier
Beginner
623 Views

This is Fortran code I don't have to touch usually. It's only because we are trying to move everything to 64bits that I had to comeback to it. However, I will try to learn more about the new pointer structures and use them in my next development.

Thank you for your comments !

Philippe

0 Kudos
Reply