Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: comp.std.c Keywords: ANSI C, hardware protection, out-of-bounds pointers Message-ID: <10914@smoke.BRL.MIL> Date: 2 Sep 89 23:08:33 GMT References: <426@maytag.waterloo.edu> <10884@smoke.BRL.MIL> <619@targon.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 In article <619@targon.UUCP> andre@targon.UUCP (andre) writes: >Does this mean that on OS/2 on an '386 with a buffer gotten from >the system, the compiler sees to it that the char *head does never! >ends up in an address register? I'm not familiar enough with that environment to answer definitively, but I don't understand the problem. The whole reason the Standard does not guarantee array[0]-1 is to accommodate such address space issues. The reason it does guarantee array[last]+1 is because otherwise looping would be painful; since only a single byte (or maybe word) extra is required at the end, the compiler should arrange for the extra slop and all will be well.