This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Use of -fno-exceptions
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Joe Buck <jbuck at synopsys dot COM>
- Cc: ian at transitives dot com, gcc at gnu dot org
- Date: Mon, 19 Nov 2001 12:43:50 -0500 (EST)
- Subject: Re: Use of -fno-exceptions
On Mon, 19 Nov 2001, Joe Buck wrote:
> > We use gcc 2.95.3.
> > To save space in our very large build we use -fno-exceptions.
> > Now, a colleague says he needs exceptions in one, localized class. Is it
> > safe to just compile this class/file (but no other) with the
> > default -fexceptions ?
>
> The exceptions support is needed to do a cleanup. When an exception
> is thrown, the stack gets popped one frame at a time and destructors
> are called, up to the point where the exception is caught. For this
> to work properly, every possible call site that could be involved
> would need to be compiled with exceptions enabled. You may be able
> to make a mixed environment work, but it will be tricky and perhaps
> unstable.
Is that strictly true? My understanding is that one could use
sjlj-exceptions and throw over any call frame, compiled with -fexceptions
or not, because setjmp/longjmp processing doesn't require explicit unwind
info.
For the default EH model, your statement above is correct.
Jeff