Mail Archives: djgpp/1997/11/04/06:29:01
On Mon, 3 Nov 1997, Nate Eldredge wrote:
> I found the cause, but I still don't know if it's a bug. In
> src/libc/ansi/stdlib/exit.c, __stdio_cleanup_hook is called before the
> destructors. You guessed it, __stdio_cleanup_hook flushes all streams, and
> closes all except stdin, stdout, and stderr (cin, cout, cerr for C++). If
> this is not what's Supposed To Happen, it should be easy to change, just
> move two lines of code. *Are* files Supposed to work in destructors?
IMHO, people who use C++ extensively should answer this. There might
be conflicts with objects that use I/O streams and are destructed by
global destructors. DJ?
Is it at all safe to assume that file handles beyond the 3 standard
streams are available in the global destructor? After all, they *are*
run after `main' returned, so at least in principle, this is a
never-never land for the application, no?
- Raw text -