Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.unix-wizards,net.lang.c Subject: Re: Using NULL as an illegal pointer Message-ID: <7713@umcp-cs.UUCP> Date: Mon, 2-Jul-84 00:14:09 EDT Article-I.D.: umcp-cs.7713 Posted: Mon Jul 2 00:14:09 1984 Date-Received: Tue, 3-Jul-84 03:40:52 EDT References: <1273@sri-arpa.UUCP> <4011@utzoo.UUCP> <311@harvard.ARPA> Organization: Univ. of Maryland, Computer Science Dept. Lines: 18 You can argue the merits of ``char *foo = NULL;'' versus ``char *foo = (char *)NULL;'' 'til you're blue in the face, but the C language specification requires that assignments (and return values) be of the same type as the left hand side of the assignment (or the type of the function). If a C compiler generate different code for char *func() { return 0; } and char *func() { return (char *) 0; } then it is broken. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland