Help on gcc

Alexandre Oliva aoliva@redhat.com
Tue Feb 5 13:12:00 GMT 2002


On Feb  5, 2002, "James Dressler" <jamesmdr@hotmail.com> wrote:

> does not work, never prints "captured"

Dereferencing a NULL pointer invokes undefined behavior, so the crash
you get is in perfect accordance with the Standard, and it is indeed
the expected behavior.  In fact, be happy that the program didn't
format your hard disk, destroy the universe nor go out with your
sister :-)  It might throw an exception, but that's not what most would
expect from C++ programs in this situation.  C++ != Java :-)

-- 
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



More information about the Gcc mailing list