Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!hpda!hpsmtc1!hpisod2!decot From: decot@hpisod2.HP.COM (Dave Decot) Newsgroups: comp.lang.c Subject: Re: A modest proposal Message-ID: <2550023@hpisod2.HP.COM> Date: Wed, 29-Jul-87 15:45:28 EDT Article-I.D.: hpisod2.2550023 Posted: Wed Jul 29 15:45:28 1987 Date-Received: Sat, 1-Aug-87 15:02:16 EDT References: <1362@cullvax.UUCP> Organization: Hewlett Packard, Cupertino Lines: 29 0 is currently not a null pointer constant of any type. 0 is an integer constant that can be assigned to any pointer variable, or cast to any pointer type, producing a mysterious null pointer value of the appropriate type. 0 can also be used to initialize pointer variables to such a mysterious null pointer value. Pointer-valued expressions can also be compared for equality or inequality to the appropriate mysterious null pointer value by testing them against the integer constant 0. An integer 0 has no other appropriate usage in contexts where a pointer value is ordinarily required; specifically, it is unusable as an actual parameter in a function call unless transformed into the appropriate mysterious null pointer value by a cast. The language definition does not guarantee that the stored versions of mysterious null pointer values for different pointer types have the same bit pattern, or even that they are the same length. It does not even guarantee that two null pointers of the same type have the same bit pattern, although they must appear to be equal when compared to each other and 0. I see no real benefit to providing a NULL keyword in C, since 0 already suffices. If it is desired in ANSI C that 0 be automatically converted to the appropriate null pointer value when used as an actual parameter to a function with a prototype in scope, that's fine with me. Dave Decot hpda!decot