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