X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Date: Mon, 4 Mar 2002 08:22:04 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp-workers AT delorie DOT com Subject: Re: Malloc/free DJGPP code In-Reply-To: <3C82C4F7.20E7F821@yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 3 Mar 2002, CBFalconer wrote: > I am getting debug access to things to allow diagnostic software > to interface cleanly, and I am finding anamolies between fwrites > (from the application) to stdout (the stream), and writes to > STDOUT (the handle) from the internal debugging code. Causes > great confusion. I would much prefer things to appear in the order > written :-) Why do you need to mix fwrite and write? Why not use write alone? Actually, for a library function I'd suggest _write instead of write, both for leaner footprint and to avoid polluting the ANSI namespace with non-ANSI functions. > Even though the fwrites (or printfs etc) have \n terminators, the > only way I have found to get it out on the screen before the later > handle writes is to use an extra fflush. > > Are there any known rules for this sort of stuff? You must use fflush if you have to mix buffered and unbuffered I/O. But it's best to avoid mixing them altogether.