Caveat Hackor (cc generates bad code for int *= float)

utzoo!decvax!harpo!floyd!trb utzoo!decvax!harpo!floyd!trb
Fri Apr 30 16:45:37 AEST 1982


Paul Gloudemans (floyd!prg) found this problem in VAX cc on both 4.1bsd
and BTL 4.0.

-----
/* bug.c */
main()
{
	float z;
	int n;

	n=2;
	z=3.5;
	n *= z;
	printf("n=%d, should be 7!\n");
}
% cc bug.c
% a.out
n=6, should be 7!
%
-----
	Andy Tannenbaum   Bell Labs  Whippany, NJ   (201) 386-6491



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