Xref: utzoo rec.games.mud:3705 comp.sys.ibm.pc.rt:2112 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!hanami.Eng.Sun.COM!landman From: landman@hanami.Eng.Sun.COM (Howard A. Landman) Newsgroups: rec.games.mud,comp.sys.ibm.pc.rt Subject: Re: small bug in LPMUD 2.4.5 Message-ID: <12543@exodus.Eng.Sun.COM> Date: 30 Apr 91 18:29:45 GMT References: <3053@krafla.rhi.hi.is> Sender: news@exodus.Eng.Sun.COM Followup-To: rec.games.mud Organization: Sun Microsystems, Mt. View, Ca. Lines: 19 In article <3053@krafla.rhi.hi.is> frisk@rhi.hi.is (Fridrik Skulason) writes: >It seems the RS/6000 C compiler does not like statements of the form > > ptr = const + ptr2 > >atlthough > > ptr = ptr2 + const or ptr = &ptr2[const] > >are ok. This is a compiler bug. The two forms are specifically stated to be equivalent in K&R. Addition is commutative, period. In fact, technically, &const[ptr2] should work, although there are LOTS of compilers that choke on that. -- Howard A. Landman landman@eng.sun.com -or- sun!landman