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,CP1252 X-Google-Thread: 103376,f948976d12c7ee33 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-03 22:05:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc03.POSTED!not-for-mail Message-ID: <3F050B1C.2010508@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Boeing and Dreamliner References: <3EFC6FC2.B96DAEA4@adaworks.com> <1056731513.272294@master.nyc.kbcfp.com> <3EFF2F6D.3793971@adaworks.com> <3F00E081.898E3C4A@adaworks.com> <94idnb1PMcZDZ5miXTWJiQ@gbronline.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 24.62.164.137 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1057295139 24.62.164.137 (Fri, 04 Jul 2003 05:05:39 GMT) NNTP-Posting-Date: Fri, 04 Jul 2003 05:05:39 GMT Organization: AT&T Broadband Date: Fri, 04 Jul 2003 05:05:39 GMT Xref: archiver1.google.com comp.lang.ada:40040 Date: 2003-07-04T05:05:39+00:00 List-Id: Wesley Groleau wrote: > John R. Strohm wrote: > >> types in Ada resemble those of pointers in other languages, the Ada >> compiler-writer is under NO obligation to implement access types using >> physical pointers. >> >> Is this correct? > > What is a physical pointer? An address? > If so, you are correct. I have found bugs > where a programmer thought (incorrectly) > that they could pass an access value to C > for a pointer instead of passing The_Access.all'Address I would go further and say that there are many places in Ada where an access value CANNOT be implemented as a simple physical pointer. The simplest example is an access to subprogram, where you need to pass both the code AND the environment/closure. This is not new to Ada, and in fact I could probably recall offhand how this was handled in several PL/I compilers. (Multics PL/I used three "physical" pointers, while Stratus used two.) Then there are things like bit pointers and bit slices that need to point to something smaller than an address. Wesley Groleau's idiom will always work if anything works. But there are things you just can't do. (For example passing a pointer to a nested Ada subprogram to C probably won't work if there are any "uplevel" references. One of the nice things about OpenVMS is the common calling sequence for all languages, so if you do pass a "fat" pointer, the C environment knows what to do with it.) -- Robert I. Eachus �In an ally, considerations of house, clan, planet, race are insignificant beside two prime questions, which are: 1. Can he shoot? 2. Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and Steve Miller.