This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
C++: operator new and disabled exceptions
- From: Christophe LYON <christophe dot lyon at st dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 27 Sep 2007 15:13:49 +0200
- Subject: C++: operator new and disabled exceptions
Hello,
I am compiling a C++ application, which uses the 'new' operator, with
exceptions disabled (-fno-exceptions).
Yet, the new operator called is the one that throws an exception in case
of failure. Why is it so ? Isn't it inconsistent with the
-fno-exceptions flag?
I imagined that compiling with -fno-exceptions would make the compiler
generate calls to new(nothrow) instead.
In my case, replacing all calls to new to new(nothrow) in the
application is not an option.
Thanks,
Christophe.