This is the mail archive of the
mailing list for the GCC project.
Re: Minor exception bug with unexpected
- To: ak at muc dot de, oliva at dcc dot unicamp dot br
- Subject: Re: Minor exception bug with unexpected
- From: mrs at wrs dot com (Mike Stump)
- Date: Mon, 23 Mar 1998 14:26:25 -0800
- Cc: egcs-bugs at cygnus dot com
> Date: Fri, 20 Mar 1998 07:06:22 +0100
> From: firstname.lastname@example.org
> You're right. I didn't notice that __default_terminate() calls abort()
> instead of a cleaner exit(0). My prefered behaviour would be
> /* Or the equivalent on the non-unix gcc target, otherwise nothing */
> write(1, "unexpected exception\n", 21);
> abort() usually causes a core dump which I see as overkill here.
Yes. This is wrong.
Please have a read of the ANSI C++ Standard:
184.108.40.206 Type terminate_handler [lib.terminate.handler]
3 Default behavior: The implementation's default terminate_handler
220.127.116.11 terminate [lib.terminate]
2 Effects: Calls the terminate_handler function in effect immediately
after evaluating the throw-expression (18.104.22.168), if called by the |
implementation, or calls the current terminate_handler function, if |
called by the program.
Also, calling exit isn't the same as calling abort. Check out what
happens with atexit and global destructors.