Caution for those considering MSC 5.0

Robert Kamins bob at gen1.UUCP
Tue Mar 1 04:07:13 AEST 1988


In article <417 at white.gcm> dc at gcm (Dave Caswell) writes:

>In article <66 at obie.UUCP> wes at 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.



More information about the Comp.lang.c mailing list