From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: bindings with Ada 2012 aspects
Date: Wed, 25 Apr 2012 20:47:14 -0500
Date: 2012-04-25T20:47:14-05:00 [thread overview]
Message-ID: <jna9f5$tn1$1@munin.nbi.dk> (raw)
In-Reply-To: jn7egd$scs$1@munin.nbi.dk
"Jerrid Kimball" <jerrid@kimball.co> wrote in message
news:jn7egd$scs$1@munin.nbi.dk...
...
> As I see it, a pragma Export should be directly replaceable by interfacing
> aspects' aspect marks and definitions:
>
> procedure Wait renames PO.Wait;
> pragma Export (C, Wait, "wait");
>
> becomes:
>
> procedure Wait renames PO.Wait
> with Export => True, Convention => C, Link_Name => "wait";
>
> Am I looking at what should be submitted to ACT as a bug?
I believe this replacement is correct, except for one tiny detail:
No language-defined aspects are allowed on renames, and the above is a
renames.
The reason is that almost all language-defined aspects are the same for all
views of an entity, and a rename just introduces another view. Moreover,
this renames "trick" exists for pragmas simply to get around the limitations
of pragmas for overloaded entities, something that is totally unnecessary
for aspects.
I think in this particular case, you are trying to create a wrapper with
this renames (as opposed to "just" another view of the original subprogram).
I think that allowing the original pragma is dubious (although an
implementation is allowed to support Import and Export on anything they
like -- but it certainly is *not* portable).
So, I think you need to replace this subprogram renames by a real subprogram
(one that calls PO.Wait in it's body), and I suspect if you do that you'll
have no problems with the aspects.
Randy Brukardt, Editor, ISO/IEC 8652:tdb. :-)
next prev parent reply other threads:[~2012-04-26 1:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-24 23:54 bindings with Ada 2012 aspects Jerrid Kimball
2012-04-25 7:43 ` Martin
2012-04-25 12:09 ` Stephen Leake
2012-04-25 14:25 ` Jerrid Kimball
2012-04-26 1:47 ` Randy Brukardt [this message]
2012-04-27 20:23 ` Jerrid Kimball
2012-05-02 12:38 ` Natasha Kerensikova
2012-05-03 0:10 ` 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