Article View: comp.sys.mac
Article #20768BUG in MPW C 2.0
From: Larry Hutchinson
Date: Mon, 26 Oct 1987 18:46
Date: Mon, 26 Oct 1987 18:46
45 lines
1755 bytes
1755 bytes
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
Technical Details
Message-ID:
<2803@tekgvs.TEK.COM>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!tektronix!tekcrl!tekgvs!larryhShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!tektronix!tekcrl!tekgvs!larryh From: larryh@tekgvs.TEK.COM (Larry Hutchinson) Newsgroups: comp.sys.mac Subject: BUG in MPW C 2.0 Message-ID: <2803@tekgvs.TEK.COM> Date: Mon, 26-Oct-87 13:46:48 EST Article-I.D.: tekgvs.2803 Posted: Mon Oct 26 13:46:48 1987 Date-Received: Wed, 28-Oct-87 06:23:54 EST Organization: Tektronix Inc., Beaverton, Or. Lines: 45 Keywords: MPW c bug