[Bug libstdc++/25191] exception_defines.h #defines try/catch
jason at redhat dot com
gcc-bugzilla@gcc.gnu.org
Fri Sep 26 21:58:00 GMT 2008
------- Comment #60 from jason at redhat dot com 2008-09-26 21:57 -------
Subject: Re: exception_defines.h #defines try/catch
l dot lunak at suse dot cz wrote:
> But only in your perfect world. This bug and its silent discarding of exception
> handling code (and an unintended -fno-exception from the build system) made us
> release a broken package.
-fno-exceptions is a big hammer. It will break exceptions trying to
pass through code compiled with that flag whether or not that code has
any try/catch constructs. If you might have some code that throws, you
shouldn't use -fno-exceptions; that's what broke your package. Getting
an error on try would have helped you find that problem, but that
doesn't mean it's the right answer for all situations; if I'm writing
code that may be used by other programs, I should write it to be
exception-safe even if I don't throw any exceptions myself.
Perhaps we could just warn once if we see try/catch outside library
headers with -fno-exceptions.
Jason
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25191
More information about the Gcc-bugs
mailing list