Web lists-archives.org

Re: [Mingw-users] GCC 4.3.0 20080502 (alpha) Released - Please helpus test it!




"Aaron W. LaFramboise" wrote:

> -Throwing non-SEH exceptions through arbitrary foreign frames isn't
> really a valid thing to do anyway unless you're planning to terminate
> immediately--and maybe not even then.  In the Win32 API case, it appears
> to work most of the time, but I don't see any guarantee of this
> documented anywhere.

Even if your code isn't designed to throw from the WndProc, it often can
still happen if you have an unexpected exception occur as is common with
C++ code that heavily uses the STL.  The fact that you can't install a
catch-all handler at the toplevel that gracefully terminates the app
with a friendly message means any little unexpected oopsie in the
windowing code will kill the app cold with an ugly abort() and there's
nothing you can do about it.  It's not a very pleasant user experience.

And even though this problem is typically couched in terms of Win32
callbacks, the foreign frame could simply be part of the application
that you have no control over and can't recompile with a DW2-EH gcc,
such as a library that was built with another compiler.  The sad reality
is that table-based unwinding was always designed to be used system-wide
and not piecewise.  Any codepath that goes through code that wasn't
compiled with a DW2-enabled compiler is a potential source of failure --
that is the tradeoff you make for the performance boost that you get
from zero-cost exceptions.

Brian

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users