| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
> Can you clarify this case? The STL generally does not throw exceptions > unless the programmer asks it to. The only unexpected exception > situation I can think of is std::bad_alloc. The STL is littered with exceptions. Consider a std::string object s: std::out_of_range is thrown for: s.append(str, pos, n) or s.assign(str, pos, n) or s.at(pos) or s.copy(s, n, pos) or s.erase(pos, n) or s.insert(pos, n, c) or s.replace(pos, n1, n2, c) s.substr(pos, n) for pos out of bounds std::length_error is thrown for: s.insert() or s.replace() or s.reserve() if new length > max_size() Not every programmer wraps every conceivable std::string operation with a try/catch, so it's not unheard of for unexpected exceptions to bubble up when there are bugs or under-validated inputs. > A user can override abort() if he likes. Sure, but you can't really do anything useful as you don't have any context. > Or, he can catch exceptions in > the callback and propagate it properly. You can modify the code to install a try block in the WndProc, but it's not a common idiom in existing code because it's not necessary with MSVC nor SJLJ gcc. It's purely an ugly workaround for a compiler limitation, and a regression. > > Any codepath that goes through code that wasn't > > compiled with a DW2-enabled compiler is a potential source of failure -- > > This is also true of any other exception strategy, including both SEH > and SJLJ. It is not valid to throw through functions that don't know > about exceptions unless they are specially written to accommodate this. > The primary problems are that it may leave dynamic data structures in > an incoherent state or it may leak resources. The problem is that the DW2 failure is brittle, whereas the SEH and SJLJ unwinders do find the matching catch block regardless of the frames in between. Whether or not it's valid I don't know, but the point is that users on the Win32 platform have come to expect a certain behavior based on the native tools and the GNU tools up until now, and this is a departure. > -Delay release: No reason to delay release for everyone when only a > minority user subset is affected. We need to get this thing moving. > > -Two separate compilers: Releasing two compilers with two incompatible > ABIs will probably cause serious problems for our C++ users, hitting > again once SJLJ is dropped, which would be fairly soon anyway. > > -Only SJLJ: The poor performance of SJLJ makes Java impractically slow, > and even in C++ causes problems for some code. The ABI would be broken, > again, during the upgrade, which, as I mentioned, will happen fairly > soon. There probably is only marginal value in releasing such a compiler. I agree that gcc on Win32 is in a really agonizing situation here. And I realize that going forward DW2 is certainly where things need to be moving for the default. It's just that I think by pronouncing SJLJ as completely out of the question you doom a certain segment of the population into forever being stuck on g++ 3.4 and never being able to appreciate any of the improvements in the 4.x series, unless they can stomache the thought of building their own toolchain with --enable-sjlj-exceptions. (Or using Danny's 4.2 sjlj builds I suppose.) On the other hand, doing nothing is arguably worse; something is better than nothing. If progress can only be made by ignoring SJLJ then so be it. 3.4 will always be there. 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 You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
© 2004-2008 readlist.com