[comp.sys.mac] BUG in MPW C 2.0

larryh@tekgvs.TEK.COM (Larry Hutchinson) (10/26/87)

I was unfortunate enough to stumble across a nasty MPW C 2.0 bug that was
not present in the beta release.  I have been using the 2.0 release
for 2 months now but just now ran into the bug when a change to an unrelated
module triggered a recompile of a module left over from the beta release.
It took me a while to isolate the problem because it was in a C translation
of a Pascal routine that was itself a mechanical translation of a Fortran
routine!  Gag.

The problem can be easily demonstrated by the following simple program:

/******** this will screw up using MPW C 2.0 */
#include <stdio.h>

main(argc,argv)
	int argc;
	char *argv[];
{
	double a,b;

	a=1; b=2;
	a= a+b*b;
	printf("a= %g\r",a);
}


It will print

a=1

.  If a is extended, then no problem.  If the assignment is:
	a= b*b+a;
then no problem.


Looking at the code produced, I saw that the calculation was done
properly but the result was not stored back into a.  It was stored, twice
in fact, just not into a!

Is this a know bug?  If not, will this get to the right person?
If so, does anyone have any info on possible bug fix releases of 2.0?


Larry Hutchinson, Tektronix, Inc. PO Box 500, MS 50-383, Beaverton, OR 97077
{ decvax,allegra }!tektronix!tekgvs!larryed