galvin-peter@YALE.ARPA (Peter Baer Galvin) (09/22/88)
Under 1.27, a user reports that the first example from the new K&R
fails to run correctly when compiled with debugging turned on. I
understand that 1.28 is now availale...would that solve the problem?
Here is the original message from the user:
From: Stan Eisenstat <eisenstat-stan>
Date: Thu, 22 Sep 88 03:23:07 EDT
The following program is from K&R/2E:
#include <stdio.h>
main()
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
}
When compiled as
gcc x.c -o x
or
gcc -g x.c -o x
it does not work correctly, seemingly printing only the first character in
each block! With compiled with optimization, it runs correctly. Suggestions?
--Stan-
-------
Thanks for your help.
Also, I just wanted to verify that there is no lint that will
correctly check gcc input. Is that true?
--Peter
------------------------------------------ --------------------------------
Peter Baer Galvin (203)432-1254
Senior Systems Programmer, Yale Univ. C.S. galvin-peter@cs.yale.edu
51 Prospect St, P.O.Box 2158, Yale Station ucbvax!decvax!yale!galvin-peter
New Haven, Ct 06457 galvin-peter@yalecs.bitnet