- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ATTRIBUTES STDCALL
Intel Fortran does not support use of STDCALL with BIND(C) at this time, so if you are interfacing to STDCALL routines (Windows on IA-32 architecture only), you must continue to use the ATTRIBUTES extension, along with ALIAS and DECORATE as required.
Err yes you do support it chaps :-)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That link has a date of 2012. As with many articles at this site, the search function can lead you to a number of pages, many of which may have information that is not applicable to the current compiler, and it is not easy to find answers to questions such as "since when is STDCALL supported in Win-64?" without going through a list of links and winnowing out the old ones. It would be helpful if you add a comment on that link pointing out that the information is no longer applicable to the 2016 compiler, for which please see https://software.intel.com/en-us/node/580350 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually the page either needs locking (as may obsolete pages are) or updating. Current documents should reflect the current compiler, STDCALL with bind(c) was introduced maybe a year or more ago.. The article is a useful one it just needs a minor tweak or two. Had I not known it was wrong I might have looked no further...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For what it is worth I recalled from an old post when 15.0 was released with the BIND(C)/STDCALL possibility. The text in the release notes was quite clear, Some cut n paste to the help would help as for mere mortals this subject is confusing.....
I was looking to get this clear in my mind so I had a look at the documents. Release_Notes_F_2015_W_EN.pdf says:
3.2.4.1 ATTRIBUTES STDCALL now allowed with BIND(C)
As of compiler version 15.0, the ATTRIBUTES STDCALL directive may be specified for an
interoperable procedure (a procedure whose declaration includes the BIND(C) language binding
attribute.) This combination has the following effects for Windows* applications targeting IA-32
architecture:
The calling mechanism is changed to STDCALL, which affects how the stack is cleaned
up on procedure exit
The external name from the BIND attribute is suffixed with “@n”, where n is the number
of bytes to be removed from the stack on return.
No other effects from STDCALL, such as pass-by-value, are provided. The Fortran standard
VALUE attribute (not ATTRIBUTES VALUE) may be used if desired. For all other platforms,
specifying STDCALL with BIND(C) has no effect.
and the help says:
The BIND attribute is similar to directive !DIR$ ATTRIBUTES C as follows:
- The compiler applies the same naming rules, that is, names are lowercase (unless NAME= specifies otherwise).
- The compiler applies the appropriate platform decoration, such as a leading underscore.
However, procedure argument passing differs. When BIND is specified, procedure arguments are passed by reference unless the VALUE attribute is also specified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for notifying us about this. I updated the article and am looking into improvements to the help also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Documentation and Fortran Development teams made improvements in the related topics in the User guide for upcoming PSXE 2016 Update 2 release early next year. The earlier cited article has also been updated.
Thank you again for pointing out the inconsistencies.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page