Procedure Names

C language procedures or external variables can conflict with Fortran routine names if they use the same names in lower case with a trailing underscore. For example:

Fortran Code
subroutine myproc(a,b)
end


C Code

void myproc_( float *a, float *b){
}

The expressions above are equivalent, but conflicting routine declarations. Linked into the same executable, they would cause an error at link time.

Many routines in the Fortran runtime library use the naming convention of starting library routine names with an f_ prefix. When mixing C and Fortran, it is the responsibility of the C program to avoid names that conflict with the Fortran runtime libraries.

Similarly, Fortran library procedures also include the practice of appending an underscore to prevent conflicts.