> The module doesn't compile on Linux, because GNAT GPL 2014 doesn't
> provide a (static or dynamic) libgnat for the sjlj runtime that is
> compiled with -fPIC. I need -fPIC on all code in order to include it in
> the dynamic library that is the Emacs module. I need the sjlj runtime to
> support raising exceptions in the module; since Emacs is not an Ada
> main, it uses the sjlj exception method.

I am not sure I understand the context.
Do you mean that you need to raise exceptions in the Ada Emacs module,
and have somewhere a piece of Emacs C code (or even maybe lisp code?)
that need to handle such exceptions ?

At least here at Eurocontrol, we have as much as possible avoided
crossing the language barrier with exceptions.
So, the policy is that exceptions never propagate across languages (we
use mostly Ada, with some C libraries such as gtk; callbacks written in
Ada are required to handle all exceptions and not propagate them
to GTK+ or to the main procedure which is also in Ada).

So, why do you need to propagate exceptions outside of the Ada module ?
If really needed, maybe you can avoid that by having the Ada module
interface trapping all exceptions, and then let a small C interface e.g.
calling longjmp ?

The fact that Emacs is not an Ada main does not forbid to use the
zero-cost exception model inside the Ada module.

The Ada RM part B.1 (39/3) recommends the way to allow
a lib in Ada called from another language, including initialising
the library.

With that, it should be possible to use the runtime provided
by GNAT, and use exceptions inside the Ada module
(and if needed, at the API border, translate it into a longjmp).

Philippe

____

This message and any files transmitted with it are legally privileged and 
intended for the sole use of the individual(s) or entity to whom they are 
addressed. If you are not the intended recipient, please notify the sender by 
reply and delete the message and any attachments from your system. Any 
unauthorised use or disclosure of the content of this message is strictly 
prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on 
the part of EUROCONTROL, unless it is confirmed by appropriately signed hard 
copy.

Any views expressed in this message are those of the sender.

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to