Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Out-of-bounds pointers
Message-ID: <11213@smoke.BRL.MIL>
Date: 3 Oct 89 19:40:29 GMT
References: <1009@mtxinu.UUCP>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 12

In article <1009@mtxinu.UUCP> ed@mtxinu.COM (Ed Gould) writes:
>Is the following code conformant?  It's clear that it's not legal to
>dereference the pointer in its "illegal" state, but is the p++ line
>guaranteed to return it to a valid value?

It's not even "legal" to compute an invalid address, whether or not
it is dereferenced.  Your example has implementation-dependent
behavior; it is not too unlikely that it would even abort under some
circumstances.

Pointers one past the end of an array are valid, but not pointers
before the beginning of an array.