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-Thread: 103376,ac6f6c30c45f808a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 17 Jan 2005 15:36:52 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <41E7F653.2F899F47@alfred-hilscher.de> Subject: Re: Ada equivalent for C-pointer? Date: Mon, 17 Jan 2005 15:38:41 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: <7L6dnULqKptpsnHcRVn-1g@megapath.net> NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-w5LVCNrR4yIjV7HceAId+INzJep8awMEL4xs9L1KdvWVajEGp3gjYWAAToBQFMxSNSR6OkmrqdVddB1!jGlDbZvvFEYBnkU+q8HaTwXy/cPnB+aWC+k23ctInwv38nfoYuc7odlvkq3IV1JUGDMn662BDcM3 X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.22 Xref: g2news1.google.com comp.lang.ada:7879 Date: 2005-01-17T15:38:41-06:00 List-Id: "Pascal Obry" wrote in message news:u651y3bfs.fsf@obry.net... > > Nick Roberts writes: > > > For example, if there is a C function defined thus: > > > > int wibble(int *n); > > > > then in Ada you can declare: > > > > function Wibble (Number: in out Interfaces.C.int); > > pragma Import(C,Wibble,"wibble"); > > > > and it should work. (Obviously, you must link the C functions in somehow.) > > I don't think so. Here Number will be passed by value, no? And you also need > the returned value ;) Go re-read B.3(63-71). In this case, specifically B.3(68). Now, that is only "advice", but compilers are strongly encouraged to follow "advice", and I think that they all do in this area. (Otherwise, Claw wouldn't have been possible - we use the same pragma Imports for all of the compilers.) Randy.