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,e5a3abec221df39 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!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: Possible compiler bug with this simple program Date: Fri, 29 Aug 2008 20:00:54 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1edc3682-855f-405b-8348-72b423377b1a@i20g2000prf.googlegroups.com> <48b65b3b$0$25384$4f793bc4@news.tdc.fi> <97b1150b-cb8f-4972-b594-2ae59af84147@x16g2000prn.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1220058087 13592 69.95.181.76 (30 Aug 2008 01:01:27 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 30 Aug 2008 01:01:27 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Xref: g2news2.google.com comp.lang.ada:7556 Date: 2008-08-29T20:00:54-05:00 List-Id: "Jerry" wrote in message news:97b1150b-cb8f-4972-b594-2ae59af84147@x16g2000prn.googlegroups.com... ... >FWIW, in the _real_ application that I am working on, plmap is written >in C (and accessed from my binding by an Import). Interestingly, that's completely different. That *should* work on all Ada compilers (note that the wording specifically excludes unconstrained parameters for pragma Import). This example program is unportable garbage, unfortunately, because of AI05-0002-1, and also because of B.1(38.1/2) (the "buyer beware" clause: there is no requirement that an Ada program actually work as expected if you force its conventions to another language (like C). Admittedly, this is a bit strange. In this case, C works fine as the receiver of such a call because it has no need to know the bounds of the array passed. (And if it does, they're going to be passed explicitly.) But Ada does need to know those bounds, and you can't even pass them explicitly because the Ada compiler will have to assume something for the lower bound in order to generate indexing operations (and that may be different than what you intended). The net effect is that the example program doesn't prove anything useful. It would need to import an actual C subprogram in order to be a useful test. Randy.