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-Thread: 103376,c6acbb9f2027b8c9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: volatile vs aliased References: <1128525722.605730.281980@g43g2000cwa.googlegroups.com> <87mzlnomca.fsf@ludovic-brenta.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 06 Oct 2005 18:40:51 GMT NNTP-Posting-Host: 67.3.218.218 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1128624051 67.3.218.218 (Thu, 06 Oct 2005 11:40:51 PDT) NNTP-Posting-Date: Thu, 06 Oct 2005 11:40:51 PDT Xref: g2news1.google.com comp.lang.ada:5458 Date: 2005-10-06T18:40:51+00:00 List-Id: Randy Brukardt wrote: > This seems like a good time to mention that I think the explicit use of > System.Address in Ada 95 and Ada 200Y code is usually a mistake. Since > pragma Convention can be used to ensure that general access types have the > appropriate representation, its rare that Address needs to be used for > interfacing. (There is only a handful of uses of Address in Claw, for > example.) I'd go further. First, I see if I can use an out or in out parameter of a Convention-C non-access type, rather than use a Convention-C access type. Most pointer parameters in C exist to get the effect of out or in out parameters, and "pragma Import (C, ..." will do the right thing for you without messing with access types. Of course, if the C function has both pointer parameters and returns a value, access parameters are the only thing available. Is ease of interfacing to other languages another pro for allowing out and in out parameters for functions, along with making side effects visible? -- Jeff Carter "I soiled my armor, I was so scared." Monty Python & the Holy Grail 71