Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!linus!philabs!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: NULL vs 0 Message-ID: <1592@rlgvax.UUCP> Date: Fri, 20-Jan-84 20:35:24 EST Article-I.D.: rlgvax.1592 Posted: Fri Jan 20 20:35:24 1984 Date-Received: Sat, 21-Jan-84 08:31:34 EST References: <345@hocda.UUCP> <2406@rabbit.UUCP>, <4808@umcp-cs.UUCP> <126@exodus.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 9 Unfortunately, NULL should *not* be (char *)0, because there is no such thing as a generic null pointer in C. Each type of pointer has its own flavor of null pointer. If you declare NULL as (char *)0, then if you pass NULL to a routine which expects (int *)0, you will get a complaint from "lint" at best and a dead program at worst - what if you have a word-addressed machine in which (int *) takes 16 bits but (char *) takes 32? Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy