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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,61006929d3e14455 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!npeer.de.kpn-eurorings.net!netnews.web.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Ada Pointer Size Problem Date: Wed, 13 Oct 2004 10:07:26 +0200 Organization: AdaCL Message-ID: <219535369.f3yiO4m2UC@linux1.krischik.com> References: <35f054ea.0410101150.25bec2f5@posting.google.com> <35f054ea.0410121044.bf19fea@posting.google.com> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1097655644 01 4565 Lo5oXfMlDdKTulP 041013 08:20:44 X-Complaints-To: usenet-abuse@t-online.de X-ID: TtlaKcZGweQrKE4y8+UPQbhSwY4pFiltaywrY6C7oIB8x2MKYzgZom User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:5136 Date: 2004-10-13T10:07:26+02:00 List-Id: skidmarks wrote: > Stephen Leake wrote in message > news:... >> aschwarz@acm.org (skidmarks) writes: > >> > I've looked at the 'info' tex file included with the >> > gcc distribution and so far have not found how to >> > change a 64-bit pointer to a 32-bit pointer. >> >> Why do you want to do that? A pointer to an integer is not a pointer >> to a string. > > I misspoke, perhaps sarcastically. I don't want to change pointer sizes > and you have gone far to explain what I'm seeing. Although the reason > for including the dope vector as part of an Access Type eludes me, the > explanation I understand. (The elusion is because it seems just as > reasonable to 'point' to a dope vector when specifying an access type > rather than including the dope vector as the Access Type.) Albeit, > thanks to all for the clarification between System.Address and Access > Type. Actually the compiler vendors are free to choose the implementation thats suits them best. >> > I've thought that maybe I am getting the dope vector size associated >> > with the String_Ptr but this really doesn't make sense. >> > > See above. To resolve this (type of) difficulty locally - for Ada83 > interfaces to C primarily, we do the following: > > A_Access := array'Access > B_Pointer := array(array'First)'Address > > and for the purists, THIS IS NOT TRUE ADA, so don't flame me because > it's not true Ada. I use this trick as well from time to time in Ada 95. It's faster and saves memory. Even cooler: type Ada_String is String (1.. C_String_Len); for Ada_String'Address use C_String'Address; With Regads Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com