Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Peter Palotas , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Exceptions Date: Sat, 9 May 1998 10:29:57 -0700 Message-ID: <19980509172947.AAE16984@ppp105.cartsys.com> Precedence: bulk At 12:52 5/8/1998 -0400, Peter Palotas wrote: >Hi, > >I was wondering what is the diffrence between using the (undocumented) >switch -fsjlj-exceptions and simply -fexceptions (or no switch since it's >default)? Are there any diffrence in speed, or anything else? Take what I say here with a grain of salt, since most of it is second-hand or guesswork. I don't know enough C++ nor do I have enough experience with the GCC sources to answer authoritatively. That said... AFAIK, the standard `-fexceptions' switch handles exceptions through a table, which is managed by GCC's library. DJGPP does not yet contain the startup code to set this up correctly, so it doesn't work. `-fsjlj-exceptions', as the name implies, handles them with `setjmp' and `longjmp'. This is simple since their action is very similar to that of `catch' and `throw'. However, it is not as fast, and I suspect it may also increase code size. >Also I wonder generally if exceptions are slow/unefficient, generally >speaking (meaning that your program should throw as few exceptions as >possible during execution), or if they can be used frequently without any >speed degradance.... I don't know, but I suspect that, at least with `-fsjlj', they won't be particularly fast. In general, I would not expect a strange control transfer like that done by exceptions to be all that fast. Nate Eldredge nate AT cartsys DOT com