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,463c5796782db6d8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-09 11:23:47 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: [Spark] Arrays of Strings Date: 9 Apr 2003 11:23:47 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0304091023.1f18f74c@posting.google.com> References: NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1049912627 15474 127.0.0.1 (9 Apr 2003 18:23:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 9 Apr 2003 18:23:47 GMT Xref: archiver1.google.com comp.lang.ada:36027 Date: 2003-04-09T18:23:47+00:00 List-Id: "Eric G. Miller" wrote in message news:... > > Try the following out (rename "/tmp/hello" as appropriate)... > > -- executor.ads > with Interfaces.C.Strings; > > package Executor is > > package C renames Interfaces.C; > > function Execve (Filename : C.Strings.Chars_Ptr; > Argv : C.Strings.Chars_Ptr_Array; > Envp : C.Strings.Chars_Ptr_Array) return C.Int; > > pragma Import (Convention => C, > Entity => Execve, > External_Name => "execve"); > The problem is that C.Strings.chars_ptr_array isn't necessarily C-compatible, because the RM doesn't promise that it is. The other issue is that char_ptr_array is unconstrained, which means it'll try to pass dope over the interface, which is basically meaningless. Instead of passing array (unconstrained) array type, pass an array access type instead. A component pointer (here, an access type that designates type chars_ptr) would work too, as I showed in my previous post.