Path: utzoo!yunexus!gen1!bob From: bob@gen1.UUCP (Robert Kamins) Newsgroups: comp.lang.c Subject: Re: Caution for those considering MSC 5.0 Keywords: Right right right! Message-ID: <333@gen1.UUCP> Date: 29 Feb 88 18:07:13 GMT Article-I.D.: gen1.333 Posted: Mon Feb 29 13:07:13 1988 References: <66@obie.UUCP> <417@white.UUCP> Reply-To: bob@gen1.UUCP (Robert Kamins) Organization: gen1 - York University, Petrie Bldg, Downsview, Ontario CANADA Lines: 25 In article <417@white.gcm> dc@gcm (Dave Caswell) writes: >In article <66@obie.UUCP> wes@obie.UUCP (Barnacle Wes) writes: >) >)> but isn't all global data implicitly >)> initialized to zero if not otherwise specified? >) >)No, as a matter of fact, it ISN'T supposed to be zeroed, it's supposed >)to be left as it was! MSC isn't wrong here, your code is wrong >)because it was written to work with Turbo C, which is wrong. > >You are wrong wrong wrong. [etc] Kernighan & Ritchie, "The C Programming Language", Appendix "A", Section 8.6 (p. 198, re: "Initialization") says: "Static and external variables which are not [specifically] initialized are guaranteed to start off as 0; automatic and register variables which are not initialized are guaranteed to start off as garbage." I have inserted "specifically" in the first line since the context infers it. Bob Kamins.