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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,35a7a7cda284a484 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-13 18:49:57 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!feeder.via.net!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: newbie q: access types getting address References: X-Newsreader: Tom's custom newsreader Message-ID: <8LUV6.89298$%i7.66087391@news1.rdc1.sfba.home.com> Date: Thu, 14 Jun 2001 01:49:56 GMT NNTP-Posting-Host: 24.7.82.199 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 992483396 24.7.82.199 (Wed, 13 Jun 2001 18:49:56 PDT) NNTP-Posting-Date: Wed, 13 Jun 2001 18:49:56 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:8708 Date: 2001-06-14T01:49:56+00:00 List-Id: >I want to get the address of a particular object that is getting passed into >... >in Ada, but this is for a Windows API call binding. Sorry if this is For a Windows binding you almost certainly want 'access, not 'address. (Though System.Address_To_Access_Conversions can interconvert the two.) >return &Obj; >and >return &Array[5]; return Obj'access; return Array(5)'access; If you get accessibility level errors, the compiler is telling you that you are creating a pointer that may outlive what it's pointing to. If you're sure what you are doing is safe, you can return Obj'unchecked_access; etc. You'll see a lot of that in Ada code accessing Windows' API.