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.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f58edf3a3fc00db X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-21 03:50:04 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Interface to C; Storage_Error Date: Thu, 21 Dec 2000 11:38:59 GMT Organization: Deja.com Message-ID: <91sq4j$tpr$1@nnrp1.deja.com> References: <91ondg$lpu$1@nnrp1.deja.com> NNTP-Posting-Host: 205.232.38.41 X-Article-Creation-Date: Thu Dec 21 11:38:59 2000 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x73.deja.com:80 (Squid/1.1.22) for client 205.232.38.41 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:3316 Date: 2000-12-21T11:38:59+00:00 List-Id: In article , "DuckE" wrote: > function GetNextVal( srv : access Srv_Handle; > rslt : access Srv_Handle; > ctx : access Ctx_Handle; > name : C.Char_Array; > dbl : access C.Double; > flt : access Flt_Handle ) return > C.Int; > pragma Import( C, GetNextVal ); A general warning is the reminder that "access foo" is not a generally usable translation of a pointer parameter in C, since in the Ada case, null values would not be permitted. > Since the "C" prototype is using "char *" I suspect you need > to allocate the data to send to the function. I see no reason for this suspicion, either on the basis of how any compiler I know about works, or from the RM, please tell us where you got this idea from :-) > Also... beware of callbacks. I'm not sure if GNAT behaves > the same, but with ObjectAd if you are inside of a callback > from a "C" library and you attempt to perform an Ada tasking > operation (ie: Rendevous or Protected Operation) bad things > happen. That sounds like a significant restriction. GNAT has no such restriction. Sent via Deja.com http://www.deja.com/