Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: char (*a)[] (was: Style [++i vs i++]) Message-ID: <931@haddock.ISC.COM> Date: Wed, 12-Aug-87 17:30:17 EDT Article-I.D.: haddock.931 Posted: Wed Aug 12 17:30:17 1987 Date-Received: Sat, 15-Aug-87 02:23:21 EDT References: <8298@brl-adm.ARPA> <587@cblpe.ATT.COM> <189@xyzzy.UUCP> <1987Aug10.192923.7879@sq.uucp> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 14 Summary: NULL+1 is illegal In article <1987Aug10.192923.7879@sq.uucp> msb@sq.UUCP (Mark Brader) writes: >Wayne Throop writes: >>... but *also* because it performs arithmetic on a null pointer, and >>of course, this is illegal.) > >Um, I don't think so, Wayne; it's just that the result, if you indirect >through such a pointer, is undefined. K&R is silent on this, but ANSI >3.3.6 seems pretty clear. "A.6.2 Undefined behavior: ... A pointer that is not to a member of an array object is added to or subtracted from" [Oct86 dpANS]. A null pointer is an extreme example of this. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint