This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: stderr and clearmake
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 11 Nov 2004 12:16:35 -0500
- Subject: Re: stderr and clearmake
- References: <4193827C.7030105@comcast.net> <NUTMEG8Pvs51YoDK7n00000069c@NUTMEG.CAM.ARTIMI.COM>
- Reply-to: cygwin at cygwin dot com
On Thu, Nov 11, 2004 at 05:02:40PM -0000, Dave Korn wrote:
>2) if I make any mistakes or offer bad advice someone will pull me on it
>fairly sharpish,
>
> I don't think you have any right to expect that. IIRC, there are _zero_
>guarantees provided by the C language standard and the C stdio library
>specification about the order in which stdio buffers will be flushed. It's
>entirely at the whim of the runtime library, and as you can see, when a program
>reaches the termination routines under cygwin, it chooses to flush the stderr
>buffer before the stdout buffer.
stderr is not normally buffered. stdout is normally unbuffered or line
buffered if is attached to a "tty". So, stderr should have been flushed
before hitting exit. So should stdout in the normal case.
On Cygwin, I get stdout first, stderr second with and without setting
CYGWIN=tty. If I pipe or redirect the output somewhere then I
get the opposite order, which is what I would expect.
Which, means, of course, that my cable box analogy still holds.
cgf
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/