Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Efficient coding considered harmful? Message-ID: <1988Oct31.175926.13316@utzoo.uucp> Organization: U of Toronto Zoology References: <3105@hubcap.UUCP> <34112@XAIT.XEROX.COM> <1700@dataio.Data-IO.COM> <8775@smoke.BRL.MIL> <7421@ihlpl.ATT.COM> Date: Mon, 31 Oct 88 17:59:26 GMT In article <7421@ihlpl.ATT.COM> knudsen@ihlpl.ATT.COM (Knudsen) writes: >> for (p = &a[j]; --p >= a; ) >> which is nonportable.) > >Why not portable? ... It terminates by running p off the beginning of a, and comparing it to a to detect this situation. The result of running a pointer off the beginning of an array is (and always has been) undefined. On some segmented machines, this can and does cause trouble. -- The dream *IS* alive... | Henry Spencer at U of Toronto Zoology but not at NASA. |uunet!attcan!utzoo!henry henry@zoo.toronto.edu