🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Peter Baer Galvin Thu, 22 Sep 1988 13:59
Problem with gcc 1.27
#1688
Author: Peter Baer Galvin
Date: Thu, 22 Sep 1988 13:59
52 lines
1701 bytes

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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads