Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83 based; site houxf.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxb!mhuxn!mhuxm!mhuxj!houxm!houxf!stewart From: stewart@houxf.UUCP (Bill Stewart HO 4K-435 x0705) Newsgroups: net.lang.c Subject: Re: <=> and obfuscation Message-ID: <856@houxf.UUCP> Date: Wed, 13-Feb-85 12:06:39 EST Article-I.D.: houxf.856 Posted: Wed Feb 13 12:06:39 1985 Date-Received: Thu, 14-Feb-85 02:27:00 EST References: <7699@brl-tgr.ARPA> <1293@bbncca.ARPA> <7853@brl-tgr.ARPA> <805@sjuvax.UUCP> <11927@gatech.UUCP>, <8Re: <=> and obfuscation Organization: AT&T Bell Labs, Holmdel NJ Lines: 18 People have been arguing about the statement that b ^= a ^= b ^= a; gives 0 when a and b are the same. However, you've misunderstood the original statement - the problem is not when a and b have the same VALUE, but when they have the same ADDRESS. Yes, it works fine when a and b are different variables with the same value. However, in a subroutine you might get two variables with the same address. Then the statement is equivalent to a ^= a ^= a ^= a Well, a^=a becomes zero, gets ^ed with a, which is now 0m and gets ^ed with 0 again, still giving 0. -- Bill Stewart ho95c!wcs AT&T Bell Labs, Holmdel NJ HO 4K-435 x0705 (201-949-0705) {allegra, ucbvax!ihnp4, decvax!harpo}!houxf!stewart ------ Sorry if the articles I'm replying to re ancient; we lost news for a month.