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!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s72.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: aliased and parameters References: <1154369116.867649.278950@m73g2000cwd.googlegroups.com> <1154372565.780568.165840@p79g2000cwp.googlegroups.com> In-Reply-To: <1154372565.780568.165840@p79g2000cwp.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.176 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s72 1154395885 12.201.97.176 (Tue, 01 Aug 2006 01:31:25 GMT) NNTP-Posting-Date: Tue, 01 Aug 2006 01:31:25 GMT Date: Tue, 01 Aug 2006 01:31:25 GMT Xref: g2news2.google.com comp.lang.ada:6044 Date: 2006-08-01T01:31:25+00:00 List-Id: REH wrote: > > 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). I was referring to the Ada library, not the C library (in this case). There is, for example, a standard Ada binding to POSIX. Are you using it, or are you making your own binding? If the latter, you should probably consider the former. You might also want to look into AdaSockets, which is a fairly platform-independent binding to sockets. In any case, System.Address is not a pointer. There are compilers where a pointer and an Address are the same; there are others where they are different. If portability is an issue, you should not pass an address. Using an address to achieve an overlay is a different matter. This is a perfectly portable use of addresses, but not one that is recommended. If you are building your own binding (probably not a good idea), then you can import the function using an out mode parameter of the desired type, as suggested elsewhere. If, as is likely, you need to receive many different types, you can write a generic to create the bindings. -- Jeff Carter "I like it when the support group complains that they have insufficient data on mean time to repair bugs in Ada software." Robert I. Eachus 91