Uninitialized externals and statics.

ody davidsen at sungod.crd.ge.com
Tue Aug 22 01:28:15 AEST 1989


  Although the proposed ANSI standard (3.5.7 line 20) calls for
initialization to zero, cast to the appropriate type (my paraphrase) for
arithmetic and pointer types, virtually all implementations initialize
to zero (without cast) in the absense of explicit initialization.

  For reasons of "real" portability (what works vs. what any standard
says) I recommend initializing all float and pointer types explicitly if
you what to be sure code will work on machines in which float zero and
NULL are not "all bits off." This will not in any way may your code less
portable to environments which implement the proposed standard, but will
minimize your "learning experiences."
	bill davidsen		(davidsen at crdos1.crd.GE.COM)
  {uunet | philabs}!crdgw1!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.lang.c mailing list