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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,86ec22e070e319c0 X-Google-Attributes: gid103376,public From: robert_dewar@my-dejanews.com Subject: Re: How do I get this to work?? Date: 1999/01/06 Message-ID: <76uvb4$nth$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 429288126 References: <76s0dp$1v4$1@nntp3.uunet.ca> <76tbvv$ba5$1@nntp3.uunet.ca> X-Http-Proxy: 1.0 x7.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Jan 06 06:20:21 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-01-06T00:00:00+00:00 List-Id: In article , Stephen Leake wrote: > Why does Close_Port need a pointer to a Session? If you > are passing Session to C code, you should probably use > 'Address rather than 'access. Or, define Close_Port to > take an access parameter: I consider both of these pieces of advice wrong. It is Ada 83 thinking to go to untyped addresses for this purpose. Pointers in Ada *and* C are typed, and passing untyped pointers across the interface represents unnecessary weakening of the typing system. It is far better to use Access (or Unchecked_Access which is still far safer than Address). As for using an access parameter, there is a very big trap here that people keep falling into. An access parameter may NOT be null, and typical C interfaces can accept null values. Also, using an access parameter does not obviate the need for using 'Access, though of course it makes it easier to use it. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own