delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/11/16:14:25

Date: Wed, 11 Nov 1998 22:05:45 +0100
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Message-Id: <199811112105.WAA04318@acp3bf.physik.rwth-aachen.de>
To: djgpp AT delorie DOT com
Subject: Re: gcc v281 bug?
Newsgroups: comp.os.msdos.djgpp
Organization: RWTH Aachen, III. physikalisches Institut B
X-Newsreader: TIN [version 1.2 PL2]
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019