Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!ames!think!husc6!cmcl2!rutgers!dayton!viper!john From: john@viper.UUCP Newsgroups: comp.lang.c Subject: Re: Query: Implementation with non-zero NULL Message-ID: <1082@viper.Lynx.MN.ORG> Date: Wed, 3-Jun-87 16:59:54 EDT Article-I.D.: viper.1082 Posted: Wed Jun 3 16:59:54 1987 Date-Received: Sat, 6-Jun-87 04:32:46 EDT References: <158@delftcc.UUCP> <1070@viper.Lynx.MN.ORG> <6873@mimsy.UUCP> Reply-To: john@viper.UUCP (John Stanley) Organization: DynaSoft Systems Lines: 30 Keywords: C, NULL, portability In article <6873@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: > >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. > The message I was replying to was discussing points relating to common problems/pitfalls in writing portable code. From this it should be obvious that "what K&R says" is not as relevent as "what have people encountered in real life". With all due respect to Chris and K&R, what I was (poorly) trying to say was, that when trying to write portable code, you should never use a variable before it's been explicitly initialized. This may seem irrelevant to you, but it may be significant to someone else trying to write or port code to a system/compiler where the strict word-of-K&R may not have been fully implemented. What's that you say? No program would ever fail to run on your system because someone used a "feature" defined in K&R that didn't work that way on your system? Mind telling me what you've been smoking and where I can get some? :-) :-) :-) --- John Stanley (john@viper.UUCP) Software Consultant - DynaSoft Systems UUCP: ...{amdahl,ihnp4,rutgers}!{meccts,dayton}!viper!john