From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4b7e5d755c4b21a4e2dd0185fd324f83@plan9.bell-labs.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] same functions everywhere From: "Russ Cox" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Thu, 15 May 2003 12:19:18 -0400 Topicbox-Message-UUID: ad02fa7c-eacb-11e9-9e20-41e7f4b1d025 > >You're all nuts. But at least use nelem(a) in > >place of sizeof(a)/sizeof(int). > > shouldn't that be called nwords/nints(a) or else shouldn't the > expression be (sizeof(a)/sizeof(*(a)))? No, it should be called nelem because it's defined (in libc.h): #define nelem(x) (sizeof(x)/sizeof((x)[0])) You've pointed out a bug in what they were using, which was part of why I suggested nelem.