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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f0d9db8126fd91cb X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!o36g2000yqh.googlegroups.com!not-for-mail From: xorquewasp@googlemail.com Newsgroups: comp.lang.ada Subject: Re: Converting pointers to non nul-terminated C "strings" to Ada string Date: Sat, 14 Feb 2009 02:41:19 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <6334ebd3-ca8d-4f1c-b96a-b49c20650d31@v15g2000yqn.googlegroups.com> NNTP-Posting-Host: 81.86.41.187 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1234608080 18766 127.0.0.1 (14 Feb 2009 10:41:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 14 Feb 2009 10:41:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o36g2000yqh.googlegroups.com; posting-host=81.86.41.187; posting-account=D9GNUgoAAAAmg7CCIh9FhKHNAJmHypsp User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008122011 Iceweasel/3.0.5 (Debian-3.0.5-1),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3632 Date: 2009-02-14T02:41:19-08:00 List-Id: Yannick Duch=EAne Hibou57 wrote: > > A dirty thing which comes into my mind : when you write > > procedure memory_data > (data : out CS.chars_ptr; > size : out C.int); > > you may doing some assumption about the the compiler's generated code. > In my humble opinion, pointers in C declarations should be mapped to > access types in Ada. There is nothing I know which assert that an Ada > implementation must use access types to implement out parameters. I may indeed. In most cases, I would use access types. I do extremely heavy unit testing and haven't found a compiler/OS/arch combo where the above example doesn't work correctly, however. > To know how to properly handle this, the first requirements is to > exactly know what does datas stands for. It's strictly a binary blob - the output of an encryption function. > Have a nice sunday Likewise!