EH in C (was: Re: (lack of) Thread-safe exceptions on AIX (gcc-2.95.1)
Bill Tutt
rassilon@list.org
Tue Feb 1 14:13:00 GMT 2000
On Tue, 1 Feb 2000, Zack Weinberg wrote:
[__try/__catch]
> invents fewer new concepts than adding a __finally. Also note that
> pthread_cleanup_pop() does not always execute the cleanup function you
> registered earlier.
>
While its true that it invents fewer concepts, I'm not exactly sure why
you think thats a useful metric to use when it causes the sideeffect of
having to write the cleanup code twice.
> Another thing to think about - it'd be Nice if setjmp/longjmp
> interoperated with throw/catch, partially because that would make the
> behavior politer to C++ code, partially because the compiler would
> comprehend control flow better. (On second thought, there may be code
> out there that expects that longjmp() will go directly to its target,
> not visiting catch handlers and not collecting $200.)
>
Just as more of an FYI, MS stuck versions of setjmp/longjmp in setjmpex.h
or something similar that does use the stack unwinding information.
Bill
More information about the Gcc
mailing list