comp.lang.ada
 help / color / mirror / Atom feed
From: Pascal Obry <pascal@obry.net>
To: Michael Erdmann <michael.erdmann@snafu.de>
Subject: Re: How to get around "access type must not be outside generic unit"
Date: Sun, 17 Dec 2006 16:53:43 +0100
Date: 2006-12-17T16:53:47+01:00	[thread overview]
Message-ID: <45856807.7090902@obry.net> (raw)
In-Reply-To: <ap0g54-fg8.ln1@hal.boavista.snafu.de>

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



  reply	other threads:[~2006-12-17 15:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-17 10:07 How to get around "access type must not be outside generic unit" Michael Erdmann
2006-12-17 12:45 ` Pascal Obry
2006-12-17 14:28   ` Michael Erdmann
2006-12-17 15:53     ` Pascal Obry [this message]
2006-12-17 20:49     ` Robert A Duff
2006-12-18  3:35   ` Brian May
2006-12-18  7:49     ` Jean-Pierre Rosen
2006-12-18 23:15       ` Brian May
2006-12-19  1:48         ` Randy Brukardt
2006-12-19  7:41         ` Jean-Pierre Rosen
2006-12-18 20:32     ` Michael Erdmann
2006-12-18 20:57       ` Randy Brukardt
2007-01-23 18:18 ` [Revisited] How to get around "access type must not be outside generic unit" (was: How to get around "access type must not be outside generic unit") Dmitry A. Kazakov
2007-01-24  0:57   ` Randy Brukardt
2007-01-24 11:42     ` [Revisited] How to get around "access type must not be outside generic unit" Dmitry A. Kazakov
2007-01-24 11:58       ` Ludovic Brenta
2007-01-24 13:46         ` Dmitry A. Kazakov
2007-01-24 20:50       ` Randy Brukardt
2007-01-25 11:07         ` Dmitry A. Kazakov
replies disabled

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