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!news4.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:22:09 -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> <44b654da-5a19-4230-a5f2-94e35f2b3aeb@d19g2000prm.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:943 Date: 2008-06-28T14:22:09-07:00 List-Id: Stephen Leake writes: > Adam Beneschan writes: > > On Jun 27, 3:14 pm, Keith Thompson wrote: > >> Maciej Sobczak writes: > >> > On 27 Cze, 18:11, Keith Thompson wrote: > >> > > > Ada *cannot* guarantee that Interfaces.C.C_Float is the > >> > > > *right* float, because it does not verify how the C code > >> > > > was compiled and there is a lot of freedom given to C > >> > > > implementers in this area. Same for all other types. > >> > >> > > No, Ada can't guarantee it directly. Instead, Ada requires the > >> > > implementation to guarantee it. > >> > >> > And how the implementation can guarantee it without mandating the > >> > representation on the C compiler? > >> > >> It doesn't *mandate* the representation used by the C compiler; the > >> author of the Interfaces.C implementation has to *know* the > >> representation used by the C compiler. > > > > Which is, of course, impossible without a crystal ball. > > No, the vendor must provide both the Ada compiler and the C compiler. > Are there any vendors out there that don't? No, the vendor certainly doesn't have to provide both the Ada compiler and the C compiler. The author of the Ada compiler simply has to know how the C compiler represents the various types, in order to get Interfaces.C right. In most cases, the C type representations are mandated, or at least strongly suggested, by the underlying system. (GNAT/gcc is the only case I know of where an Ada compiler and a C compiler come from the same source.) -- 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"