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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.93.45 with SMTP id k33mr41539760yhf.19.1381871590622; Tue, 15 Oct 2013 14:13:10 -0700 (PDT) X-Received: by 10.50.83.6 with SMTP id m6mr117055igy.1.1381871590578; Tue, 15 Oct 2013 14:13:10 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!i2no14540754qav.0!news-out.google.com!9ni44722qaf.0!nntp.google.com!i2no14540753qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 15 Oct 2013 14:13:09 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.59.203.120; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl NNTP-Posting-Host: 129.59.203.120 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9ee842b6-b053-4f4e-94df-66459ec1fb7c@googlegroups.com> Subject: Re: Passing a String to a C/C++ Subprogram (Special Case) From: Eryndlia Mavourneen Injection-Date: Tue, 15 Oct 2013 21:13:10 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17429 Date: 2013-10-15T14:13:09-07:00 List-Id: On Tuesday, October 15, 2013 3:59:21 PM UTC-5, Jeffrey Carter wrote: > On 10/15/2013 12:54 PM, Eryndlia Mavourneen wrote: >=20 > > . . . >=20 > If I were doing this, I would wrap each in an Ada subprogram that ensures= the=20 > String will be passed correctly to C. Ultimately it will be less effort. >=20 Thanks, Jeff. This could be a good way to manage things. Unfortunately, I= can not guarantee that I can perform a trim operation or that the last cha= racter is indeed not being used (for the placement of a nul). I suppose I = could create the wrapper, as you said, and copy the String (1 .. size) to a= String (1 .. size + 1) and place a nul in the last character of the target= string. Of course, this does not add a lot of overhead for short strings,= but it is a hard real-time system. It sounds as if I need to get with my people and get a further, clear conse= nsus about how this stuff is going to be used, in reality. -- Eryndlia Mavourneen (KK1T)