Date: Thu, 12 Nov 1998 09:47:11 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Doug Scott cc: djgpp AT delorie DOT com Subject: Re: gcc v281 bug? In-Reply-To: <3649ECBC.794BDF32@chernikeeff.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Wed, 11 Nov 1998, Doug Scott wrote: > The output is: > Qaaazzz > > I would expect the output to be: > aaaQzzz Your expectations are wrong. `putch' uses direct screen writes to the video memory of your SVGA, whereas `printf' buffers its output and doesn't actually deliver it to the screen until the buffer is flushed. (In your cases, it is flushed when your program exits.) The DJGPP FAQ list (v2/faq211b.zip from the same place you get DJGPP) explains that it is usually a bad idea to mix buffered I/O with direct screen writes. See section 9.4 of the FAQ. > test1 > out > > The character Q goes to the screen and the rest to the file. > I cannot recall if putch() is "supposed to" use stdout or not and I > have mentioned this here just in case it is. `putch' writes characters directly to the video memory. > I do not read the mail list but it would be nice to know if the bug is > in my analysis or in the compiler/library. This is no bug, it's how things should work.