Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] C++ Throws
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-27 (22:30)
From: David McClain <David.McClain@A...>
Subject: [Caml-list] C++ Throws
I now see that OCaml is not converting anything, per se... Apparently 
when the throw handler detects an unhandled condition it decides to 
call abort(), against which there is no defense.

However, it also appears that once a C call returns to OCaml, OCaml 
reinstates its own trap handling, overriding anything that may have 
been left in place by the called C function. This is possibly 

But by the same token, at startup, I call a C main() which in turn 
starts up OCaml. That give it a chance to establish its environment. 
Then the main routine designated in OCaml calls another C routine that 
encloses a callback to OCaml within try-catch, and this is being 
overridden by OCaml.

So there appears to be something relatively complex going on across the 
foreign function interface with OCaml and C. This override is what 
frustrates the attempts to create a generic C++ exception handler.

David McClain
Senior Corporate Scientist
Avisere, Inc.
+1.520.390.7738 (USA)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: