style(9) sweep on config(8)

Dave Cuthbert dacut at neolinear.com
Thu Mar 4 16:04:04 PST 2004


Chris Pressey wrote:
	o  Use memset(ptr, 0, size) instead of bzero(ptr, size)
Is there a reason why uses of bzero() should be changed to memset()?

I've always found memset usage more error-prone; every so often, I
find myself setting a random value to zero bytes, i.e.,
memset(ptr, size, 0), which the compiler doesn't pick up.
I'm not sure about the size/speed tradeoffs in inlined versions of
memset() vs. bzero() either; then again I've never seen either function
show up in a runtime profile, so this doesn't concern me.
Dave





More information about the Submit mailing list