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: a07f3367d7,d23826ff0acb491b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!l9g2000yqi.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Gem 39 - compiler specific? Date: Sat, 5 Sep 2009 13:45:45 -0700 (PDT) Organization: http://groups.google.com Message-ID: <79b62678-84b6-49a2-a943-2212658bedfe@l9g2000yqi.googlegroups.com> References: <9e0bbbcd-260f-48ed-8043-d6280c633e85@h3g2000yqa.googlegroups.com> <19268dbw82hf4.aii8as09aapk.dlg@40tude.net> <4bff103b-1797-4e2b-9dcf-7466b667c59b@d9g2000prh.googlegroups.com> <1s8kuin5t96vr$.1taw9mluqlplz$.dlg@40tude.net> <1bf4b63a-1e2d-41f1-97c6-8324d4b829ff@z3g2000prd.googlegroups.com> <6o3frhrv0n0p$.8wj0gszs5h07$.dlg@40tude.net> <1udpwiw4u1cj5$.ff4ssnbb90vn$.dlg@40tude.net> NNTP-Posting-Host: 83.79.54.167 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1252183545 2812 127.0.0.1 (5 Sep 2009 20:45:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 5 Sep 2009 20:45:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l9g2000yqi.googlegroups.com; posting-host=83.79.54.167; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8189 Date: 2009-09-05T13:45:45-07:00 List-Id: On 5 Wrz, 00:41, sjw wrote: > Then I don't quite see why you needed to convert at all? > > =A0 =A0procedure P (Q : Fancy_Access); > =A0 =A0pragma Import (C, Q); You meant pragma Import (C, P); Good question. B.3/68: "An Ada access T parameter, or an Ada out or in out parameter of an elementary type T, is passed as a t* argument to a C function, where t is the C type corresponding to the Ada type T." This is the only guarantee concerning access types when interfacing with C. The paragraph is clearly constrained to those types that have some corresponding type on the C side. For example access to Interfaces.C.int will be passed as int*. But I see nothing about access to types that have no C counterpart. In particular, access values to class-wide types are not covered at all. This is the reason why I think that passing address (seen as void* on the C side) is the proper way. All corrections to this reasoning are highly welcome. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada