comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Making the same mistake as the broken C interface to fortran
Date: Fri, 05 Jul 2019 18:44:56 +0100
Date: 2019-07-05T18:44:56+01:00	[thread overview]
Message-ID: <lyef3474vb.fsf@pushface.org> (raw)
In-Reply-To: UzITE.602664$j33.279357@fx26.am4

Chris M Moore <zmower@ntlworld.com> writes:

> On 04/07/2019 09:38, Simon Wright wrote:
>> procedure Call is
>>     procedure Callee_C (C : Character)
>>     with
>>       Import,
>>       Convention => Fortran,
>>       External_Name => "callee_";
>>     procedure Callee_F (C : Interfaces.Fortran.Fortran_Character)
>>     with
>>       Import,
>>       Convention => Fortran,
>>       External_Name => "callee_";
>>     procedure Callee_S (S : String)
>>     with
>>       Import,
>>       Convention => Fortran,
>>       External_Name => "callee_";
>> begin
>>     Callee_C ('c');
>
> I've looked at the assembler for this.  Passing 'c' results in only a
> byte pushed to the stack.  And then (aha!) the address on the stack is
> placed in the rdi register.

Because all Fortran parameters are passed by reference.

  reply	other threads:[~2019-07-05 17:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 23:33 Making the same mistake as the broken C interface to fortran Chris M Moore
2019-07-02 20:57 ` Simon Wright
2019-07-03  7:06   ` Chris M Moore
2019-07-03 19:02     ` Randy Brukardt
2019-07-03 21:31       ` Chris M Moore
2019-07-04  8:38         ` Simon Wright
2019-07-05 13:49           ` Chris M Moore
2019-07-05 17:44             ` Simon Wright [this message]
2019-07-07 16:33               ` Chris M Moore
replies disabled

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