The FORTRAN/Pascal Calling Convention (/Gc)

The FORTRAN/Pascal calling convention is used for C++ functions and any C functions declared with either the __fortran or __pascal keywords. (The two keywords currently produce identical results.) Parameters to these functions are always pushed on the stack from left to right. While any C function can be declared with the FORTRAN/Pascal convention, it is used primarily for prototypes to Pascal or FORTRAN routines called from within C programs. This calling convention can also produce smaller, faster programs.

The /Gc option (generate Pascal-style function calls) can be used to make all functions in a file observe the FORTRAN/Pascal calling convention.

Note that C run-time library routines must still be called using C calling conventions. Because these routines are declared using the __cdecl keyword header files, you must include the appropriate header files in any program using run-time library routines.

Functions with variable-length parameter lists (such as printf) cannot use the FORTRAN/Pascal calling convention.