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!news2.google.com!news.glorb.com!nlpi057.nbdc.sbc.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada array vs C pointer (call by reference) Date: Sat, 28 Jun 2008 13:52:19 -0400 Organization: The World Public Access UNIX, Brookline, MA 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: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1214675539 31985 192.74.137.71 (28 Jun 2008 17:52:19 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 28 Jun 2008 17:52:19 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:8E0dfNCwEbape5s2j1iBMLHnWlU= Xref: g2news1.google.com comp.lang.ada:940 Date: 2008-06-28T13:52:19-04:00 List-Id: Adam Beneschan writes: > On Jun 27, 3:14 pm, Keith Thompson wrote: >> 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 need for crystal balls. Just read the documentation of the C compiler. Maybe you're worried that the C compiler will change the size of float in a future version? Well, first of all, that won't happen because it will break existing C programs. But if it does, then that's a new and different implementation of C, and the Ada compiler would have to be modified in order to support interfacing to it. Why is that a problem? This whole argument started because somebody wanted to use Float instead of C_Float. But there is nothing in the Ada RM saying that Float should correspond to anything in particular. There IS something in the RM saying that C_Float corresponds to float as implemented by the C compiler(s) that the Ada compiler claims to support interfacing to. And the Ada compiler documentation will tell you which C compiler(s) are supported. - Bob