Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: SIZEOF Message-ID: <5036@utzoo.UUCP> Date: Fri, 8-Feb-85 12:58:18 EST Article-I.D.: utzoo.5036 Posted: Fri Feb 8 12:58:18 1985 Date-Received: Fri, 8-Feb-85 12:58:18 EST References: <347@ecr.UUCP> <393@rlgvax.UUCP>, <808@sjuvax.UUCP> Organization: U of Toronto Zoology Lines: 25 > 2. An object of integral type may be explicitly converted to a > pointer... > > Since compilers need to do type checking anyway, passing 0 instead of NULL > should always be valid. Wrong, you forgot the word "explicit". That means *you* have to do it. The compiler won't do it for you in parameter-passing. Remember that current C compilers do not (cannot) check types of parameters. > Note that K&R says that assigning 0 to an integer > generates the appropriate NULL pointer. This type conversion (it is > implied) is automagic, and thus there *is* a generic NULL, which is the > integer 0. For the 157th time, WRONG. The only generic NULL pointer in C is the *literal* integer *constant* 0. An integer *value* equal to 0 is *not* a NULL pointer; only the constant 0 will do. Unless the character "0" appears -- either explicitly or via "#define NULL 0" -- at the place where the conversion to pointer is being performed, then it's not a real NULL pointer. If you read K&R carefully, you will discover that this is what it really says. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry