4.2bsd C compiler generates incorrect code

Jim McKie jim at mcvax.UUCP
Mon Jan 14 08:22:57 AEST 1985


This bug was not in the original 4.2BSD compiler, but it appeared
in an intermediate version; I have been told it is fixed in the
next release.

As an aside, the bug can be used to demonstrate something we all know:

main()
{
	int i=0, system5=5;
	float fourpointtwo[2];

	fourpointtwo[i] = 4.2;
	if( fourpointtwo[i] > system5 )
		printf("%1.1f > %d\n", fourpointtwo[i], system5);
	else
	    printf("No bug here.\n");
}

Jim McKie
mcvax!jim



More information about the Comp.bugs.4bsd.ucb-fixes mailing list