Date: Fri, 10 Aug 2001 17:17:05 +0200 (CEST) From: Harti Brandt <brandt@fokus.gmd.de> To: Rob <europax@home.com> Cc: "hackers@FreeBSD.ORG" <hackers@FreeBSD.ORG> Subject: Re: the =+ operator Message-ID: <20010810171127.P48634-100000@beagle.fokus.gmd.de> In-Reply-To: <3B73F0BC.548D40B3@home.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010810171127.P48634-100000>