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,9c274893e2f7e55 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 12 Jan 2005 02:38:02 -0600 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Ada to C Interface: Passing Pointers Via System.Address References: <70b31062323c157bbc6b42ccd0ca0945@localhost.talkaboutprogramming.com> X-Newsreader: Tom's custom newsreader Message-ID: Date: Wed, 12 Jan 2005 02:38:03 -0600 NNTP-Posting-Host: 67.161.24.234 X-Trace: sv3-DgFg9zieQOnk92E2mvVN4doeOsHjNFyP+MtLUhqrtb73JI8x04m3uJNjhLZpmPXksXMR5SIFZe+Woxc!7l+QIAStP7Cel4I7X/Ju41/EDpAku/bKVrCoUzkn07Se05YX0Zf/eOl8uCZDog== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.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:7678 Date: 2005-01-12T02:38:03-06:00 List-Id: > struct_ptr : system.address; > > struct_ptr := ada_cfunct1(input1, input2); > > cfunct2(struct_ptr, input3); > ... > at the value of the memory of the struct_ptr after it has gone to ada and > back to c it says that it is null. I must not be using the system.address Could you please post a small, but complete (ie, compiles, but fails to run) program? I'm very confused by the above, not knowing which of the functions are in Ada, which are imported from C, how is struct_ptr's value created, what are the declarations of ada_cfunct1 and cfunct2, etc. I'm guessing that both ada_cfunct1 and cfunct2 are imported C functions. How about putting printout inside ada_cfunct1 just before it returns struct_ptr, another printout just after the "struct_ptr := ...", and a third printout at the beginning of cfunct2, showing the value passed in for struct_ptr.