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=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!news4.google.com!newsfeed.stanford.edu!sn-xit-03!sn-xit-08!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "ReversedBias" Newsgroups: comp.lang.ada Subject: Re: Ada to C Interface: Passing Pointers Via System.Address Date: Wed, 12 Jan 2005 02:36:51 -0500 Organization: www.talkaboutprogramming.com Message-ID: <70b31062323c157bbc6b42ccd0ca0945@localhost.talkaboutprogramming.com> X-Newsreader: www.talkaboutprogramming.com Content-Type: text/plain; References: <8e19522cfe30bb2ccbfe1393fdd6b235@localhost.talkaboutprogramming.com> <5_SdnaIyCMxrCXncRVn-qg@comcast.com> X-Complaints-To: abuse@supernews.com Xref: g2news1.google.com comp.lang.ada:7677 Date: 2005-01-12T02:36:51-05:00 List-Id: I have something like this in my ada code (i don't have the exact code in front of me right now so my syntax might be off) struct_ptr : system.address; struct_ptr := ada_cfunct1(input1, input2); cfunct2(struct_ptr, input3); Where cfunct1 returns a struct pointer and cfunct2 is a second c function that needs the pointer as an input. When I try and run it I get a segmentation fault and a core dump (it compiles fine). I suspect that I am not declaring the system.address correctly. I know that my C code is correct, and that it allocates the pointer correctly. However when I look 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 correctly? Thanks for your help,