Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Thierry Bravier <thierry.bravier@dassault-aviation.fr>
To: Pascal Brisset <Pascal.Brisset@wanadoo.fr>
Cc: caml-list@inria.fr
Subject: Re: problem with ocamlmktop (contd)
Date: Wed, 04 Nov 1998 18:56:17 +0100	[thread overview]
Message-ID: <36409541.37CA@dassault-aviation.fr> (raw)
In-Reply-To: <13881.64982.392952.452261@whynot>

Pascal Brisset wrote:
> 
> Here is a more complete example demonstrating:
> 
> (1) destructors of global objects being called correctly on exit;
> (2) translation of C++ exceptions to Caml exceptions;
> (3) catching a C++ exception generated by a C++ primitive called
>     through a Caml callback.
> 
> The only trick is that if you really need (3), you have to modify
> libcamlrun.a (found in ocaml-1.07/byterun) as follows:
> 
>

Thanks for helping,

I am not currently trying to map ocaml and C++ exceptions
because it seems that basically, C++ exceptions don't mix
well with setjmp/longjmp. so (2) and (3) are not my priorities
although they are challenging.

(1) is important to me ! Your example uses final ML objects
successfully but I am also interested in making C++ manage
its own C++ global values when entering main and
most of all when leaving main ().

I agree C++ global variables should be avoided and I do my very
best to achieve this goal, unfortunately static variables
in functions (and of course in classes too) also need to be
destroyed at exit () time. This means, for most C++ compilers,
compiling main () in C++ and linking with the C++ linker.

The features of gcc (it can replace g++ as a linker) are
not fully satisfying in my case because I mainly use egcs-1.1
(is it linkable with gcc-2.8.1 ?) and I often try to compile
and link code with other C++ compilers (mainly SparcWorks and xlC).

This explains why I need the -cc and -clinker options
I have previously suggested.

I keep the exceptions management for further explorations.

Cheers

-- 
Thierry Bravier                     Dassault Aviation - DGT / DPR / DESA
78, Quai Marcel Dassault              F-92214 Saint-Cloud Cedex - France
Telephone : (33) 01 47 11 53 07          Telecopie : (33) 01 47 11 52 83
E-Mail :                     mailto:thierry.bravier@dassault-aviation.fr




  parent reply	other threads:[~1998-11-05  7:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-14 16:47 problem with ocamlmktop -output-obj Thierry Bravier
1998-10-15 17:22 ` Xavier Leroy
1998-10-16 10:40   ` Thierry Bravier
1998-10-26 16:03     ` Thierry Bravier
1998-10-30 10:17       ` Pascal Brisset
1998-10-30 17:56         ` problem with ocamlmktop (contd) Pascal Brisset
1998-11-03  9:32           ` Pascal Brisset
1998-11-04 17:56           ` Thierry Bravier [this message]
1998-11-04 16:12   ` problem with ocamlmktop -output-obj luther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36409541.37CA@dassault-aviation.fr \
    --to=thierry.bravier@dassault-aviation.fr \
    --cc=Pascal.Brisset@wanadoo.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox