This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: stderr vs. STDERR_FILENO
Mark Mitchell <mark@codesourcery.com> writes:
> (2) stderr freopen'd (and not attached to fd 2)
stderr freopen'd means it is still attached to fd 2.
> The only argument I can see is that if the runtime is screwed up, writing
> to fd 2 is more likely to get some output to the terminal than writing to
> stderr. However, that's not nearly as important as the risk of writing to
> a random file descriptor.
I don't regard fd 2 as random, it has a well defined meaning. If you
relocate fd 2 you'll probably get more problems anyway.
> If you're not persuaded, I can agree to disagree.
So do I.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."