From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 709 invoked by alias); 2 Apr 2003 00:42:04 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 691 invoked from network); 2 Apr 2003 00:42:04 -0000 Received: from unknown (HELO smtp0.euronet.nl) (194.134.35.141) by sources.redhat.com with SMTP; 2 Apr 2003 00:42:04 -0000 Received: from koffie.nl (unknown [194.134.219.12]) by smtp0.euronet.nl (Postfix) with ESMTP id 3EBC524753; Wed, 2 Apr 2003 02:42:02 +0200 (MEST) Message-ID: <3E89EFA9.6070307@koffie.nl> Date: Wed, 02 Apr 2003 00:42:00 -0000 From: Segher Boessenkool User-Agent: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en MIME-Version: 1.0 To: Matthieu Moy Cc: Stuart Longland , Arash Farmand , gcc-help@gcc.gnu.org Subject: Re: gcc References: <3E87EE8F.4070104@longlandclan.hopto.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00007.txt.bz2 Matthieu Moy wrote: > If the program ends properly, I think the output *has* to be flushed, Yes. If main() returns or exit() is called, all open streams are closed; if an open stream is closed, it is flushed. > That's why its generally a good advice to put "\n" at the end of any > debug/test output. Note that (on typical Unix-like systems) only stderr is line buffered by default; stdout is block buffered. This means that a '\n' char is not enough to flush stdout; either explicitly call fflush() or use setbuf() or setvbuf(). Segher