Array Initialization & Whitesmith's

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Thu Jul 14 12:34:17 AEST 1983


Actually, at least in the C compilers we have from Whitesmiths, the
problem is not that the compiler doesn't initialize statics to zero.
The problem is that the compiler doesn't handle statics, or global
variables, correctly AT ALL.  (begin flame)  The program

	int variable;
	main (argc, argv) { ; }

will produce, when compiled, the error message

	Undefined: variabl

(or something like that).  Would you believe, Whitesmiths doesn't
define a global variable unless you initialize it?  It's true!  I spent
*hours* agonizing over this one once.  That ain't C.  A variable that
is declared outside of any program block should NOT default to
external!  Declaring a variable twice is an error (though Unix &
friends kindly handle it correctly anyway).  There should be exactly
one occurrance of "int foo;" or "int foo=x;"; any other declaration
should have the word "external" in front of it.  But NOOO, they
couldn't do THAT.  That'd make it too easy to use!  (end flame)
Other than that, Whitesmith's seems to be a pretty reasonable
implementation.

					- Chris
-- 
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs
ARPA:	chris.umcp-cs at UDel-Relay



More information about the Comp.lang.c mailing list