comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Return_By_Reference or Return_By_Copy (GNAT bug?)
Date: Mon, 10 Jan 2005 15:05:19 -0600
Date: 2005-01-10T15:05:19-06:00	[thread overview]
Message-ID: <FKadnUS6t-UscH_cRVn-vg@megapath.net> (raw)
In-Reply-To: mailman.38.1105189579.527.comp.lang.ada@ada-france.org

"Duncan Sands" <baldrick@free.fr> wrote in message
news:mailman.38.1105189579.527.comp.lang.ada@ada-france.org...
> Hi Randy,
>
> > > I was playing around with return by reference to see if it is possible
to
> > > get unserialized access to a protected variable using the Rosen trick
(it
> > is,
> > > see example below, especially the protected object P in package C).
Will
> > this
> > > be illegal in Ada 2005?
> >
> > Yes, it will.
>
> it seems to be legal to have a protected procedure pass out an access to a
> protected variable, allowing that variable to be accessed without
serialisation.
> I somehow expected this to be illegal...  Is there any legitimate use for
it?

I would have expected that accessibility checks would have made that
illegal. Or that it would have been legal in Ada 95. But I haven't been able
to convince myself that either is the case. I'm pretty sure that no one has
thought about this as a problem.

Since we're still fixing problems in the standard, there is still time to
consider this issue. Therefore, I'd suggest writing an example using Ada
2005 anonymous access functions and sending it to Ada-Comment@ada-auth.org
along with your question. That way, it will get some airing in front of the
ARG.

                       Randy.






  reply	other threads:[~2005-01-10 21:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-31 11:07 Return_By_Reference or Return_By_Copy (GNAT bug?) Duncan Sands
2004-12-31 21:32 ` Randy Brukardt
2005-01-01 22:00   ` Duncan Sands
2005-01-03 23:11     ` Randy Brukardt
2005-01-04  4:20       ` Larry Kilgallen
2005-01-04 23:27         ` Randy Brukardt
2005-01-08 13:06       ` Duncan Sands
2005-01-10 21:05         ` Randy Brukardt [this message]
2005-03-08 16:12           ` Duncan Sands
replies disabled

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