This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New and exception
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: 12 Jul 2002 15:54:18 -0300
- Subject: Re: New and exception
- Organization: GCC Team, Red Hat
- References: <20020712093711.A31093@lucon.org>
On Jul 12, 2002, "H. J. Lu" <hjl@lucon.org> wrote:
> I was wondering if gcc should translate "new" to "new (std::nothrow)"
> for -fno-exceptions. When I use -fno-exceptions, I don't expect my
> codes throw any exceptions, including new.
I'd rather have such a program crash when new tries to throw an
exception because it ran out of memory (so that you know what
happened) than have it crash at some later point due to a NULL-pointer
dereference.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer