Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!sri-unix!quintus!sun!moria!dunc From: dunc%moria@Sun.COM (duncs home) Newsgroups: comp.lang.c Subject: Re: Global variables (was Re: Caution for those considering MSC 5.0) Message-ID: <42890@sun.uucp> Date: 23 Feb 88 19:25:16 GMT References: <11754@brl-adm.ARPA> <620@viper.Lynx.MN.Org> <2302@umd5.umd.edu> <987@ssc-bee.ssc-vax.UUCP> Sender: news@sun.uucp Reply-To: dunc@sun.UUCP (duncs home) Organization: Sun Microsystems, Mountain View Lines: 13 In article <987@ssc-bee.ssc-vax.UUCP> lee@ssc-vax.UUCP (Lee Carver) writes: >NEVER, NEVER, NEVER assume the system is going to put something >there unless you explicitly request it. It stops a lot of bugs dead >in their tracks. You might get away with it if you don't, but how >will you be sure? According to K&R 8.6: "Static and external variables which are not initialized are guaranteed to start off as 0; ..." However it's still a good idea to do your initializations explicitly; it helps keep programmers who are unfamiliar with the fine details of C from getting needlessly confused. (And since a lot of those programmers seem to be writing micro C compilers, it makes you program more portable 8^).