This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR/57652 collect2 temp files
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 19 Jun 2013 16:38:47 +0000
- Subject: Re: [PATCH] PR/57652 collect2 temp files
- References: <CAGWvnyk3CpQ9G+huqdw0R37=47c4ABD4Tz2+kexPhfmuhvx9Tg at mail dot gmail dot com>
On Wed, 19 Jun 2013, David Edelsohn wrote:
> A 2011 change to collect2 to use the standard diagnostics
> infrastructure broke collect2's cleanup of temp files when an error
> occurs. This prototype of a patch implements the minimal conversion
> of collect2 to use atexit().
>
> If this is the right direction, all calls to collect_exit() can be
> converted to exit().
>
> Thanks, David
>
> PR driver/57652
> * collect2.c (collect_atexit): New.
> (collect_exit): Directly call exit.
> (main): Register collect_atexit with atexit.
This is OK. Using atexit seems to me to be the right approach for such
cleanup.
--
Joseph S. Myers
joseph@codesourcery.com