This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]