comp.lang.ada
 help / color / mirror / Atom feed
From: js@rosslyn.sparta.com (Jack Scheible)
Subject: Re: Trying to pass strings to Fortan routines
Date: 13 Aug 2001 11:28:48 -0700
Date: 2001-08-13T18:28:49+00:00	[thread overview]
Message-ID: <4a694dcf.0108131028.1a0cd880@posting.google.com> (raw)
In-Reply-To: MKzd7.57284$Kd7.32367559@news1.rdc1.sfba.home.com

I was importing the routines as Fortran, so when I tried to pass the
lengths of the strings, the compiler converted those to pointers,
since Fortran passes everything by reference.  Since C passes by
value, the Fortran routines now get the string lengths, not pointers
to the string lengths.

-jack

tmoran@acm.org wrote in message news:<MKzd7.57284$Kd7.32367559@news1.rdc1.sfba.home.com>...
> >Hideous, but it works.
> >I don't like having to call a Fortran subroutine as though it were C, but it
> >works.
>   How does it differ from the method that got a Constraint_Error?
> Perhaps some tweak to the latter would make it work.
> 
> In light of Dan Nagle's comment in <ppocntg7a1lqk4d2iatcd7hmt95269ubmr@4ax.com>
> 
> >Actually, the Fortran standard only says what a program has to be able
> >to do with character arguments, not how to pass them.  Popular
> >varieties of implementation include
> >
> >-passing character, then length, for each character argument,
> >-passing character with all the lengths at the end
> > of the calling sequence (which you have described in your post),
> >-and passing the address of a descriptor containing the address
> > and length of the character argument.
> 
>   Does your Gnat support Interfaces.Fortran in a way that matches your
> Fortran compiler?  If so, that should be much easier.  If they don't
> understand each other, they'll both have to speak some third way
> that they do both understand.



  reply	other threads:[~2001-08-13 18:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3B765238.6F013AD3@mail.verizon.net>
2001-08-12  7:14 ` Trying to pass strings to Fortan routines tmoran
2001-08-12 15:28   ` Jack Scheible
2001-08-12 18:17     ` tmoran
2001-08-13 18:28       ` Jack Scheible [this message]
2001-08-12  4:54 Jack Scheible
2001-08-12  5:24 ` tmoran
2001-08-12 11:17 ` Dan Nagle
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox