Path: utzoo!mnetor!uunet!husc6!mailrus!nrl-cmf!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Is &a[NTHINGS] legal Message-ID: <7852@brl-smoke.ARPA> Date: 7 May 88 22:22:46 GMT References: <12074@tut.cis.ohio-state.edu> <1086@gazette.bcm.tmc.edu> <52339@sun.uucp> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <52339@sun.uucp> limes@sun.UUCP (Greg Limes) writes: >In article <1086@gazette.bcm.tmc.edu> biff@eyeball.ophth.bcm.tmc.edu.UUCP (Brad Daniels) writes: >> for (p = a; p < (a+NTHINGS); p++) >What if (a+NTHINGS) wraps around the address space in such a way that >(a+NTHINGS) < a? Loop #1 would execute 0 times, loop #1 would execute >properly ... translating to your style (which looks better to these >eyes), > for (p = a; p <= (a+NTHINGS-1); p++) That wasn't the fellow's question. In any case, your suggestion fails for NTHINGS==0, since a-1 CAN wrap around the address space; the original CANNOT wrap around (it is forbidden by the language rules). You got this exactly backwards.