From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4895 invoked by alias); 8 Jan 2002 18:06:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 4881 invoked by uid 71); 8 Jan 2002 18:06:00 -0000 Date: Tue, 08 Jan 2002 10:06:00 -0000 Message-ID: <20020108180600.4880.qmail@sources.redhat.com> To: paolo@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Ronald Van Iwaarden Subject: Re: c++/5298: stream::write Reply-To: Ronald Van Iwaarden X-SW-Source: 2002-01/txt/msg00339.txt.bz2 List-Id: The following reply was made to PR c++/5298; it has been noted by GNATS. From: Ronald Van Iwaarden To: , , , , , , , Cc: Subject: Re: c++/5298: stream::write Date: Tue, 8 Jan 2002 09:59:26 -0800 (PST) This solved the symptom I described but there is still some funkiness going on. Now, I know what I am describing here is not well defined behavior but if take the following program an run it, it always gives the same output (up to the order of the lines). That is, every line is printed correctly, but they may come in different orders. However, if you redirect the output to a file, sometimes the output of lines gets merged. I never noted this behavior on the 2.96 compiler... int main() { std::ios::sync_with_stdio(false); int pid= fork(); if (pid){ cout<<0<<"ARG CALLED: Kind ID = "<<1<<", Data = data "< ff; cat ff | sort" and, if run multiple times, you get different output. Note that you get exactly the same output every time if you do "./a.out | sort". Hmmm. Sorry for the sort of funky description and example... --Ron On 7 Jan 2002 paolo@gcc.gnu.org wrote: > Synopsis: stream::write > > Responsible-Changed-From-To: unassigned->paolo > Responsible-Changed-By: paolo > Responsible-Changed-When: Mon Jan 7 14:15:59 2002 > Responsible-Changed-Why: > Analyzed. > State-Changed-From-To: open->feedback > State-Changed-By: paolo > State-Changed-When: Mon Jan 7 14:15:59 2002 > State-Changed-Why: > Hi again Ron! > This one should be easier to solve (I hope): could you > please try adding a: > std::ios::sync_with_stdio(false); > at the beginning of your main? > It works for me (gcc3.0.3 on i686-pc-linux-gnu). > > Cheers, > Paolo. > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5298 > -- -------------------------------------------------------------------------------- Ronald Van Iwaarden - Metron Inc. (719)567-9873 main(i){(10-putchar(((25208>>3*(i+=3))&7)+(i?i-4?100:65:10)))?main(i-4):i;}