This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fno-exceptions and bad_alloc
- To: gcc at gcc dot gnu dot org, list at Cal040031 dot student dot utwente dot nl
- Subject: Re: -fno-exceptions and bad_alloc
- From: Mike Stump <mrs at wrs dot com>
- Date: Mon, 27 Sep 1999 18:00:27 -0700 (PDT)
> From: "Thomas van Gulick" <list@Cal040031.student.utwente.nl>
> To: <gcc@gcc.gnu.org>
> Date: Tue, 28 Sep 1999 02:26:03 +0200
> 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?
Right! Don't call things that can allocate with new, don't use new.
Always call new (nothrow), and you'll be set.
Override the normal new with one that aborts. I am sure that you can
then find all the uses of new fairly quickly and easily.