svn commit: r269112 - head/sys/boot/arm/at91/boot2

Bruce Evans brde at optusnet.com.au
Sat Jul 26 18:33:49 UTC 2014


On Sat, 26 Jul 2014, Benjamin Kaduk wrote:

> On Sat, Jul 26, 2014 at 12:09 AM, Ian Lepore <ian at 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


More information about the svn-src-head mailing list