delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/11/11/12:16:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <cgf-no-personal-reply-please AT cygwin DOT com>
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> <NUTMEG8Pvs51YoDK7n00000069c AT NUTMEG DOT CAM DOT ARTIMI DOT COM>
Mime-Version: 1.0
In-Reply-To: <NUTMEG8Pvs51YoDK7n00000069c@NUTMEG.CAM.ARTIMI.COM>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019