- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
Dave
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From this routine:
INTEGER FUNCTION SERCHN(KEY,ROOT,LLINK,RLINK,PSN,NNAMES)
CHARACTER*(*) KEY
INTEGER ROOT,Q,P,MTRCMP
INTEGER LLINK(1),RLINK(1),PSN(1)
CHARACTER*32 NNAMES(1)
C
All these integers are 4 bytes.
But in the main routine I declare these variables:
COMMON /TAPES1 / TNAMES(MXFILE)
COMMON /TAPES2 / TLLINK(MXFILE)
COMMON /TAPES3 / TRLINK(MXFILE)
COMMON /TAPES4 / TNUM(MXFILE)
COMMON /TAPES5 / TROOT , TTAPES
INTEGER TLLINK , TRLINK , TNUM , TROOT , TTAPES
Which I end up passing to the routine in question, and they are all 8 bytes.
Is this a problem with the arrays being declared with (1) in the function?
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You did compile all the sources with /integer_size:64, yes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For most of the switches, - and _ can both be used. Nowadays we tend to prefer -.
Can you provide a complete example that shows a problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In trying to reproduce in a small sample I found I couldn't reproduce it. So I went back to my huge project and found that the offending routines were in a library that didn't get recompiled when I changed the compilation flags. So I forced the recompilation and those routines now are all I*8 like they should be. But I still have a problem that I get a stack violation when I call a fortran routine from a C routine. I'm working to see why.
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps this is an opportunity to rework this code to use the C interoperability features from Fortran 2003. This won't allow you to use CHARACTER(*), but may end up cleaner in other ways. This is simply an option, not a requirement. Instead of passing the string length, the Fortran routine could scan the character array for a zero value.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page