Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 7/7/83; site rlgvax.UUCP
Path: utzoo!linus!philabs!seismo!rlgvax!tom
From: tom@rlgvax.UUCP
Newsgroups: net.lang.c
Subject: Re: "Re: Array Initialization - (nf)"
Message-ID: <798@rlgvax.UUCP>
Date: Fri, 8-Jul-83 15:34:13 EDT
Article-I.D.: rlgvax.798
Posted: Fri Jul  8 15:34:13 1983
Date-Received: Sat, 9-Jul-83 15:52:52 EDT
References: <156@ihlpf.UUCP>
Organization: CCI Office Systems Group, Reston, VA
Lines: 25

The "bible" (i.e. Kernighan & Ritchie's book) states quite clearly on
page 198 of the C Refernce Manual that:

	Static and externals that are not initialized are guaranteed
	to start off as 0;

There is little room for disagreement.  Until there is a C language Standard,
the K & R book is the closest to one we have.  When a Standard finally is
developed, I'll give very good odds that this requirement is in there.
In fact, every C compiler specification (contract, product requirement,
etc) that I have seen calls for implementation according to the K & R
book.

So, if it doesn't default initializations to 0, it AIN'T C.

If you are still nervous about portability (I usually am), every variant of
a C compiler that I have seen (at least 12 that I can think of offhand)
does default initialization to 0.

However, it is a good programming practice to do explicit initialization
to 0.  The reason is program legibility.  If its important that the
initial value be 0, why keep it a secret?

- Tom Beres
{seismo, allegra, mcnc}!rlgvax!tom