V3 PATCH to __verbose_terminate_handler
Jason Merrill
jason@redhat.com
Thu Dec 19 11:44:00 GMT 2002
On Thu, 19 Dec 2002 14:38:30 -0500, Phil Edwards <phil@jaj.com> wrote:
> On Thu, Dec 19, 2002 at 05:47:23PM +0100, Theodore Papadopoulo wrote:
>> gdr@integrable-solutions.net said:
>> > What should happen? Should we nevertheless be verbose about program
>> > termination? What if in step 2c) Programmer specified -ansi?
>> > Put differently, should -ansi also be a "link-time" switch?
>>
>> I may be wrong but the choice of the default terminate handler is
>> only a link time flag. It should boil down to linking with one object
>> with default behavior or another one with the non-ansi version.
>
> Well, sort of.
>
> Right now the default is set simply by
>
> // unwind-cxx.h
> namespace __cxxabiv1
> {
> extern std::terminate_handler __terminate_handler;
> }
>
> // eh_terminate.cc
> std::terminate_handler __cxxabiv1::__terminate_handler = std::abort;
>
> Let's say that we use a link-time -lverbose_terminate, and/or a runtime
> LD_PRELOAD'able library, using the static struct already posted. Don't we
> have race conditions here, with multiple namespace-scope variables in
> separate translation units?
No. The above is initialized at compile-time; preload_terminate_dummy
works at runtime.
Jason
More information about the Gcc-patches
mailing list