From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer02.am4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx12.am4.POSTED!not-for-mail Subject: Re: Making the same mistake as the broken C interface to fortran Newsgroups: comp.lang.ada References: <2uYSE.298383$sJ3.119314@fx04.am4> From: Chris M Moore User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Message-ID: <499TE.1270744$Ud5.547915@fx12.am4> X-Complaints-To: http://netreport.virginmedia.com NNTP-Posting-Date: Wed, 03 Jul 2019 21:31:44 UTC Organization: virginmedia.com Date: Wed, 3 Jul 2019 22:31:44 +0100 X-Received-Bytes: 2367 X-Received-Body-CRC: 2856723737 Xref: reader01.eternal-september.org comp.lang.ada:56808 Date: 2019-07-03T22:31:44+01:00 List-Id: On 03/07/2019 20:02, Randy Brukardt wrote: > "Chris M Moore" wrote in message > news:2uYSE.298383$sJ3.119314@fx04.am4... > ... >> So the question is do we break the API or not? > > That's not the question. The question is ensuring that the Ada compiler > properly implements the Fortran convention. If it does, then the API doesn't > change. And if it doesn't, then fix the silly compiler (or get a different > one that does the right thing). The Annex B "Implementation Advice" > (specifically, B.5(22-26)) is very close to a requirement, in that the > interface is not useful if one can't depend on the mapping. > > > BTW, I note that type Fortran_Character is in fact an array type, so that > could be confusing some readers of the API (it surely would have confused > me). I'm sure GNAT does the right thing if you're using Fortran_Character. Unfortunately the bindings use Standard.Character. >> 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. Or maybe the answer is both. Leave in the Character interface with a body to do the conversion and add another version to do the thin wrapper using Fortran_Character. Nothing breaks but if speed becomes a problem then switch to using the proper thin version. Chris -- sig pending (since 1995)