comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Access procedure to pointer
Date: Tue, 27 May 2008 15:27:44 -0700 (PDT)
Date: 2008-05-27T15:27:44-07:00	[thread overview]
Message-ID: <400d6cf9-07e7-4336-acd8-b7e73df32a1f@b5g2000pri.googlegroups.com> (raw)
In-Reply-To: 483C48B5.9060303@gmail.com

On May 27, 10:45 am, Sébastien <seb.mor...@gmail.com> wrote:
> Ludovic Brenta a écrit :
>
> > procedure Foo;
>
> > Access_Foo : constant access procedure := Foo'Access;
>
> > Foo_Address : constant System.Address := Foo'Address;
> > Foo_Address : constant System.Address := Access_Foo.all'Address;
>
> It was refused by the compiler, "subtype mark is required here".

Where?  If it's complaining about "constant access procedure", that's
an Ada 2005 construct that some compilers may not yet handle.  In any
case, that's not the point.  It sounded from your original post that
you might already have an access-to-procedure object, and Ludovic just
gave an example of what your declaration might look like, I think.
But if you already have an access-to-procedure object X, just use
X.all'Address, however you declare the type of X.  If you don't have
one, you don't need to create one just to get the procedure address.


> I succeed using an unchecked conversion, looks like access to a
> procedure has the same size than System.address since I didn't get any
> warning.

Don't count on this always being the case.  Access-to-procedures often
have to carry extra information besides just the address.

                               -- Adam



  parent reply	other threads:[~2008-05-27 22:27 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 11:19 Access procedure to pointer Sébastien
2008-05-27 12:05 ` Ludovic Brenta
2008-05-27 17:45   ` Sébastien
2008-05-27 18:26     ` Dmitry A. Kazakov
2008-05-28  9:06       ` Sébastien
2008-05-28 10:13         ` Jean-Pierre Rosen
2008-05-28 14:57           ` Sébastien
2008-05-28 15:26             ` Jean-Pierre Rosen
2008-05-28 18:16               ` Jeffrey R. Carter
2008-05-28 18:30                 ` Robert A Duff
2008-05-28 21:36               ` Adam Beneschan
2008-05-28 23:02                 ` Sebastien Morand
2008-05-29  0:58                   ` Jeffrey R. Carter
2008-05-29  9:06                     ` Sébastien
2008-05-29 20:20                       ` Jeffrey R. Carter
2008-05-29  8:43                   ` Jean-Pierre Rosen
2008-05-29 10:18                     ` Sébastien
2008-05-29 11:34                       ` Jean-Pierre Rosen
2008-05-31  5:52                   ` Stephen Leake
2008-06-02 12:24                     ` Sébastien
2008-06-02 12:55                       ` Georg Bauhaus
2008-06-02 18:19                       ` Jeffrey R. Carter
2008-06-02 18:25                         ` Pascal Obry
2008-06-03 10:06                         ` Sébastien Morand
2008-06-03 13:26                           ` Ed Falis
2008-06-03 19:41                       ` Stephen Leake
2008-06-02 15:35                     ` Adam Beneschan
2008-06-02 17:11                       ` Jean-Pierre Rosen
2008-06-03 19:43                       ` Stephen Leake
2008-05-28 15:29             ` Sébastien
2008-05-28 17:00           ` Simon Wright
2008-05-27 20:06     ` Jeffrey R. Carter
2008-05-27 22:27     ` Adam Beneschan [this message]
2008-05-27 16:51 ` Jeffrey R. Carter
2008-05-27 17:42   ` Sébastien
2008-05-27 20:02     ` Jeffrey R. Carter
2008-05-27 20:45     ` Jacob Sparre Andersen
2008-05-28  8:48       ` Sébastien
2008-05-28 20:41         ` Jacob Sparre Andersen
replies disabled

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