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,5a84d5077c54a29d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada array vs C pointer (call by reference) References: <3de9k.228623$yE1.227772@attbi_s21> <5d649522-50be-4aa5-9dce-cd1daa2bcd0d@p39g2000prm.googlegroups.com> In-Reply-To: <5d649522-50be-4aa5-9dce-cd1daa2bcd0d@p39g2000prm.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <_yj9k.228978$yE1.102791@attbi_s21> NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1214629178 12.201.97.213 (Sat, 28 Jun 2008 04:59:38 GMT) NNTP-Posting-Date: Sat, 28 Jun 2008 04:59:38 GMT Organization: AT&T ASP.att.net Date: Sat, 28 Jun 2008 04:59:38 GMT Xref: g2news1.google.com comp.lang.ada:933 Date: 2008-06-28T04:59:38+00:00 List-Id: Adrian Hoe wrote: > > Like those previous posts in this thread (by Maciej, Keith, et al), it > depends on compiler implementation. The question is, the C library > (which I am interfacing with) is compiled by unknown C compiler with > unknown switches and the author cannot be contacted. The only > documentation I have is the C header file. Can Ada safe implementation > guarantee a safe interface in this case? Or rather, how Ada can > guarantee a safe interface? Interfaces.C should be considered an interface to some specific C compiler, not to C in the abstract. GNAT's version is an interface to gcc C, for example. Whether that compiler is the same as the one used to compile your library, or uses the same representations, is anyone's guess. But on most platforms, most C compilers use similar representations, so you're probably OK using Interfaces.C. If not, then you'd be in the same boat if you used a C compiler. -- Jeff Carter "Hello! Smelly English K...niggets." Monty Python & the Holy Grail 08