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

From: Nicolas Martyanoff <khaelin_AT_gmail.com>
Date: Sun, 7 Sep 2008 13:18:00 +0200

On Sun, 7 Sep 2008 11:25:53 +0200
"Szabolcs Nagy" <nszabolcs_AT_gmail.com> wrote:

> On 9/6/08, Filippo Erik Negroni <f.e.negroni_AT_googlemail.com> wrote:
> > A preferable, safer and more portable way of achieving such
> > initialisation is to use the compiler's static initialisation.
>
> is it because of null pointer might not be represented as zeros?
I don't think so.

K&R, 2nd Ed. page 102:
"Pointers and integers are not interchangeable. Zero is the sole
exception: the constant zero may be assigned to a pointer, and a
pointer may be compared with the constant zero. The symbolic constant
NULL is often used in place of zero, as a mnemonic to indicate that
this is a special value for a pointer"

I think it's quite explicit: the NULL macro expands to 0.

-- 
Nicolas Martyanoff
   http://codemore.org
   khaelin_AT_gmail.com

Received on Sun Sep 07 2008 - 11:18:00 UTC

This archive was generated by hypermail 2.2.0 : Sun Sep 07 2008 - 11:24:04 UTC