in reply to
Re: Using warn() when STDERR is closed
in thread Using warn() when STDERR is closed
...but just to file descriptor 2.
Still, it's a little weird that it only prints to file descriptor 2 (hard-wired), if STDERR is closed. I.e., if you reopen STDERR after fd 2 has been taken by something else, so STDERR is then associated with fd 3 for example, the warning is nicely printed to fd 3, not fd 2...
In other words, it seems this behaviour is explicitly coded somewhere as a fallback for when STDERR is closed.