Mail Archives: djgpp/1998/08/30/10:34:09
On Sun, 30 Aug 1998, Adam Brown wrote:
> This is because DJGPP was programmed with a bloody-minded adherence to
> the ANSI C standard, which states that the printf buffer does not need
> to be flushed at the end of the call.
No, it's because flushing the buffer at the end of each call would make
`printf' prohibitively expensive, due to the mode-switches from protected
mode to real mode and back that are required for each call to DOS.
Consider the following snippet:
for (i = 32; i <= 255; i++)
printf ("%c", i);
printf ("\n");
If DJGPP would flush the buffer for every printf, this would run hundreds
of times slower than it does today.
- Raw text -