Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!att!cbnewsl!mpl From: mpl@cbnewsl.ATT.COM (michael.p.lindner) Newsgroups: comp.lang.c Subject: Re: A nice macro Summary: foo considered dangerous Message-ID: <887@cbnewsl.ATT.COM> Date: 22 Jun 89 18:15:36 GMT References: <2784@solo8.cs.vu.nl> Organization: AT&T Bell Laboratories Lines: 26 In article <2784@solo8.cs.vu.nl>, maart@cs.vu.nl (Maarten Litmaath) writes: > An often-heard complaint by Pascal dweebs on C is the absence of the > equivalence of . . . > bar _foo[HIGH - LOW + 1]; > > #define foo (_foo - LOW) . . . > There's only one (small) objection: name space pollution - an invisible > extra identifier `_foo' is needed. I can think of another objection. The C convention that the address of the first element of an array == its name. Not to mention that this "foo" can no longer be passed to sizeof(). And I'm sure some cleverer people will notice that "foo" may not be calculable in some implementations of C, since it involves an address BEFORE the actual start of an array. Mike Lindner attunix!mpl AT&T Bell Laboratories 190 River Rd. Summit, NJ 07901