- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to export a Fortran function into a LIB, which is later to be used from C/C++ and I'm experiencing a Upper/Mixed-Case Problem with the ALIAS directive:
Here are the relevant lines of code:
integer*4 function GetSolutionStatus ()
!DEC$ ATTRIBUTES C, ALIAS:'_GetSolutionStatus' :: GetSolutionStatus
....
The function will be compiled into the the LIB with the name "_GETSOLUTIONSTATUS" - all UPPERCASE, and not MixedCase, as I wanted it.
If you shorten the name to 14 chararcters including the leading underscore by
!DEC$ ATTRIBUTES C, ALIAS:'_GetSolutionSt' :: GetSolutionStatus
it will be compiled correctly to mixed case. If I quit the C-directive, I can expand the name to 17 characters "_GetSolutionStatu" which exports correctly to mixed-case
!DEC$ ATTRIBUTES ALIAS:'_GetSolutionStatu' :: GetSolutionStatus
But anything with more than 16 characters without the underscore is allways UPPERCASE. Obviously there is a limit around the "magic" number 16. Bug or feature?
I'm using Intel Fortran v8.1.2279.2003
BTW: Compaq Fortran 6 does the same
Here are the relevant lines of code:
integer*4 function GetSolutionStatus ()
!DEC$ ATTRIBUTES C, ALIAS:'_GetSolutionStatus' :: GetSolutionStatus
....
The function will be compiled into the the LIB with the name "_GETSOLUTIONSTATUS" - all UPPERCASE, and not MixedCase, as I wanted it.
If you shorten the name to 14 chararcters including the leading underscore by
!DEC$ ATTRIBUTES C, ALIAS:'_GetSolutionSt' :: GetSolutionStatus
it will be compiled correctly to mixed case. If I quit the C-directive, I can expand the name to 17 characters "_GetSolutionStatu" which exports correctly to mixed-case
!DEC$ ATTRIBUTES ALIAS:'_GetSolutionStatu' :: GetSolutionStatus
But anything with more than 16 characters without the underscore is allways UPPERCASE. Obviously there is a limit around the "magic" number 16. Bug or feature?
I'm using Intel Fortran v8.1.2279.2003
BTW: Compaq Fortran 6 does the same
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By any chance does your source file name end with .f or .for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it ends with ".for"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thought so. Your directive extends past column 72 with the longer name and thus does not have the desired effect. Split it into two or more directives.
My advice is to use free-form source (.f90 file type) for all new coding. It will avoid problems such as this one and many others.
If you must use fixed-form source, enable the option to warn of truncated source lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You were right!!!
Since the compiler directives are colored green, one does not see the also green coloring that happens to the text beyond column 72 as a warning.
Thanks for the swift reply! Good customer service.
Since the compiler directives are colored green, one does not see the also green coloring that happens to the text beyond column 72 as a warning.
Thanks for the swift reply! Good customer service.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page