Mail Archives: djgpp/1997/03/03/07:02:24
I am looking for calling conventions for calling C routines from FORTRAN
and vice versa.
One puzzling feature that I have run across it that a C function
referenced from FORTRAN must have an underscore postpended to name of
the C function source:
SUBROUTINE FcallC ()
INTEGER ITEMP
ITEMP = Cfunc()
RETURN
END
int cfunc_()
{
...
}
Now, if I have a group of pre-existing C routines, does that mean that I
must edit all of the routines to add the post-pended underscore in order
to call them from FORTRAN?
What about the reverse sequence, calling FORTRAN from C? Who gets the
underscore?
- Raw text -