comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: Ada / Motif Binding Question
Date: Wed, 24 Apr 2002 02:19:09 GMT
Date: 2002-04-24T02:19:09+00:00	[thread overview]
Message-ID: <3CC6165F.90104@telepath.com> (raw)
In-Reply-To: %Elx8.52627$WV1.16784880@typhoon.ne.ipsvc.net

Tony Yu wrote:

>     procedure Exit_Option (W : X_Support.Xt.Widget;
> 
>         Client_Data : X_Support.Xt.Xt_Pointer;
> 
>         Call_Data : X_Support.Xt.Xt_Pointer) is
> 
>         My_String : String (1 .. 625) := (others => ' ');
> 
>         procedure C_Exit (Status : Integer);
> 
>         pragma Import (C, C_Exit, External_Name => "exit");
> 
>         begin
> 
>             C_Exit (0);
> 
>         end Exit_Option;

 >

> After invoking the callback, I get the following error:
> 
>  -> ** MAIN PROGRAM ABANDONED -- EXCEPTION "STORAGE_ERROR" RAISED

You didn't say what Motif bindings you are using. There's no one 
standard set that comes with every compiler (which makes sense, as Win32 
compilers don't typically have Motif around to bind to).

One possibility I see is that "Exit_Option" does not have a "pragma 
Convention (C, ...)" on it. Ada procedures and C functions usually have 
different calling sequences, and Motif expects to be "talking C" to its 
callbacks.

However, some bindings take care of this for you, which is why it 
matters what bindings you have.


Another possibility is that C_Exit() (whatever that is) is causing you 
grief. You could try changing that line to "null;" to see if the crash 
goes away.




  reply	other threads:[~2002-04-24  2:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-23 22:56 Ada / Motif Binding Question Tony Yu
2002-04-24  2:19 ` Ted Dennison [this message]
2002-04-24  3:08   ` Tony Yu
2002-04-26  6:28     ` Christopher Green
2002-04-29 22:55       ` Tony Yu
2002-04-26  2:25 ` Greg Bek
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox