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!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada array vs C pointer (call by reference) Date: Tue, 1 Jul 2008 16:19:34 -0500 Organization: Jacob's private Usenet 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: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1214947188 6577 69.95.181.76 (1 Jul 2008 21:19:48 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 1 Jul 2008 21:19:48 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:979 Date: 2008-07-01T16:19:34-05:00 List-Id: "Adam Beneschan" wrote in message news:e2c1ab35-55c8-4873-afcd-ee27bdbbd36a@i36g2000prf.googlegroups.com... ... >Some people seem to think the Ada compiler will > know how the C compiler works, and some seem to go far enough to say > that the Ada compiler should be able to *guarantee* that types in > Interfaces.C will have the same representation, and that the RM > requires this. Well, it intends to require it for a specific C compiler implementations. But that intent only occurs in the AARM (see B.2(13.a-b)). For a specific implementation (which might include particular compiler switches), the intent is that the types are correct. But of course, this is all Implementation Advice (there would be no normative way to say this), so implementations are free to ignore it. > ... My > interpretation is that an Ada compiler vendor should know what the > data representations are for the *typical* C compiler used in the > typical fashion on that system (which may well be a C compiler made > available by the same vendor, or a related one), and should make > things so that Interfaces.C will work with that. But since there's no > guarantee that any particular object file or library will have been > compiled with that C compiler, that's the most any Ada compiler can > do. That is definitely *not* the intent: see B.2(13.a-b). But I think that is how most implementers have interpreted the intent, because it's easier to do that making a separate package for every version of every supported compiler. (Remember, since the intent is Advice, implementers are not wrong in ignoring it.) ... >> 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. > > Yeah, I think those last two sentences are the key here. Surely. Randy.