Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Mixed Language Linker Warnings

inthecrossfire
Principiante
445 Vistas
I'm working on a mixed Fortran/C project using ifort and icc v12.1 respectively. I've found while working on this project, that it's pretty easy to make a mistake with the number of parameters or types when calling C functions in Fortran. The linker seems happy as long as the name in the function call matches a function at link-time.

Is there anyway to have the linker through an error when the arguments mismatch? I've found the -warn interface system in ifort for intra-Fortran calls but obviously this works significantly differently by searching mod files.


Here's an example program:


Fortran:
[fortran]program main
    implicit none

    real val
    val = 3.0

    CALL multi(val, 5.0)

    PRINT *, val

end program main[/fortran]
C:
[cpp]void multi_(float * a)
{
	*a *= 5.0f;
}
[/cpp]
0 kudos
1 Responder
Steven_L_Intel1
Empleados
445 Vistas
No - there is no information the linker can use for this purpose.
Responder