This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

EH in C (was: Re: (lack of) Thread-safe exceptions on AIX (gcc-2.95.1)


> David Starner wrote:
> Interesting. Wouldn't it be better just to add C++ exception handling,
though?
> It's substantially the same, but C++ EH is more general and has clear
effects
> with C++ EH over current implementations.

Um.. C++ exception handling semantics depend on classes/structs being
able to have destructors. Thus MS's creation of __finally.  The
difference between picking __catch vs. __except I would imagine was
done so it was visually different from the C++ spelling as to try and
reduce confusion as much as possible.

I think the only additional feature SEH has that C++ EH doesn't is the
ability to return to the code that through the exception. (returning
-1 from the __except filter expression)

The general keyword usage seems fairly sane to me, the extra features
that C++ doesn't require, and the exact MS specific behavior (aka
special return values from the __except() filter expression, and
resuming execution at the exception point) could certainly be tweaked
in some other way, but I'm sure the mingw32 folks would prefer the
semantics are as close as possible to the MS semantics so that they don't
have to alter their already existing code when they compile it with
mingw32.

So I guess I'm not sure why you think C++ EH is more general than SEH
since SEH is C++ EH without the language feature of destructors, and
SEH can restart execution at the point of failure.

> Less of a learning curve for most people, and if anyone 
> needs Microsoft EH, it shouldn't be that hard to port 
> over.

Bill



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]