Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Query: Implementation with non-zero NULL Message-ID: <6873@mimsy.UUCP> Date: Mon, 1-Jun-87 21:43:03 EDT Article-I.D.: mimsy.6873 Posted: Mon Jun 1 21:43:03 1987 Date-Received: Wed, 3-Jun-87 03:55:02 EDT References: <158@delftcc.UUCP> <1070@viper.Lynx.MN.ORG> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 23 Keywords: C, NULL, portability In article <1070@viper.Lynx.MN.ORG> john@viper.Lynx.MN.ORG (John Stanley) writes: > If, you're refering to an initialized static, it's whatever you >specify. If, on the other hand, you're refering to an UN-initialized >static pointer, the answer is a resounding "Neither!".... An un- >initialized variable is just that. Wrong. See K&R, p. 198. Similar (but no doubt more precise) wording can be found in H&S and in the dpANS. Unitialised static pointers must contain NULL, or the implementation is broken [1]. Automatic variables, including registers, that are not initialised contain trash; the trash may be machine dependent, as on, e.g., 4BSD Vaxen, where new stack pages are zero filled. ---- [1] Except static unions, where it may be impossible to have all union members start off as zero or NULL, since zero and NULL may differ (and indeed, zero and zero may differ, e.g., floating zero versus integer zero). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris