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) |
All lowercase |
Fortran |
cDEC$ ATTRIBUTES STDCALL |
_name@n |
All lowercase |
Fortran |
default |
name_ (Linux) |
All uppercase |
C |
cdecl (default) |
name (Linux) |
Mixed case preserved |
C (Windows only) |
__stdcall |
_name@n |
Mixed case preserved |
C++ |
Default |
name@@decoration
(Linux) |
Mixed case preserved |
Linux, Mac OS Assembly |
Default |
name (Linux) |
Mixed case preserved |
MASM |
C (in PROTO and PROC declarations) |
_name |
Mixed case preserved |
MASM |
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