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.182.81.7 with SMTP id v7mr3268828obx.28.1382027317102; Thu, 17 Oct 2013 09:28:37 -0700 (PDT) X-Received: by 10.50.98.4 with SMTP id ee4mr800577igb.5.1382027316910; Thu, 17 Oct 2013 09:28:36 -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!o2no10051523qas.0!news-out.google.com!9ni50474qaf.0!nntp.google.com!i2no17606397qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 17 Oct 2013 09:28:36 -0700 (PDT) In-Reply-To: <04933b93-d4e1-42b7-9389-5e00a81d13bf@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.59.203.122; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl NNTP-Posting-Host: 129.59.203.122 References: <14357314-5521-4275-9949-9ea42c790147@googlegroups.com> <12b085dd-8e96-477e-bbf3-135330275b69@googlegroups.com> <24ce5a1f-99e6-465c-b986-85fc09e84ee6@googlegroups.com> <04933b93-d4e1-42b7-9389-5e00a81d13bf@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9f4e7024-ca71-4d6a-8969-a9c643c5ad55@googlegroups.com> Subject: Re: Passing a String to a C/C++ Subprogram (Special Case) From: Eryndlia Mavourneen Injection-Date: Thu, 17 Oct 2013 16:28:37 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17455 Date: 2013-10-17T09:28:36-07:00 List-Id: On Thursday, October 17, 2013 8:58:51 AM UTC-5, sbelm...@gmail.com wrote: > If the client might not be in C anyway, I would put the onus on other uni= ts to sort it all out. Even if a non-C client can be written to figure out= a C string, who says the client language can be exported as C convention? = Better to isolate it entirely for when they inevitably change their minds. >=20 > generic > type Client_String_Type is private; > with function Convert_To_Client(x : String) return Client_String_Type; > with procedure External_Prog (y : in Client_String_Type); > ... > begin=20 > ... > External_Prog (Convert_To_Client("Hello World!")); > ... >=20 > -sb Interesting approach. I am assuming that the pragmas Convention and Import will do their jobs pro= perly, and anyway, forcing a generic on the clients is almost certain to be= rejected. -- Eryndlia Mavourneen (KK1T)