Procedure Names for Fortran, C, C++, and MASM

The following table summarizes how Fortran, C/C++ and, for Windows,  MASM handle procedure names. Note that for MASM, the table does not apply if the CASEMAP: ALL option is used.

Naming Conventions in Fortran, C, Visual C++, and MASM

Language Attributes Name Translated As Case of Name in .OBJ File

Fortran

cDEC$ ATTRIBUTES C

name (Linux)
_
name (Windows)
_name (Mac OS)

All lowercase

Fortran
(Windows*)

cDEC$ ATTRIBUTES STDCALL

_name@n

All lowercase

Fortran

default

name_ (Linux)
_
name (Windows)
_name_ (Mac OS)

All uppercase

C

cdecl (default)

name (Linux)
_
name (Windows)
_name (Mac OS)

Mixed case preserved

C (Windows only)

__stdcall

_name@n

Mixed case preserved

C++

Default

name@@decoration (Linux)
_name
@@decoration (Windows)
__
decorationnamedocration (Mac OS)

Mixed case preserved

Linux, Mac OS Assembly

Default

name (Linux)
_name (Mac OS)

Mixed case preserved

MASM
(Windows*)

C (in PROTO and PROC declarations)

_name

Mixed case preserved

MASM
(Windows*)

STDCALL (in PROTO and PROC declarations)

_name@n

Mixed case preserved

In the preceding table:

For example, assume a function is declared in C as:

  extern int __stdcall Sum_Up( int a, int b, int c );

Each integer occupies 4 bytes, so the symbol name placed in the .OBJ file on systems based on IA-32 architecture is:

  _Sum_Up@12

On systems based on Intel® 64 architecture and those based on IA-64 architecture, the symbol name placed in the .OBJ file is:

  Sum_Up