Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29297 Discussions

Passing Hollerith or Quite-Delimited Text Args

jcbreeding
Beginner
1,135 Views
I have legacy code that I am porting from VAX to PC (Win NT 4.0). I have several subroutine calls similar to the following:

call axis('axis label',10)
or
call axis(10Haxis label,10)

The subroutine axis is in a library that emulates VERSATEK
plotting calls and produces Postscript or HPGL plot files.

The subroutine looks like this:

subroutine axis(label,n)

dimension label(1)

return
end

The linker gives me the LNK2001 error on axis. To be compatible with many different legacy codes, I need to be able to call this routine with either form of the text argument. Is there any way to do this?
0 Kudos
1 Reply
Steven_L_Intel1
Employee
1,135 Views
Compile with the options /iface:cref/iface:nomixed_str_len_arg (Project..Settings..Fortran..External Procedures: Argument Passing: C, By Ref, String length argument passing: After all args.)

In CVF (as in most UNIX and Windows compilers), character arguments are passed as two arguments, address and length, and in CVF, the length is passed immediately after the address (MS did it this way). The above options cause the lengths to be at the end (where your code doesn't see them) and causes the linker not to care about the mismatch in the number of arguments.

Steve
0 Kudos
Reply