This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fno-exceptions and bad_alloc
- To: Mike Stump <mrs at wrs dot com>
- Subject: Re: -fno-exceptions and bad_alloc
- From: Andi Kleen <ak at muc dot de>
- Date: Tue, 28 Sep 1999 20:27:54 +0200
- Cc: ak at muc dot de, jason at cygnus dot com, egcs at egcs dot cygnus dot com
- References: <199909281945.MAA00468@kankakee.wrs.com>
On Tue, Sep 28, 1999 at 09:45:43PM +0200, Mike Stump wrote:
> > From: Andi Kleen <ak@muc.de>
> > Date: 28 Sep 1999 12:32:30 +0200
>
> > jason@cygnus.com (Jason Merrill) writes:
>
> > > >>>>> Thomas van Gulick <list@utumno.student.utwente.nl> writes:
> > >
> > > > When using -fno-exceptions I still get bad_alloc exceptions
> > > > thrown at me when the new operator fails. I also tried the
> > > > fno-check-new flag to no avail.
> > > > Is there any way to really really turn off exception handling
> > > > and throwing?
> > >
> > > Use new (nothrow).
>
> > Shouldn't this be the default for new when -fno-exceptions is enabled?
>
> No.
Hmm. I just did a small experiment (trying to throw across a module
with compiled with -fno-exceptions), and it core dumped on my Linux box.
So you feel happy with adding the sentence "When a new in C++ fails the
program will crash unless you're using sjlj exceptions" to the
-fno-exceptions documentation?
Or do I miss something here?
-Andi
--
This is like TV. I don't like TV.