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: "Chris Warwick" Subject: Re: How do I get this to work?? Date: 1999/01/06 Message-ID: <770ifd$qui$1@goblin.uunet.ca>#1/1 X-Deja-AN: 429540681 References: <76s0dp$1v4$1@nntp3.uunet.ca> <76tbvv$ba5$1@nntp3.uunet.ca> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: UUNET Canada News Transport Newsgroups: comp.lang.ada Date: 1999-01-06T00:00:00+00:00 List-Id: Stephen Leake wrote in message ... >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 am indeed passing this to some C code, and I realize that what I am doing is cheating, just a little. The reason is I can't seem to get the stuff to the C function by value, if I pass it by reference its happy, but it barfs when I try to do it by value. My old trick of translating pointers into Ada types by creating a function to return the record by value also doesn't work... >function Close_Port (Session : access Session_Type); > >If you really, really need the interface you've given, >'unchecked_access will eliminate the error message. Thanks, it does indeed eliminate the error, but it leaves me with a bad taste. Somewhat like resorting to an unchecked_conversion. Is there a "proper" way to do this, or am I stuck with the unchecked solution?