C subroutine calls from FORTRAN

woods at hao.UUCP woods at hao.UUCP
Thu Feb 19 14:47:33 AEST 1987


In article <2324 at usceast.UUCP> still at 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 at ncar.csnet  ARPA: woods%ncar at CSNET-RELAY.ARPA
INTERNET: woods at hao.ucar.edu



More information about the Comp.unix.questions mailing list