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 Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!proxad.net!usenet-fr.net!ircam.fr!freenix!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <45856807.7090902@obry.net> Date: Sun, 17 Dec 2006 16:53:43 +0100 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: Michael Erdmann Subject: Re: How to get around "access type must not be outside generic unit" References: <45853BDC.5000902@obry.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 17 Dec 2006 16:53:47 CET NNTP-Posting-Host: 86.205.126.58 X-Trace: 1166370827 news.orange.fr 25937 86.205.126.58:2410 X-Complaints-To: abuse@orange.fr Xref: g2news2.google.com comp.lang.ada:7932 Date: 2006-12-17T16:53:47+01:00 List-Id: Michael Erdmann a �crit : > Thanks; Solution 2 works, see below :-) > > Pascal Obry wrote: >> Michael Erdmann a �crit : >>> gnade@hal:~/test> gnatmake -c usage.adb >>> gcc -c usage.adb >>> usage.adb:16:28: access type must not be outside generic unit >>> gnatmake: "usage.adb" compilation error >>> >>> What is the reason for this new compiler check and what can i do >>> about it? >> Solution 1) Declare register using an anonymous access type : >> >> procedure Register >> (Str : in String; A : access function return Boolean); >> > Actually this does not work; compiler complains the anonymous types > are not allowed here. It works as I have tested it. You probably missed the -gnat05 compiler option or you are using a compiler older than mine. Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595