V3 PATCH to __verbose_terminate_handler

Gabriel Dos Reis gdr@integrable-solutions.net
Thu Dec 19 02:20:00 GMT 2002


Jason Merrill <jason@redhat.com> writes:

| On 18 Dec 2002 17:37:32 +0100, Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
| 
| > Jason Merrill <jason@redhat.com> writes:
| >
| > | 2002-12-18  Jason Merrill  <jason@redhat.com>
| > | 
| > | 	* src/vterminate.cc (__verbose_terminate_handler): Send
| > | 	diagnostics to stderr.
| >
| >   Is there a way to way this sort of message printed by default, instead of
| > having the  unfriendly "zsh: ./a.out: abort" when ./a.out is
| > terminated because of uncaught exception?
| 
| Well, the standard (18.6.3.1) says that the default terminate handler just
| calls abort().  I suppose that if we're not -ansi, we could link in
| something like
| 
|   #include <exception>
| 
|   namespace __gnu_cxx
|   {
|     extern void __verbose_terminate_handler ();
|   }
| 
|   struct preload_terminate_dummy
|   {
|     preload_terminate_dummy()
|     { std::set_terminate (__gnu_cxx::__verbose_terminate_handler); }
|   };
| 
|   static preload_terminate_dummy dummy;
| 
| to override it; what do you think?

Terrific!  I'm for it.

Hmm, do you think it will work with separately compiled files
with/without -ansi? 

What do others think?

-- Gaby



More information about the Gcc-patches mailing list