Subject: Re: clear m_pkthdr on MGETHDR()
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Olaf Seibert <firstname.lastname@example.org>
Date: 06/06/2001 11:22:57
On Sat 02 Jun 2001 at 12:17:14 -0400, der Mouse wrote:
> >> I note that struct pkthdr includes a pointer. Is it correct to
> >> deduce that NetBSD doesn't care about the nonportability of using
> >> bzero/memset on a pointer? (There is nothing in C that requires
> >> that all-0-bits be anything meaningful, or even copyable, as a
> >> pointer value, much less a nil pointer. [...])
> > We, being the implementors of the compiler and the runtime
> > environment, can decide that all-0-bits is a null pointer.
> I thought we were just using gcc, which would mean that we aren't the
> implementors of the compiler.
We are, at least in theory. That we "subcontracted" the work to the gcc
people is a mere detail. And I bet that with some configuration option
somewhere or other, gcc can be convinced of some other value than
all-bits-0 for a null pointer.
> I also thought there was an explicit goal that NetBSD stuff be
> compilable on other systems that support ANSI C, with their native
> compilers, which *definitely* aren't under "our" control.
That is a better argument :-)
> > (nitpick: not nil)
> No? What's the difference between a null pointer and a nil pointer? I
> have always thought them just two terms for the same thing, and have
> always preferred "nil pointer" because there are too many things
> similar enough to "null" to be confusing, perhaps most notably NULL,
> which is not necessarily a pointer.
The C89 standard (and K&R, too) use the term null pointer. So using any
other term would be confusing.
NULL is a special case. Although #defined to be 0, it is meant to be
used as a pointer. In the past I'd have looked up the comp.lang.c FAQ
which treats this matter, but I've become lazy and let you do it
> /~\ The ASCII der Mouse
___ Olaf 'Rhialto' Seibert - rhialto@polder --Soep van de dag, wat zal dat zijn
\X/ land.nl --wat kan dat wezen, beter maar het ergste vrezen -Boy Bensdorp