Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 11 Nov 2004 12:16:35 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: stderr and clearmake Message-ID: <20041111171635.GA14312@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4193827C DOT 7030105 AT comcast DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i 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/