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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5a84d5077c54a29d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!aioe.org!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: Ada array vs C pointer (call by reference) Date: 28 Jun 2008 14:46:08 -0700 Organization: Aioe.org NNTP Server Message-ID: References: <5df91e99-a972-48f7-b466-3eb05dc0a915@m3g2000hsc.googlegroups.com> <3dcc4a2d-f2f9-4c98-96c8-cd9dd1b090fe@z72g2000hsb.googlegroups.com> <48658c46$0$2689$4d3efbfe@news.sover.net> <72661814-9e6e-40bb-a013-ad3b5c7217dc@59g2000hsb.googlegroups.com> NNTP-Posting-Host: udTJGbGWl+bx22XXwco3hA.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Xref: g2news1.google.com comp.lang.ada:944 Date: 2008-06-28T14:46:08-07:00 List-Id: Maciej Sobczak writes: > On 28 Cze, 02:56, "Peter C. Chapin" wrote: > > My understanding is that the interfacing to C is only really meaningful > > if the Ada compiler is in some way associated with a corresponding C > > compiler (for example, created by the same vendor). > > This is exactly my point. And it's exactly wrong, or at least overstated. The only required association is that the provider of the Ada compiler *knows* the characteristics of the relevant C compiler. That's not hard to find out. I'm not associated with the authors of gcc, but I can find out its characteristics on a given system in just a few minutes. For that matter, I can probably write a program that produces as output the correct declarations for Interfaces.C. And since code generated by different C compilers on the same system has to interoperate, it's generally in the interest of the C compiler vendors to use the same representations for types on a given system. Providing both the C and Ada compilers certainly makes it easier to get Interfaces.C right, but even if the compilers aren't associated, it's reasonably easy and reasonably reliable (certainly more so than just assuming that Float and C_Float are compatible). -- Keith Thompson (The_Other_Keith) kst-u@mib.org Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"