Path: utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!jarthur!uci-ics!rfg From: rfg@ics.uci.edu (Ron Guilmette) Newsgroups: gnu.g++.lib.bug Subject: Re: Does '\n' flush streams? Message-ID: <2589AB90.19694@paris.ics.uci.edu> Date: 16 Dec 89 02:42:23 GMT References: Reply-To: Ron Guilmette Distribution: gnu Organization: University of California, Irvine - Dept of ICS Lines: 29 In article ham@Neon.Stanford.EDU (Peter R. Ham) writes: >I've asked this question before, but here goes again. >Should > >cout << "\n" > >flush cout? > >The libg++ test suite seems to imply that it should. I'm not getting >that behavior on the pmax. Maybe I should go debug the thing? Peter, It doesn't. The problem is that streams have not been `line buffered' in the releases up to and including 1.36.1. Doug Lea assures me however that libg++ 1.36.2 (when available) will do line buffering (rather than block buffering) on streams. >In Stroustrup's book, it says that and ostream should be flushed >in its destructor. The libg++ ~ostream doesn't seem to to this. >What am I missing? Perhaps nothing. I also noticed that stdout was not getting flushed on program exit in libg++ 1.36.1 (and I reported it to Doug L.). Sounds like your's could be a (very) related problem, so perhaps Doug will have these both fixed in 1.36.2. // rfg