- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Never mind... I found it... A pointer under x64 is... 8 BYTES long... my default size for type INTEGER was set to 4...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yep. This is why we invented INT_PTR_KIND().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page