comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Possible compiler bug with this simple program
Date: Fri, 29 Aug 2008 20:00:54 -0500
Date: 2008-08-29T20:00:54-05:00	[thread overview]
Message-ID: <g9a656$d8o$1@jacob-sparre.dk> (raw)
In-Reply-To: 97b1150b-cb8f-4972-b594-2ae59af84147@x16g2000prn.googlegroups.com

"Jerry" <lanceboyle@qwest.net> 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.







  reply	other threads:[~2008-08-30  1:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-28  7:28 Possible compiler bug with this simple program Jerry
2008-08-28  7:56 ` Ludovic Brenta
2008-08-28 21:08   ` Jerry
2008-08-29 20:39     ` Ludovic Brenta
2008-08-29 21:20       ` Jerry
2008-08-29 21:31         ` Jerry
2008-09-02 22:10     ` Santiago Urueña
2008-08-28  8:03 ` Niklas Holsti
2008-08-28 15:54   ` Adam Beneschan
2008-08-28 15:56     ` Adam Beneschan
2008-08-28 21:01   ` Randy Brukardt
2008-08-28 21:29     ` Jerry
2008-08-30  1:00       ` Randy Brukardt [this message]
2008-08-30  4:47         ` Jerry
2008-09-01 11:19           ` Jerry
2008-09-03  4:22             ` Jerry
2008-09-03 14:20               ` Adam Beneschan
2008-09-04  0:22                 ` Jerry
2008-09-04  1:18                   ` Adam Beneschan
2008-09-04  3:53                     ` Randy Brukardt
2008-09-04  1:31                   ` Jeffrey R. Carter
2008-09-04 14:35                     ` Adam Beneschan
2008-09-04 14:42                       ` Jacob Sparre Andersen
2008-09-06  3:03                       ` Jerry
2008-09-05  8:17                     ` Ludovic Brenta
2008-09-05 15:56                       ` Adam Beneschan
2008-09-05 17:09                       ` Jeffrey R. Carter
2008-09-04 20:49                   ` Simon Wright
2008-08-28 21:16 ` Jerry
2008-08-29  7:41   ` Niklas Holsti
2008-08-30  0:50     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox