Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!crdgw1!sungod!davidsen From: davidsen@sungod.crd.ge.com (ody) Newsgroups: comp.lang.c Subject: Re: Uninitialized externals and statics. Message-ID: <1786@crdgw1.crd.ge.com> Date: 21 Aug 89 15:28:15 GMT References: <2128@infmx.UUCP> <10764@smoke.BRL.MIL> <478.nlhp3@oracle.nl> <1989Aug19.053711.7462@twwells.com> Sender: news@crdgw1.crd.ge.com Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric Corp. R&D, Schenectady, NY Lines: 15 Although the proposed ANSI standard (3.5.7 line 20) calls for initialization to zero, cast to the appropriate type (my paraphrase) for arithmetic and pointer types, virtually all implementations initialize to zero (without cast) in the absense of explicit initialization. For reasons of "real" portability (what works vs. what any standard says) I recommend initializing all float and pointer types explicitly if you what to be sure code will work on machines in which float zero and NULL are not "all bits off." This will not in any way may your code less portable to environments which implement the proposed standard, but will minimize your "learning experiences." bill davidsen (davidsen@crdos1.crd.GE.COM) {uunet | philabs}!crdgw1!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me