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,74166d5f7afa0c82 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 10 Jan 2005 15:03:44 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: Subject: Re: Return_By_Reference or Return_By_Copy (GNAT bug?) Date: Mon, 10 Jan 2005 15:05:19 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-MDRMs11vokApn9zW9DgN0N48TEaD2fMB94oQF7giUDE0KO8Siw4nJvnoaCdt1lyo5A6+BsbAC2cc90R!u8diOtP5uYiq/eFhl2Cg+Z1IpZilk5cpxp4m1RApWUaHQRSzktgcHhodYLgMYFl5sNsXuAdXiQOO X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.22 Xref: g2news1.google.com comp.lang.ada:7621 Date: 2005-01-10T15:05:19-06:00 List-Id: "Duncan Sands" 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.