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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f76dd8b9e12e409a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-09 09:54:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Access to subprogram Date: 07 May 2002 12:16:22 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1020788579 23393 128.183.220.71 (7 May 2002 16:22:59 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 7 May 2002 16:22:59 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:23783 Date: 2002-05-07T16:22:59+00:00 List-Id: "David C. Hoos" writes: > From: "Sebastian" > > What is the meaning of this > > " subprogram must not be deeper than access type" > It means exactly what it says. You're trying to take the access > value of a subprogram that is nested more deeply than is the > place where the access type is declared. > > To remedy this, you need to do one of two things, viz.: > > 1. Declare the subprogram at library level -- i.e., not in > a package or nested within another subprogram > > 2. Use 'Unrestricted_Access instead of 'Access, if you're > using GNAT, and if your are certain that the lifetime of > the subprogram is at least as long as the lifetime of the > access type. Rule 2 is actually too restrictive. You can use Unrestricted_Access if you are sure that the lifetime of the program is at least as long as that of all copies of the access value. The compiler assumes copies of the access value can last as long as the access type, but you don't have to. -- -- Stephe