Re: Libification project (SoC)
- From
Matthieu Moy <matthieu.moy@imag.fr>
- Date
- Mar 16, 2007, 08:58 UTC
- Message-ID
- <vpqveh15zvn.fsf@olympe.imag.fr>
- In-Reply-To
- <45FA501B.FA5B9F30@eudaptics.com>
Johannes Sixt <J.Sixt@eudaptics.com> writes:
Show 5 quoted lines
> You could think about longjmp(3)ing out into main(), which would have to > setjmp(3). But in order to clean up intermediate frames, you would have > to have a stack of setjmp/longjmp buffers. > > Oh, well, how do I *love* them C++ exceptions!
You can have exceptions in C too.
I've used it a bit while contributing to Baz 1.x (the fork of tla). The library used was cexcept ( http://cexcept.sourceforge.net/ ).
As you mention, jumping is the easy part, and cleaning up is the hard one. Baz was using talloc, hacked to somehow work with cexcept. The mini-library doesn't seem to be available as a tarball anymore, so I did the checkout+targz in case someone's curious to have a look, and lazy enough not to install baz to get it:
http://www-verimag.imag.fr/~moy/tmp/talloc-except--2.0.1--patch-2.tar.gz
This stuff is not supported anymore, but very small anyway.
-- Matthieu