home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!utcsri!helios.physics.utoronto.ca!grindley
- From: grindley@helios.physics.utoronto.ca (Robin Grindley)
- Subject: Re: C call FORTRAN reference needed
- Message-ID: <BrwBFE.1IJ@helios.physics.utoronto.ca>
- Sender: news@helios.physics.utoronto.ca (News Administrator)
- Organization: University of Toronto Physics/Astronomy/CITA
- References: <1992Jul23.185200.22147@nsisrv.gsfc.nasa.gov>
- Distribution: na
- Date: Fri, 24 Jul 1992 13:42:50 GMT
- Lines: 23
-
- Actually, i found the section on C <--> Fortran pretty useful. We are
- in the unenviable position of supporting the same code on both SGI
- and IBM RS6000. If ever you wanted to find two machines that don't play
- nice together, these are them. So far it seems that if you stick to
- what is described in the Fortran guide, it is pretty much portable. One
- thing that is not made clear in the guide is return values from functions.
- After hacking around with dbx a bit, it turns out that there is one
- specific register that is always used for returning values, and this
- IS machine dependent of course, but it SHOULD be the same for all compilers
- on a platform, so C and Fortran will understand each other. Just return
- the value from C, pick it up as normal in Fortran.
-
- (By the way, one of the people working on IBM asked me about some C/Fortran
- interfacing, saying that there was absolutely NO information to be found
- on the RS6000. Kudos to SGI for providing the guide, and also for the
- wrapper routines to the standard C library - IBM leaves its Fortran users
- in the dark.)
-
- --
- robin
-
- iNSANITY - It's only a state of mind
-
-