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,386bb25b61f8f5b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!p79g2000cwp.googlegroups.com!not-for-mail From: "REH" Newsgroups: comp.lang.ada Subject: Re: aliased and parameters Date: 31 Jul 2006 12:02:45 -0700 Organization: http://groups.google.com Message-ID: <1154372565.780568.165840@p79g2000cwp.googlegroups.com> References: <1154369116.867649.278950@m73g2000cwd.googlegroups.com> NNTP-Posting-Host: 192.35.35.34 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1154372569 31384 127.0.0.1 (31 Jul 2006 19:02:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 31 Jul 2006 19:02:49 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: p79g2000cwp.googlegroups.com; posting-host=192.35.35.34; posting-account=lnUIyw0AAACoRB2fMF2SFTIilm8F10q2 Xref: g2news2.google.com comp.lang.ada:6035 Date: 2006-07-31T12:02:45-07:00 List-Id: Jeffrey R. Carter wrote: > REH wrote: > > ... > > recv(socket, Hdr'Address, header_size); > > > > The problem is that some Ada95 compiler are so aggressive with > > optimization that they may not "see" then Hdr is changed by recv. At > > the very less the compiler complains (rightfully so) that Hdr is alised > > but not marked as such. But how do enforce that if I cannot define the > > parameter as aliased? Should I use an access type instead and convert > > it to System.Address, or is there a cleaner way? > > You should not be using 'Address at all. I don't know the definition of > Recv, so I can't say what would be better. If it's an interface to C, > you might want an array or a C-compatible access value. > > Of course, that assumes you can change the library in question. > > -- > Jeff Carter > "Death awaits you all, with nasty, big, pointy teeth!" > Monty Python & the Holy Grail > 20 Thanks Jeff. recv is the standard POSIX (or BSD) socket receive function. It takes a pointer. Yes, I could use an array (as I could still map it to a C pointer). The problem with this is I either have to move the data from its "normal" type into the array (excessive data movement) or I have to map the array over top of my data (which gets us right back to using 'Address). REH