delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/20/11:54:37

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Mon, 20 Nov 2000 17:51:28 +0100
From: erik DOT nim AT risoe DOT dk
Subject: RE: C calls to Fortran with strings
To: ehud AT unix DOT simonwiesel DOT co DOT il
Cc: cygwin AT sourceware DOT cygnus DOT com
Message-id: <7F6BCF6B9307D311980C0090273C746C020CBAD5@cssrv1>
MIME-version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)

This solves all problems. Thank you very much for your help and for your
work with the Cygwin platform.


Kind regards

Erik Nim


-----Original Message-----
From: Ehud Karni [mailto:ehud AT unix DOT simonwiesel DOT co DOT il]
Sent: Monday, November 20, 2000 4:58 PM
To: erik DOT nim AT risoe DOT dk
Cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: C calls to Fortran with strings


On Mon, 20 Nov 2000 16:29:32 +0100, erik DOT nim AT risoe DOT dk wrote:
> 
> I am using the gcc compiler under Cygwin on a NT platform for applications
> where I call Fortran subroutines from C code. This is working smoothly
with
> one strange exception: If more than one string are present in Fortran
> subroutines the program crashes. Apparently everything works with ONE
string
> only. The following simple example illustrates the problem: 
[snip]
> extern void sub1_(char *s1, unsigned int);
> extern void sub2_(char *s1, unsigned int, char *s2, unsigned int);
[snip]
>       SUBROUTINE SUB1(S1)
[snip]
>       SUBROUTINE SUB2(S1, S2)

If my memory serves me right, you have defined the SUB2 wrongly.
The correct definition should be:
    extern void sub2_ (char *s1, char *s2, unsigned l1, unsigned l2);
As I recall the string lengths always come after all the real formal
parameters (not directly after the string pointer).
(I can't check it at the moment so please check it and report back).

Ehud.


-- 
 @@@@@@ @@@ @@@@@@ @    @   Ehud Karni  Simon & Wiesel  Insurance agency
     @    @      @  @@  @   Tel: +972-3-6212-757    Fax: +972-3-6292-544
     @    @ @    @ @  @@    (USA)  Fax  and  voice  mail:  1-815-5509341
     @    @ @    @ @    @        Better     Safe     Than     Sorry
 http://www.simonwiesel.co.il    mailto:ehud AT unix DOT simonwiesel DOT co DOT il

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019