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!postnews.google.com!x19g2000prg.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Ada array vs C pointer (call by reference) Date: Fri, 27 Jun 2008 19:17:08 -0700 (PDT) Organization: http://groups.google.com Message-ID: <94d42cb1-3483-4371-a41f-5e265aa793e7@x19g2000prg.googlegroups.com> References: <3de9k.228623$yE1.227772@attbi_s21> <5d649522-50be-4aa5-9dce-cd1daa2bcd0d@p39g2000prm.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1214619428 10068 127.0.0.1 (28 Jun 2008 02:17:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 28 Jun 2008 02:17:08 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x19g2000prg.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:932 Date: 2008-06-27T19:17:08-07:00 List-Id: On Jun 27, 6:15 pm, 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. Got a good disassembler? If it really isn't documented what type of floats it's expecting, and you have no way to determine what C compiler was being used, you're pretty much down to looking at the disassembled code to figure out how it works, or just trying different possibilities with small data samples where you know what the correct result will be, and trying it with different float sizes until you get the right result. I don't know what sort of different answer you were expecting. Ada is a programming language, not a magician. Nobody here is suggesting that in a case like this, that the Ada compiler should be able to figure out how to interface to your library; and if you think they were, you're overinterpreting. Furthermore, even if there were some configuration information in the library itself (such as debug information in a symbol table or DWARF section) that gives information on the expected parameters, there is certainly no language requirement that the Ada compiler go delve into the library file to figure this out, and I doubt that any Ada compiler would actually do so. You're on your own, there. -- Adam