Date: Sun, 12 Mar 2017 16:54:22 -0700 From: Ngie Cooper <yaneurabeya@gmail.com> To: Ian Lepore <ian@freebsd.org> Cc: Pedro Giffuni <pfg@FreeBSD.org>, Lawrence Stewart <lstewart@freebsd.org>, src-committers@freebsd.org, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>, svn-src-head@freebsd.org Subject: Re: svn commit: r314780 - head/lib/libpam/modules/pam_exec Message-ID: <FEA3C9FA-559C-4B20-A525-FF0ACAEEE380@gmail.com> In-Reply-To: <1489341856.40576.88.camel@freebsd.org> References: <201703061545.v26FjkNI027057@repo.freebsd.org> <739617a4-3eed-28d1-73e4-86d25d6d5fed@freebsd.org> <1839903b-fb05-bf3f-17bb-697afca9ecb7@FreeBSD.org> <1489341856.40576.88.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Mar 12, 2017, at 11:04, Ian Lepore <ian@freebsd.org> wrote: ... > A quirk of C that's often forgotten is that a function-like macro is > only expanded as a macro if the token following the macro name is an > open paren. So nitems() is a macro invokation and nitems =3D 0; is just > a variable. >=20 > I'm not arguing against the replacement of variables named nitems, I > actually think that should have been done as part of importing the > function-like definition of nitems from netbsd. Minor correction (as Pedro noted later): - NetBSD uses __arraycount. - OpenBSD uses nitems. FreeBSD has standardized on nitems, probably because it came about in 8.x, w= hereas __arraycount came about later. Cheers, -Ngie=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FEA3C9FA-559C-4B20-A525-FF0ACAEEE380>