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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b16d5240727960c4 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!wn52feed!worldnet.att.net!attbi_s01.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: C bindings, Interfaces.C.Pointers etc. References: X-Newsreader: Tom's custom newsreader Message-ID: <7N8oc.26984$z06.4466479@attbi_s01> NNTP-Posting-Host: 24.6.132.82 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s01 1084299459 24.6.132.82 (Tue, 11 May 2004 18:17:39 GMT) NNTP-Posting-Date: Tue, 11 May 2004 18:17:39 GMT Organization: Comcast Online Date: Tue, 11 May 2004 18:17:39 GMT Xref: controlnews3.google.com comp.lang.ada:448 Date: 2004-05-11T18:17:39+00:00 List-Id: >4) Is there some convenient shortcut to avoid using I.C.P? > perhaps by declaring an Ada constrained array much larger than > intended, and using a subset. That's what I'd do. You clearly can't expect Ada to bounds check an array that has no bounds, ie, a C array. If C is doing all the allocating there's no memory penalty. If Ada is doing the allocating, you might want to tell Ada you have a (fixed size) one dimensional array of pointers to elements, rather than to arrays, and let C assume a pointer to a first element is a pointer to an array.