comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Recommendation of safe subset of Ada to use?
Date: Mon, 7 May 2018 19:19:28 -0500
Date: 2018-05-07T19:19:28-05:00	[thread overview]
Message-ID: <pcqqeh$4o3$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 6e66aa5f-9ce0-4f28-ae1b-9bdfeb500a79@googlegroups.com

"Brad Moore" <bmoore.ada@gmail.com> wrote in message 
news:6e66aa5f-9ce0-4f28-ae1b-9bdfeb500a79@googlegroups.com...
...
>See 3.10.2 (3.b/3)
>
>Subclause 3.10.2, home of the accessibility rules, is informally known as
>the "Heart of Darkness" amongst the maintainers of Ada. Woe unto all
>who enter here (well, at least unto anyone that needs to understand any
>of these rules)."
>
>This is because, probably only a very small handful of people on this 
>planet
>actually truly understand the rules. I am not one of those, though I try my
>best, when I need to. And those that do, it is only for a fleeting moment. 
>It
>typically requires a deep dive into the Heart of Darkness. If you reach
>enlightenment, consider yourself lucky.

...and you ought to immediately join the ARG to help the rest of us out... 
;-)

>Randy would be one of the lucky people, but even he will avoid diving into
>the Heart of Darkness if he doesn't need to :-)

Thanks, I think. ;-)

In this particular case, I know the intent because I ended up designing this 
feature. I was able to explain it to Tucker well enough that he agreed that 
the rules were right and sufficient. But whether the wording actually says 
what was meant is hardly known.

The intent for explicitly aliased function parameters is that the 
accessibility check moves to the call. (Note that that doesn't happen for 
procedures, because there's no return object and no return accessibility.) 
So that object has to live longer than the function result; the call to 
Inner in this example doesn't do that and thus it is illegal.

Note that examples of this case were included in ACATS test B641002, 
including one that looks nearly identical to the OP's example. That was 
issued in March 2014, so it's quite possible for older compilers to not make 
the check. If a new compiler doesn't make the check, definitely complain to 
your vendor and tell 'em I sent you. :-)

                        Randy.




  reply	other threads:[~2018-05-08  0:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-05 21:23 Recommendation of safe subset of Ada to use? joakimds
2018-05-05 21:32 ` gorgelo
2018-05-06  7:43   ` Jeffrey R. Carter
2018-05-06  8:45     ` Niklas Holsti
2018-05-06  8:52     ` gorgelo
2018-05-06 13:15     ` Jere
2018-05-06 13:47       ` Jere
2018-05-06 21:28         ` Brad Moore
2018-05-08  0:19           ` Randy Brukardt [this message]
2018-05-08  8:07             ` Simon Wright
2018-05-07 15:54 ` onox
2018-05-08  0:22   ` Randy Brukardt
2018-05-08  0:06 ` 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