🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Paul Hudson Wed, 05 Oct 1988 15:45
bug in SUN-3 gcc-1.28 when *not* optimising.
#1768
Author: Paul Hudson
Date: Wed, 05 Oct 1988 15:45
37 lines
1621 bytes
The following program prints mostly nulls when compiled with "gcc -o
crap crap.c". It looks like it's printing correctly only the character
returned by the occasional call to _filbuf in getc.

Optimise the program and it works.

This bug I believe has other manifestations in other programs of
mine. Unfortunately, they're much too big to post.

Ember? it's not really a flame; is gcc going to get more stable? I
know it costs me nothing, and it's an excellent compiler (which is why
I'm saying this), but it's difficult to know which version I should be
using for products for distribution. I would like to have programs I
distribute contain as far as possible only the bugs I put there! Is
there a case for a secondary release of each version (1.28b?) which
just bug-fixes rather than improves? 

#include <stdio.h>
main()
{
    FILE *fred = fopen("/etc/termcap", "r");
    while(1)
    {
	int c;
	c = getc(fred);
	putchar(c);
    }
}

Paul Hudson 

Snail mail: Monotype ADG	Email:	...!ukc!acorn!moncam!paul
	    Science Park,		paul@moncam.co.uk
	    Milton Road,	"Sun Microsysytems:
	    Cambridge,		 The Company is Arrogant (TM)"
	    CB4 4FQ
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