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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7661856b1d8dc0ab,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!t69g2000cwt.googlegroups.com!not-for-mail From: "hannibal.holm@gmail.com" Newsgroups: comp.lang.ada Subject: Calling Ada from C Date: 22 Feb 2007 07:46:48 -0800 Organization: http://groups.google.com Message-ID: <1172159208.098190.143360@t69g2000cwt.googlegroups.com> NNTP-Posting-Host: 192.171.1.126 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1172159221 26895 127.0.0.1 (22 Feb 2007 15:47:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 22 Feb 2007 15:47:01 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: t69g2000cwt.googlegroups.com; posting-host=192.171.1.126; posting-account=JXgfzQ0AAADUkl9D_z4TRkiYQyMbku2z Xref: g2news2.google.com comp.lang.ada:9415 Date: 2007-02-22T07:46:48-08:00 List-Id: I have a slight problem trying to call an Ada function from a C function. I need to pass in an unconstrained array to the Ada function. The problem is how I specify the size. This is probably very simple, but I am more or less just getting started with Ada, comming from a C-background. My code yealds warnings like this (when compiled with GNAT): foo.ads:50:23: warning: type of argument "Insert_C.Packet" is unconstrained array foo.ads:50:23: warning: foreign caller must pass bounds explicitly I have been searching a lot in order to figure out what to do about this, but all the FFI documentation is for calling C-functions from Ada, and some very simple examples of how to call ada functions that take primitive arguments (ints, and similar items). Anyone who know how to pass in the bounds explicitly?