landman@hanami.Eng.Sun.COM (Howard A. Landman) (05/01/91)
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