Calling FORTRAN from C (Was: Need matrix inversion C routine).

Tim Olson tim at crackle.amd.com
Thu May 4 09:42:50 AEST 1989


In article <1278 at l.cc.purdue.edu> cik at l.cc.purdue.edu (Herman Rubin) writes:
| I have used several operating systems before UNIX.  On all of them, a name
| was a name was a name.  The program cards and subroutine cards in Fortran
| produced names in the object file identical to what appeared on the card.
| Entry names and COMMON block names likewise.  Assembler-produced programs
| did the same thing.  If I was going to use an Algol program it would still
| be the same.  The calling sequence was a problem, even between Fortrans.
| But not the names.

If an underscore is not prepended (or the names changed in some standard
unique way), then you run into the problem of potential name-space
conflicts with the assembly-level "helper" routines that almost always
exist.  These routines include "start" (the beginning of crt0, which
gets control and sets everything up for your program), help for non- or
undersupported intrinsics like unsigned modulo, short multiplies, etc.

If this were not done, then a user would just get mysterious
"multiply-defined" errors from the link of his program.


	-- Tim Olson
	Advanced Micro Devices
	(tim at amd.com)



More information about the Comp.lang.c mailing list