This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
"new" statement and -fno-exceptions
- From: Paul Koning <pkoning at equallogic dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 4 Oct 2004 09:37:35 -0400
- Subject: "new" statement and -fno-exceptions
We recently ran into some problems with an application being killed by
unhandled exception processing -- even though it's compiled
-fno-exceptions.
It turns out that a "new" statement will throw an exception on alloc
failure (if the "nothrow" variant isn't used) no matter whether
-fno-exceptions is used or not. This is somewhat surprising; it would
make sense for the code generator to call the nothrow new operator in
this case. The docs don't say one way or the other.
I suppose I can supply my own operator new(size_t) as a workaround...
paul