Sujet : Re: how do you send a fortran character string from GCC to GFortran ?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.fortranDate : 03. Jan 2025, 01:30:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vl7b3e$3ikvi$5@dont-email.me>
References : 1
User-Agent : Pan/0.161 (Chasiv Yar; )
On Thu, 2 Jan 2025 02:27:54 -0600, Lynn McGuire wrote:
How do you send a fortran character string from GCC to GFortran ?
Seems like trying to call Fortran routines from C is not quite
straightforward. Looking at the (draft?) Fortran 2023 spec, page 514 says:
In a reference from C to a Fortran procedure with an interoperable
interface, a C actual argument shall be the address of a C
descriptor for the intended effective argument if the
corresponding dummy argument interoperates with a C formal
parameter that is a pointer to CFI_cdesc_t.
The following section (page 516 onwards) defines these “C descriptors”. Or
alternatively (back to page 514), you might need to declare your Fortran
routine with the “BIND(C)” attribute.