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,8f7d6c5172a1d41b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 18 Dec 2006 14:56:17 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <45853BDC.5000902@obry.net> <4586FAC4.2000003@snafu.de> Subject: Re: How to get around "access type must not be outside generic unit" Date: Mon, 18 Dec 2006 14:57:15 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-bAbqBh3GJ5sYBHEIKUzNkB+N51Gm7FGLy+SQuJhE5Q7u573s8BrsR8cmWEBj7x7Sl7JzSzZEvjQtJDl!FsKdjssU/ohxJ+coolMEEvm6mTL2mnKX62K56+5/EiLQRwQN5zGrEAwSQ5BDwLtsDE4gnDN6DGyY!HlQdK0qbgLEKmw== 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.32 Xref: g2news2.google.com comp.lang.ada:7946 Date: 2006-12-18T14:57:15-06:00 List-Id: "Michael Erdmann" wrote in message news:4586FAC4.2000003@snafu.de... > Brian May wrote: ... > > I would have thought since Install was defined within the generic > > unit, Install'Access would be OK. > > > > Or does Install'Access imply a temporary local variable? > > > > Put another way, how can you create a dangling pointer with > > Install'Access but not Install_Access? > > This is exactly what came into my mind when i was looking > at the offending code. Jean-Pierre explains it well. If you instantiate the generic inside a procedure, the access value could last longer than the procedure it points at. That's a no-no. Since generic bodies use "assume-the-worst" legality rules, it is illegal because it *might* happen. It should be noted that this rule dates back to Ada 95 (although it was poorly described in Ada 95). AI95-229 explains the issues, find it on www.ada-auth.org. Randy.