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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,72a0bc6240d264e3 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Access and alias Date: 2000/04/07 Message-ID: <8ckeup$9ed$1@nnrp1.deja.com>#1/1 X-Deja-AN: 607846674 References: <8cfnpd$3h7$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x42.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Apr 07 10:57:34 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-04-07T00:00:00+00:00 List-Id: In article , tmoran@bix.com wrote: > As I understand it, if a function has an access type as a > parameter, and has a "pragma import", then the compiler is > required to do whatever might be necessary to convert its idea > of an access value in Ada to the called language's idea of an > access value. This is actually quite wrong from a pure language point of view, there is absolutely no reason why a convention Ada access type should look anything like a pointer. What you say above is strictly only true if the type is declared to have Convention C on the Ada side. If the compiler DID use a different representation for the two, I would say your prescription would be quite wrong, there is absolutely no requirement in the RM for such conversions, and pragmatically it would be a bad idea to molest parameters in this way. In practice compilers usually use the same representation for convention Ada and convention C access values, at least for all cases except pointer-to-unconstrained, so the issue of conversion does not arise, and that is probably where Tom's misunderstanding comes from (i.e. this pretty serious misunderstanding does not affect things most of the time). Sent via Deja.com http://www.deja.com/ Before you buy.