DEFINITE bug in Turbo C 2.0 (WH

kenny at m.cs.uiuc.edu kenny at m.cs.uiuc.edu
Fri Mar 23 11:30:30 AEST 1990


bad at pearl.sw.stratus.com writes:
>In article <802 at zeusa.UUCP> hendrik at zeusa.UUCP (Hendrik Vermooten) writes:
>>Here is a definite bug in C (discovered by Renier v. Wyk)
>>Run by Turbo C it gives:
		(one set of results)
>>And run by Microsoft C (under XENIX):
		(another set of results)
>hey , interestingly enough, when I ran it on my sun 3/80 using cc I got:
		(the same results as Turbo)
>when I put a semi-colon after the #include <stdio.h> and recompiled with
>			cc I got:
		(still another set of results)
>and when I ran it on my sun compiled with gcc I got:
		(good grief, another set of results)
>and when I ran it on a Stratus Computer with the Stratus C compiler I got:
		(the same results as Microsoft)
>WHO'S GOT THE BUG?????

The original test program.  You're depending on the value of

	(a++) * (a++)

One of the a's in this expression will show the unincremented value.
The other one may show the value incremented or unincremented,
according to the convenience of the compiler writer.

Kevin, KE9TV



More information about the Comp.lang.c mailing list