Subject: Re: CVS commit: src/sys/kern
To: None <source-changes@NetBSD.org>
From: Christoph Badura <bad@bsd.de>
List: source-changes
Date: 06/09/2005 00:13:56
On Wed, Jun 08, 2005 at 10:19:42AM +0200, Havard Eidnes wrote:
> > On Sun, Jun 05, 2005 at 07:00:00PM -0700, Erik E. Fair wrote:
> > > IMHO, I'd say that when MD variable names conflict with MI variable 
> > > names, MI gets priority.
> > Yes, I agree. The sparc64 MD variable should be changed (or the conflict
> > resolved in another way).
> Well...  What we're talking about here is a local variable in an
> MI function which counts the number of CPUs in a system and
> returns that number.  Is there a good reason it cannot or should
> not be renamed from "ncpus" to e.g. "cpus"?

Yes, there is indeed.  Programming languages with scopes for local variables
were introduced ~40 years ago, precisely so that we could get away from
FORTRAN COMMON blocks and actually shadow global variables with local variables
of the same name.  I find it difficult to understand why we are changing our
sources so that they have a chance to be backported to some language and
compiler technology that we were lucky to escape from almost half a century
ago.

I do think that auditing the code for variable shadowing bugs is worthwhile.
I don't think we should restrict our code to FORTRAN IV semantics to help
the auditing.

--chris