Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

iface

Specifies the default calling convention and argument-passing convention for an application.

Syntax

Linux:

None

Windows:

/iface:keyword

Arguments

keyword

Specifies the calling convention or the argument-passing convention. Possible values are:

default

Tells the compiler to use the default calling conventions.

cref

Tells the compiler to use calling conventions C, REFERENCE.

cvf

Tells the compiler to use calling conventions compatible with Compaq Visual Fortran*. This value is only available on Windows* systems.

[no]mixed_str_len_arg

Determines the argument-passing convention for hidden-length character arguments.

stdcall

Tells the compiler to use calling convention STDCALL.

stdref

Tells the compiler to use calling conventions STDCALL, REFERENCE.

Default

/iface:default

The default calling convention is used.

Description

This option specifies the default calling convention and argument-passing convention for an application.

The aspects of calling and argument passing controlled by this option are as follows:

  • The only calling mechanism available is C; requests for the STDCALL mechanism are ignored.

  • The argument passing mechanism (by value or by reference)

  • Character-length argument passing (at the end of the argument list or after the argument address)

  • The case of external names (uppercase or lowercase)

  • The name decoration (prefix and suffix)

You can also use the ATTRIBUTES compiler directive to modify these conventions on an individual basis. Note that the effects of the ATTRIBUTES directive do not always match that of the iface option of the same name.

Option

Description

/iface:default

Tells the compiler to use the default calling conventions. These conventions are as follows:

  • The calling mechanism: C

  • The argument passing mechanism: by reference

  • Character-length argument passing: at end of argument list

  • The external name case: uppercase

  • The name decoration: no prefix; no suffix

/iface:cref

Tells the compiler to use the same conventions as /iface:default except that external names are lowercase.

/iface:cvf

Tells the compiler to use calling conventions compatible with Compaq Visual Fortran* and Microsoft Fortran PowerStation. This option is only available on Windows* systems. These conventions are as follows:

  • The argument passing mechanism: by reference

  • Character-length argument passing: following the argument address

  • The external name case: uppercase

  • The name decoration: no prefix; no suffix

/iface:mixed_str_len_arg

Specifies argument-passing conventions for hidden-length character arguments. This option tells the compiler that the hidden length passed for a character argument is to be placed immediately after its corresponding character argument in the argument list.

This is the method used by Compaq Visual Fortran*. When porting mixed-language programs that pass character arguments, either this option must be specified correctly or the order of hidden length arguments must be changed in the source code. This option can be used in addition to other /iface options.

/iface:stdcall

Tells the compiler to use the following conventions:

  • The calling mechanism: STDCALL

  • The argument passing mechanism: by value

  • Character-length argument passing: at the end of the argument list

  • The external name case: uppercase

  • The name decoration:

    no prefix; no suffix

/iface:stdref

Tells the compiler to use the same conventions as /iface:stdcall except that argument passing is by reference.

CAUTION:

On Windows systems, if you specify option /iface:cref, it overrides the default for external names and causes them to be lowercase. It is as if you specified "!dir$ attributes c, reference" for the external name.

If you specify option /iface:cref and want external names to be uppercase, you must explicitly specify option /names:uppercase.

IDE Equivalent

Visual Studio: External Procedures > Calling Convention (/iface:{cref|stdref|stdcall|cvf|default})

External Procedures > String Length Argument Passing (/iface:[no]mixed_str_len_arg)

Alternate Options

/iface:cvf

Linux: None

Windows: /Gm

/iface:mixed_str_len_arg

Linux: -mixed-str-len-arg

Windows: None

/iface:nomixed_str_len_arg

Linux: -nomixed-str-len-arg

Windows: None

/iface:stdcall

Linux: None

Windows: /Gz