From owner-freebsd-hackers Fri Aug 10 8:17:15 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by hub.freebsd.org (Postfix) with ESMTP id 20FC837B406 for ; Fri, 10 Aug 2001 08:17:10 -0700 (PDT) (envelope-from brandt@fokus.gmd.de) Received: from beagle (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.8.8/8.8.8) with ESMTP id RAA19970; Fri, 10 Aug 2001 17:17:05 +0200 (MET DST) Date: Fri, 10 Aug 2001 17:17:05 +0200 (CEST) From: Harti Brandt To: Rob Cc: "hackers@FreeBSD.ORG" Subject: Re: the =+ operator In-Reply-To: <3B73F0BC.548D40B3@home.com> Message-ID: <20010810171127.P48634-100000@beagle.fokus.gmd.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 10 Aug 2001, Rob wrote: R>My first post on hackers, so please don't flame me too bad :) I think R>that only an old hacker can give me the answer :) R> R>I've searched far and wide on search engines to find out what the =+ R>operator does, to no avail. I'm porting some old code and found it. I R>made a test program and compiled it with gcc, and all it appears to do R>is the same as regular assignment. But I'm wondering if in some day R>long ago, it mean't something else? Thanks, Rob. Originally the operators like += and -= where written as =+ =-. This worked at least 'til the UNIX v7 compiler. With v6 or v7 the operators were changed to get rid of the problem what 'v=-7' means. To assign -7 to v you had to write 'v= -7'. So you must have _really_ old code (much of the v7 code was still written using the old operators). harti PS: the v7 compiler also had the undocumented operators \/ and /\ for min and max. harti. PPS: if the code is not so old, it may be possible that v=+7 actually means v= +7. Note, however, that K&R has no unary +. harti -- harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fhg.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message