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,7117a84edbedc116,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-14 14:39:16 PST Date: Mon, 14 Apr 2003 17:39:01 -0400 From: Paul Anderson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Interfacing Ada with C Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 209.4.89.67 Message-ID: <3e9b28f8$1_4@newsfeed> X-Trace: newsfeed 1050355960 209.4.89.67 (14 Apr 2003 16:32:40 -0500) X-Original-NNTP-Posting-Host: 209.4.89.67 Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!news-xfer.cox.net!cox.net!news-out.visi.com!petbe.visi.com!209.242.76.12.MISMATCH!newsfeed!not-for-mail Xref: archiver1.google.com comp.lang.ada:36142 Date: 2003-04-14T17:39:01-04:00 List-Id: Hi: I have a need to interface an Ada library with a C program. I am having trouble finding the best way to convert strings between the two worlds. I have a declaration: procedure One(Name : in Wide_String); pragma Export(C, One, "one"); When I compile I get: foo.ads:29:42: warning: type of argument "One" is unconstrained array foo.ads:29:42: warning: foreign caller must pass bounds explicitly Fine, except how do I "pass bounds explicitly" when I call this function in C? The prototype for this function in C would normally be: void one(wide_string w); which doesn't have a slot for the bounds. So where does it go? Alternatively, is there an different way of doing this that avoids this problem? I am using gnat-3.15p. Thanks, Paul.