Subject: Re: "const int" in conf/param.c?
To: None <tech-kern@netbsd.org>
From: Guenther Grau <Guenther.Grau@bk.bosch.de>
List: tech-kern
Date: 04/28/1999 19:29:52
"Eduardo E. Horvath" wrote:
> 
> On Wed, 28 Apr 1999, I. Souvatzis wrote:
> 
> > On Wed, Apr 28, 1999 at 02:53:37AM +0200, Olaf Seibert wrote:
> > > On Tue, 27 Apr 1999, Simon Burge wrote:
> > >
> > > > "Eduardo E. Horvath" wrote:
> > > >
> > > > > sparc64 currently runs in either 32-bit or 64-bit mode, so the mbuf size
> > > > > should vary depending on the kernel.  What we really need is some cpp
> > > > > define that reports pointer size so we can check that rather than:
> > > > >
> > > > > #if defined(alpha) || (defined(sparc64) && defined(__arch64__)) || \
> > > > >         (defined(mips) && ...) || (defined(powerpc) ....
> > > >
> > > > It doesn't have to be that bad:
> > > >
> > > > #define MSIZE     (128 * (sizeof(void *) / 4))
> > >
> > > But you can never use MSIZE in an #if, since the preprocessor does not
> > > know about sizeof().
> > >
> > > (No, don't tell me about gcc extensions. I know. It's Not Standard.)
> > >
> >
> > I repeat the question somebody else asked:
> >
> > do we really need a CPP definition, or do we just need it so that the
> > _compiler_ can declare the mbuf header?
> 
> Yes, we really need a CPP definition.  Here's a bit of code from
> nfs_subs.c:
[...]
> In most parts of MI code `#if defined(alpha)' is synonymous with LP64.
> Then there are the userland bits as well.

Hmm, I think the question was if we need a CPP of MSIZE and
not if we need a CPP definition of alpha or DIAGNOSTIC. I 
agree that the given simplification is not valid for all
symbols, but for MSIZE it should be.

Or am I missing something here?

  Guenther