Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!ncrlnk!ncr-sd!hp-sdd!ucsdhub!ucsd!rutgers!att!ihlpl!knudsen From: knudsen@ihlpl.ATT.COM (Knudsen) Newsgroups: comp.lang.c Subject: Re: Efficient coding considered harmful? Summary: Why not portable? Message-ID: <7421@ihlpl.ATT.COM> Date: 28 Oct 88 18:17:03 GMT Article-I.D.: ihlpl.7421 References: <3105@hubcap.UUCP> <34112@XAIT.XEROX.COM> <1700@dataio.Data-IO.COM> <8775@smoke.BRL.MIL> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 14 In article <8775@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: > (But don't write something like > for (p = &a[j]; --p >= a; ) > which is nonportable.) Why not portable? I know there are some weird architectures that may treat pointers strangely. But assuming that p is declared apointer to the same type as a[], don't the official semantics of C guarantee that the above code is valid? What am I missing? -- Mike Knudsen Bell Labs(AT&T) att!ihlpl!knudsen "Lawyers are like nuclear bombs and PClones. Nobody likes them, but the other guy's got one, so I better get one too."