From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,de9de2f8fd1d9bb X-Google-Attributes: gidfee84,public From: lionel@quark.enet.dec.com (Steve Lionel) Subject: Re: passing between C and Fortran Date: 1995/11/16 Message-ID: <48foif$lk3@zk2nws.zko.dec.com>#1/1 X-Deja-AN: 119507227 distribution: world references: <48aa3t$9im@news.cea.fr> organization: Digital Equipment Corporation, Nashua NH reply-to: lionel@quark.enet.dec.com (Steve Lionel) newsgroups: comp.unix.osf.osf1 In article <48aa3t$9im@news.cea.fr>, francois CARTIER writes: |>I have a C program calling Fortran functions, and inside the Fortran, |>i need to call some C functions. |>My programs comes from HPUX and i have to compile it on OSF1. |>But the f77 compiler isn't very happy with my source file.. |>any help ? In the current (V3.8) release of DEC Fortran, there's the CDEC$ ALIAS directive which is similar to the $ALIAS directive in HP's Fortran, though it specifies the name alias only, not the passing mechanism. Your Fortran code would look like this: CDEC$ ALIAS recupfort,'recupfort' integer function essaifort() integer ii=123 call recupfort(%val(ii)) return end The next version of Digital Fortran will include a new directive that will give you the ability to say "this is the name of a C routine" and it will apply C naming and passing-mechanism semantics automatically. -- Steve Lionel Mail: lionel@quark.enet.dec.com DEC Fortran Development WWW: http://www.digital.com/info/slionel.html Digital Equipment Corporation CompuServe: 75263,3001 110 Spit Brook Road, ZKO2-3/N30 Nashua, NH 03062-2698 "Free advice is worth every cent" For information on DEC Fortran 90, see http://www.digital.com/info/hpc/f90/