is this broken or what?

Bill Smith wsmith at mdbs.UUCP
Tue Jan 23 08:06:36 AEST 1990


I should post this in the appropriate Gnu group, but we have be cut off from 
most of the news groups for the time being.

	unsigned u = 0;

	if (u-- < 4)
		printf("yes\n");
	else
		printf("no\n");

The Data General Aviion 5000 (an 88000 machine) version of GCC converts this 
into:

	unsigned u = 0;

	if(--u < 3) ....

for the assembly.

This obviously will produce counter-intuitive results.

Bill Smith
pur-ee!mdbs!wsmith



More information about the Comp.lang.c mailing list