comp.lang.ada
 help / color / mirror / Atom feed
From: Chris M Moore <zmower@ntlworld.com>
Subject: Re: Making the same mistake as the broken C interface to fortran
Date: Wed, 3 Jul 2019 08:06:38 +0100
Date: 2019-07-03T08:06:38+01:00	[thread overview]
Message-ID: <2uYSE.298383$sJ3.119314@fx04.am4> (raw)
In-Reply-To: <lyr2786tos.fsf@pushface.org>

On 02/07/2019 21:57, Simon Wright wrote:
> Chris M Moore <zmower@ntlworld.com> writes:
> 
>> Read this interesting article today:
>>
>> https://lwn.net/SubscriberLink/791393/41d57555202e8cdb/
>>
>> Synopsis: C interfaces to Fortran makes some assumptions about how to
>> call fortran ABIs (I don't need to pass the hidden length parameter if
>> its a character*1) but now Gfortran has optimisations which assume a
>> different calling convention (Thou shalt pass the hidden length).
>>
>> There are work arounds (compile fortran with
>> ‑fno‑optimize‑sibling‑calls) but it seems that the proper fix is to
>> pass the hidden length parameter.
>>
>> I had a quick look at the LAPACK bindings and they both seem to use
>> Ada characters. :/
> 
> The code generated with Convention=Fortran should abide by the ABI, and
> if that says to pass a hidden length parameter then that's what should
> happen.
> 
> I don't know enough x86_64 (or thumb) assembler to be at all sure, but
> it looks to me as though no length parameter gets passed.
> 

Hi Simon,

So the question is do we break the API or not?  We could make the 
bindings thicker and thus slower.  Or break the typing and force client 
software to change.  The software engineer in me says the former but I'm 
not a user of this API so I doubt my views count for much.

-- 
sig pending (since 1995)

  reply	other threads:[~2019-07-03  7:06 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 [this message]
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
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