Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!ncar!tank!uxc!uxc.cso.uiuc.edu!a.cs.uiuc.edu!m.cs.uiuc.edu!kenny From: kenny@m.cs.uiuc.edu Newsgroups: comp.lang.c Subject: Re: What does Z["ack"] = 5 mean? Message-ID: <4700021@m.cs.uiuc.edu> Date: 10 Oct 88 16:07:00 GMT References: <14999@agate.BERKELEY.EDU> Lines: 16 Nf-ID: #R:agate.BERKELEY.EDU:14999:m.cs.uiuc.edu:4700021:000:853 Nf-From: m.cs.uiuc.edu!kenny Oct 10 11:07:00 1988 I owe Messrs. Kernighan and Ritchie an apology for suggesting that they were less than clear in specifying the behavior of the subscript operator; there is a passage that states specifically that subscripting is commutative, despite its asymmetric appearance. That passage, however, is the *only* indication that pointer arithmetic is commutative (the fact is not mentioned in the context of the addition operator), which may account for its having been missed by several compiler writers. In any case, K&R second edition, Harbison & Steele, and the dpANS have all added text clarifying the point, so perhaps we can lay it to rest, except to remember that a number of compilers do it wrong, and therefore to avoid the construct in code that is expected to be portable. Consider it `a common bug,' though, rather than `a flaw in the specification.'