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=unavailable 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!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada array vs C pointer (call by reference) Date: Tue, 1 Jul 2008 16:31:36 -0500 Organization: Jacob's private Usenet server Message-ID: References: <3de9k.228623$yE1.227772@attbi_s21> <5d649522-50be-4aa5-9dce-cd1daa2bcd0d@p39g2000prm.googlegroups.com> <94d42cb1-3483-4371-a41f-5e265aa793e7@x19g2000prg.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1214948678 8369 69.95.181.76 (1 Jul 2008 21:44:38 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 1 Jul 2008 21:44:38 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:982 Date: 2008-07-01T16:31:36-05: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. In that case, strictly speaking, you couldn't use the library from C, or Ada, or any other programming language. If you're willing to assume that the code conforms to the normal conventions for the target (that is, works like the "standard" C compiler), then of course Ada (via Interfaces.C) will work the same way. But clearly, if this is compiled by a "weird" C compiler, you couldn't use it from gcc or MS-C anymore than you could use it from Ada. You could only use it from the "weird" C compiler, and your problem statement says that you don't know what that is. In other words, it is unusable, and you'd be best off rewriting it in Ada (or even a known C). Nothing Ada-specific about that. Randy.