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,34e28efa1a88ae84 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Access procedure to pointer References: <483C48B5.9060303@gmail.com> In-Reply-To: <483C48B5.9060303@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1211918770 12.201.97.213 (Tue, 27 May 2008 20:06:10 GMT) NNTP-Posting-Date: Tue, 27 May 2008 20:06:10 GMT Organization: AT&T ASP.att.net Date: Tue, 27 May 2008 20:06:10 GMT Xref: g2news1.google.com comp.lang.ada:405 Date: 2008-05-27T20:06:10+00:00 List-Id: S�bastien 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". Required where? If at "constant access procedure", then perhaps your compiler doesn't implement this feature of the new standard yet, in which case type Foo_Ptr is access procedure; Access_Foo : constant Foo_Ptr := Foo'Access; Should work. > 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. This is highly compiler dependent. Even if they have the same size, there's no guarantee that they have the same representation. -- Jeff Carter "What's the amount of the insult?" Never Give a Sucker an Even Break 104