Mail Archives: djgpp/1998/11/11/16:14:25
In article <3649ECBC DOT 794BDF32 AT chernikeeff DOT co DOT uk> you wrote:
> I am not a compiler wizard but I think that I have found a bug in djgpp.
You haven't :-)
[...]
> The Code:
> #include <stdio.h>
> main( int argc, char* argv[] )
> {
> printf( "aaa" ) ;
> putch( 'Q' ) ; /* goes to screen not stdout */
> printf ( "zzz") ;
> }
This 'going to screen, not stdout' is exactly your problem. 'putch()'
is a non-standard function (and you forgot to #include <conio.h>, on
top of that), and it's *not* part of the <stdio.h> package.
Therefore, it doesn't participate in the line buffering used by stdout
in DJGPP.
I wonder how you could suspect a bug in gcc if you obviously didn't
even cross-check your own code with 'gcc -Wall -W foo.c'. Had you done
that, you'ld have got an 'implicit declaration' warning right away,
which should have pointed you to the source of your problem.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -