[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compile with no exceptions

From: Paul Pluzhnikov
Subject: Re: Compile with no exceptions
Date: Fri, 01 Sep 2006 12:42:51 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

kitschen <> writes:

> Paul Pluzhnikov wrote:
>> Obviously, if you are *using* exceptions, you can't just tell the
>> compiler "ignore what I wrote, and compile something else instead".
> So what's the -fno-exceptions for then?

To omit special tables which are necessary to properly unwind stack
through code that doesn't catch or throw.

> If you are not using
> exceptions I expect the compiler to not create the corresponding code
> (ie stack unwinding etc).

Your expectations are somewhat incorrect:
even if *your* code doesn't use exceptions, it may call other code
that throws, and it may be called by other code that tries to catch.

> As I have exceptions in my code, I would expect the option
> -fno-exceptions to create code which just crashes/exits the program in
> case of a thrown exception. Am I wrong?

Well, you obviously are wrong (at least as far as g++ is concerned):
instead of doing what you expect; it simply refuses to compile your code.

As to whether what you desire is reasonable; I don't believe so,
but that's a matter of opinion.

In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]