"new" statement and -fno-exceptions
Paul Koning
pkoning@equallogic.com
Mon Oct 4 14:19:00 GMT 2004
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
More information about the Gcc
mailing list