------- Comment #39 from l dot lunak at suse dot cz  2007-04-27 14:41 -------
I find the reasoning that this change should not be done because somebody
possibly might be using the libstdc++'s different semantics of try/catch rather
weak, for several reasons:
- it's not documented anywhere, at least I haven't found any such docs, so it's
internal undocumented feature
- if somebody actually uses it, then they can simply switch to __try/__catch
and be done with it; additionally compared to users who want normal try/catch
keywords they have the advantage that the compiler will detect the problem,
while with the current changed try/catch there's absolutely no detection
besides non-working code
- finally, I find it very unlikely that there actually would be people using
try/catch in the way libstdc++ does. You cannot "just not generate the heavy
exception machinery" and hope it works. Code that explicitly uses exceptions
relies on them, just like e.g. code using explicit NULL pointer checks relies
on them. You cannot silently remove all "if( pointer == NULL )" checks in code
and hope it works, because that would avoid error recovery code. The same way
silently dumping catch blocks means dumping error recovery code. Libstc++ can
work this way because it doesn't use exceptions on its own, it just has the
try/catch #defines to be able to work with code both using and not using them.
In general if somebody wants to write code not using exceptions they can simply
not use them. Special cases like libstdc++ are special and people doing that
should better known what they're doing.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25191

Reply via email to