Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!uwvax!umnd-cs!umn-cs!meccts!nis!viper!john From: john@viper.Lynx.MN.ORG (John Stanley) Newsgroups: comp.lang.c Subject: Re: Query: Implementation with non-zero NULL Message-ID: <1070@viper.Lynx.MN.ORG> Date: Mon, 1-Jun-87 01:03:31 EDT Article-I.D.: viper.1070 Posted: Mon Jun 1 01:03:31 1987 Date-Received: Tue, 2-Jun-87 06:18:17 EDT References: <158@delftcc.UUCP> Reply-To: john@viper.UUCP (John Stanley) Organization: DynaSoft Systems Lines: 35 Keywords: C, NULL, portability In article <158@delftcc.UUCP> henry@delftcc.UUCP (Henry Rabinowitz) writes: > >Are static pointers initialized to all bits zero or to the null value >(as in ANSI spec)? > 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. It can initialy hold literaly -any- value that variable can possibly hold. You should never assume anything about any variable until you've set it. If, as you stated, you're writing a book on portability, you should mention that neither of the alternatives you mention is guarenteed. If the programmer wants anything, including null pointers -or- null bits, in a pointer, the value -MUST- be explicitly defined. I've written code for more than one system where if you don't specify the value, you get whatever was there before you. The ANSI standard may specify something as a default, but if you really expect to make your code portable you really need to explicitly tell the compiler what it's suppost to be doing. That way you don't get as many unpleasant surprises when you try porting to another system... If, on the other hand, I've missed the point you were getting at.. "Oh really? (long pause) Nevermind...." --- John Stanley (john@viper.UUCP) Software Consultant - DynaSoft Systems UUCP: ...{amdahl,ihnp4,rutgers}!{meccts,dayton}!viper!john