This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stderr and clearmake


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]