Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site hwcs.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!houxm!houxz!vax135!ukc!edcaad!hwcs!andrew From: andrew@hwcs.UUCP (Andrew Stewart) Newsgroups: net.unix-wizards,net.lang.c Subject: Re: NULL as a pointer value... Message-ID: <127@hwcs.UUCP> Date: Thu, 12-Jul-84 14:10:52 EDT Article-I.D.: hwcs.127 Posted: Thu Jul 12 14:10:52 1984 Date-Received: Sun, 1-Jul-84 06:42:21 EDT Distribution: net.unix-wizards,net.lang.c Organization: Computer Sci., Heriot-Watt U., Scotland Lines: 24 I am in the depths of yet another discussion about types in C, and I'm looking for comments, etc. on this: Which is better coding style, char *x; ..... x = (char *)NULL; or char *x; ..... x = NULL; I am unhappy about NULL as a polymorphic pointer type, since it's actually just a macro, *but* is that relevant? K&R say (can't recall where) that NULL is an illegal pointer for *any* object, and yet x = NULL; .... y = *x; will not blow up, unless you do clever things with page 0. And what about return((char *)NULL); or return(NULL); This may have been aired before - if so, forgive me - but it seems rather interesting. ---------------- "Not a bug, a feature! It's documented, dash it!" Andrew Stewart. ...!vax135!ukc!edcaad!hwcs!andrew (UUCP)