Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-spam!mordor!styx!ames!hao!woods From: woods@hao.UUCP Newsgroups: comp.lang.fortran,comp.unix.questions Subject: Re: C subroutine calls from FORTRAN Message-ID: <544@hao.UCAR.EDU> Date: Wed, 18-Feb-87 23:47:33 EST Article-I.D.: hao.544 Posted: Wed Feb 18 23:47:33 1987 Date-Received: Fri, 20-Feb-87 02:10:36 EST References: <2324@usceast.UUCP> Reply-To: woods@hao.UUCP (Greg Woods) Organization: High Altitude Obs./NCAR, Boulder CO Lines: 38 Xref: utgpu comp.lang.fortran:61 comp.unix.questions:1107 In article <2324@usceast.UUCP> still@usceast.UUCP (Bert Still) writes: > > Here is an interesting problem: > >because when you call a routine from f77, an underscore (_) is appended to >the fcn identifier both in front (as cc does) and BEHIND. How does one get >around this problem ? > call setjmp(jmpbuf) I know this is awful, but it's the only way. You also link with a C file that contains something like: void setjmp_(jmpbuf) int *jmpbuf; { (void) setjmp(jmpbuf) } We've got a whole library of stuff like this here. >Apparently, the above >program worked just fine under BSD4.1 (or > so it was claimed) I find that hard to believe, but the above C code fragment should have worked under 4.1 too. --Greg >routine was part of the original distribution of the MATLAB tape They probably assumed you had some kind of library for the system routines. Some of them already have such stubs in the 3F library, but as you found out, not all of them do. --Greg -- UUCP: {hplabs, seismo, nbires, noao}!hao!woods CSNET: woods@ncar.csnet ARPA: woods%ncar@CSNET-RELAY.ARPA INTERNET: woods@hao.ucar.edu