Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jul 2014 04:33:37 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Benjamin Kaduk <bjkfbsd@gmail.com>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Ian Lepore <ian@freebsd.org>
Subject:   Re: svn commit: r269112 - head/sys/boot/arm/at91/boot2
Message-ID:  <20140727040529.X5986@besplex.bde.org>
In-Reply-To: <CAJ5_RoBe-NWuxUgefoLvOCshe_HoYsekcHNpuyOGxh5g%2BT4YLg@mail.gmail.com>
References:  <201407260409.s6Q49i20065578@svn.freebsd.org> <CAJ5_RoBe-NWuxUgefoLvOCshe_HoYsekcHNpuyOGxh5g%2BT4YLg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 26 Jul 2014, Benjamin Kaduk wrote:

> On Sat, Jul 26, 2014 at 12:09 AM, Ian Lepore <ian@freebsd.org> wrote:
>
>> Author: ian
>> Date: Sat Jul 26 04:09:43 2014
>> New Revision: 269112
>> URL: http://svnweb.freebsd.org/changeset/base/269112
>>
>> Log:
>>   The 'flags' variable is conflicting with some inline code in a header
>> file
>>   ("variable flags shadows a global..."), just rename this variable to
>>   wish away the problem.
>
> Not trying to pick on you, but we have lots of places where we get
> "variable <foo> shadows a global..." -- we have a global variable 'buf' in
> the kernel namespace, for one :)
> Do we think it's a good use of our time to try and get this to zero
> instances?

Not very good, and it is negatively good to unimprove local names because
of namespace pollution in global names.

The shadowing for 'buf' can only be seen by C compilers that look only
at source files for the file being compiled if <sys/buf.h> is included,
but namespace pollution makes it more visible.  The pollution is
relatively small.  In freefall's kernel now, according to word counts
of .depend, there are approx. 187338 included files only 174 of them are
sys/buf.h.  The number of nested includes (adjusted for kernel feature
expansion) has increased by about a factor of 3 in the last 15 years
since I stopped trying to police it.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140727040529.X5986>