🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #5013

Re: String passing (was :Re: Problem calling a C function from Fortran

#5013
From: rbt
Date: Tue, 30 Aug 1988 13:15
20 lines
1426 bytes
In article <20518@tut.cis.ohio-state.edu> rajiv@tuna.cis.ohio-state.edu (Rajiv Agrawal) writes:
>While on the subject of C and FORTRAN on VMS ... How does one pass
>strings between the two compilers???  We have VAX FORTRAN and GnuC
>compilers.  I just cannot pass any strings between a C routine and a
>FORTRAN routine.



The problem is that FORTRAN programs use the CLASS_S descriptor mechanism while
C modules have zero terminated strings by default.

The best way to solve your problem is described in chapter "Using VAX C Features
on VMS" of "Guide to VAX C" manual. It describes how function parameters must
be declared to be conformant to the CLASS_S descriptor class.

The only problem in doing this is that ALL the modules calling the C routine  
MUST have their parameters defined as CLASS_C descriptor, otherwise...

	Roberto Divia`
	=============
Technical Details
Message-ID: <809@cernvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!cernvax!rbt
References: <1134@ssc-bee.ssc-vax.UUCP> <353@sdrc.UUCP> <20518@tut.cis.ohio-state.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!cernvax!rbt
From: rbt@cernvax.UUCP (rbt)
Newsgroups: comp.sys.dec,comp.lang.fortran,comp.lang.c
Subject: Re: String passing (was :Re: Problem calling a C function from Fortran
Keywords: Fortran, C, external function in Fortran
Message-ID: <809@cernvax.UUCP>
Date: 30 Aug 88 13:15:32 GMT
References: <1134@ssc-bee.ssc-vax.UUCP> <353@sdrc.UUCP> <20518@tut.cis.ohio-state.edu>
Reply-To: rbt@cernvax.UUCP ()
Organization: CERN European Laboratory for Particle Physics, CH-1211 Geneva, Switzerland
Lines: 20