Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Mar 1999 11:34:57 -0700
From:      Nate Williams <nate@mt.sri.com>
To:        Brian Feldman <green@unixhelp.org>
Cc:        Nate Williams <nate@mt.sri.com>, John Polstra <jdp@polstra.com>, current@FreeBSD.ORG
Subject:   Re: callout changes nit
Message-ID:  <199903061834.LAA24560@mt.sri.com>
In-Reply-To: <Pine.BSF.4.05.9903061315390.17793-100000@janus.syracuse.net>
References:  <199903061736.KAA24445@mt.sri.com> <Pine.BSF.4.05.9903061315390.17793-100000@janus.syracuse.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > I make a habit of checking out any interesting kernel changes in full, and one
> > > > thing I found in the recent diff by Mr. Wollman for kern_timeout.c is:
> > > > 
> > > > +void
> > > > +callout_init(c)
> > > > +       struct  callout *c;
> > > > +{
> > > > +       bzero(c, sizeof c);
> > > >  }
> > > > 
> > > > That doesn't look correct, does it?
> > > 
> > > Agreed.  I think it should be "sizeof *c".
> > 
> > Ahh, I see.  I think it should say
> > 
> >        bzero(c, sizeof(struct callout));
> > 
> > To avoid the compiler using the size of the pointers et. al.
> > 
> 
> I prefer to do this in my own code, usually. However, using *c doesn't
> "use the size of the pointer".

Understood, but the point being that Garrett is an experienced
programmer, and made this mistake.  The latter version avoids any
possibilities of said mistake.



Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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