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,a965a2c097437981 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-01 11:52:16 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-02!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: ANN: GMGPL Claw Page Date: Wed, 1 May 2002 13:50:57 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <4519e058.0204300527.4bddd952@posting.google.com> <9gBz8.4052$wr1.2380283950@newssvr21.news.prodigy.com> <4519e058.0205010856.191542a4@posting.google.com> X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:23361 Date: 2002-05-01T13:50:57-05:00 List-Id: Ted Dennison wrote in message <4519e058.0205010856.191542a4@posting.google.com>... >tmoran@acm.org wrote in message news:<9gBz8.4052$wr1.2380283950@newssvr21.news.prodigy.com>... >> Claw uses 'access', not system.address, which is not, in fact, always >> the same thing as a C pointer. > >Right. I seem to rememer a discussion here a long time ago, where the >general conclusion was that, while in theory there is no guarantee >System.Adress is implemented in any specific way, in practice >System.Address is more likely to match up with a C pointer than an >access type is. No, that's wrong. If you want a C pointer in your Ada program, all you need to do is declare one: type Access_Whatever is access Whatever; pragma Convention (C, Access_Whatever); If a compiler accepts this and doesn't give you an access type compatible with a C pointer, you've got a seriously buggy compiler! Best find a different one. A compiler might reject it, depending on what Whatever is, but that generally doesn't happen. One a few targets (like the Unisys 2200 compiler we did), Ada accesses and C pointers don't have the same representation. (C pointers are bit pointers on that machine, and we didn't want to pay for that when we didn't need it in Ada.) >I think the only place I ever use it any more is in bindings (where >you are generally at a icky low level anyway). However, I'd have to >check my code to see exactly where it is used. I know I'm rather >liberal with Addresses on unused pointer parameters, but I can't >remember how I was doing *used* pointer parameters. I'm pretty sure I >don't make much use of Interfaces.C.Pointers. Perhaps that's a bad >move? No, using the above is just as good. Just be sure to (somehow) declare that you want a C pointer. As far as "unused" pointer parameters go, we just use Claw.DWord for that on Claw. That is the right size, and portability to another OS is not an issue for Claw. >Anyway, the possible issues with System.Address is why I mentioned it. >I'm certianly willing to learn the proper portable way to get at C >pointers, and from the looks of things, the folks who wrote Claw would >know a thing or two about portability. :-) At least between Windows platform compilers... Randy.