Re: [dwm] malloc'ed client in manage()

From: Filippo Erik Negroni <f.e.negroni_AT_googlemail.com>
Date: Sun, 7 Sep 2008 21:24:50 +0100

If suckless.org is about code quality, memset to zero or calloc are
certainly not a good idea.
Code that sucks less is code that compiles for many years to come, and
strives for maximum portability, within reason.
Setting a NULL pointer to all-zero-bit is IMHO a sign of bad coding.
Whether Anselm wants that to go in the code or not is his preroative, hence
why I maintain my own patch queue with a patch code cleancode, that does
what I think is better.

And yes, a static char *p will be initialised to 0, and be == 0, because a 0
(zero) symbol in a source code file is th representation of both the
constant 0 and the NULL pointer.
NULL (as a cast from 0 to (void *)0 )is only really necessary for lazy
programmers using variadic functions (such as printf).
Received on Sun Sep 07 2008 - 20:24:50 UTC

This archive was generated by hypermail 2.2.0 : Sun Sep 07 2008 - 20:36:04 UTC