Uninitialized externals and statics.

todd barkus barkus at amcom.UUCP
Sat Aug 19 16:20:44 AEST 1989


In article <10764 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>>In article <2128 at infmx.UUCP> dror at infmx.UUCP (Dror Matalon) writes:
>>-	K&R 2.4 say "External and static variables are initialized 
>>-to zero by default, but it is good style to state the initialization
>>-anyway."
>>-	Is this really portable ?
>>
>It's supposed to have always been the rule.
>There certainly is a lot of C code that depends on it.

Rules are great, especially when every one follows them.
Unfortunately not every one does.  We have one if not two boxes
whose compilers evidently do not know how to read (some of us keep our
K&R right next to the terminal, so it's not like they wouldn't have
access to one).

"The person who assumes the answer often answers to their assumption".

I think that is a tebarkus original, (it just popped into my head),
which is not to say someone else with alot of unused space in their
head might not of had the idea first :-).



More information about the Comp.lang.c mailing list