Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Feb 1997 00:14:59 -0800 (PST)
From:      John-Mark Gurney <jmg@nike.efn.org>
To:        Peter Mutsaers <plm@xs4all.nl>
Cc:        freebsd-bugs@freefall.freebsd.org
Subject:   Re: bin/2752: NULL is used instead of 0 many places
Message-ID:  <Pine.BSF.3.95q.970218001257.18336B-100000@hydrogen.nike.efn.org>
In-Reply-To: <199702180750.XAA02761@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 17 Feb 1997, Peter Mutsaers wrote:

>      AHJ> 	Appy following patch.  This changes NULL to 0 most places
>      AHJ> 	but to '\0' in character context, to be more stylistically
>      AHJ> 	correct.
>  
>  Why is using '\0' more stylistically correct? A pointer is a pointer,
>  and one can always assign 0 to it.

yes... but he's talking about this:

char a = '\0';

this way the compiler KNOWS it's a char... and that it's the nul char...
and doesn't convert the int 0 to char 0...

>  One does not assign 0L to an long* either, but simply 0.

John-Mark

gurney_j@efn.org
http://resnet.uoregon.edu/~gurney_j/
Modem/FAX: (541) 683-6954   (FreeBSD Box)

Live in Peace, destroy Micro$oft, support free software, run FreeBSD (unix)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970218001257.18336B-100000>