Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP
Path: utzoo!linus!decvax!harpo!floyd!cmcl2!philabs!seismo!rlgvax!cvl!umcp-cs!chris
From: chris@umcp-cs.UUCP
Newsgroups: net.lang.c
Subject: Re: Initializing Vars in non-OS C systems
Message-ID: <1074@umcp-cs.UUCP>
Date: Sat, 23-Jul-83 02:24:33 EDT
Article-I.D.: umcp-cs.1074
Posted: Sat Jul 23 02:24:33 1983
Date-Received: Tue, 26-Jul-83 17:05:21 EDT
References: <1618@ihnss.UUCP>
Organization: Univ. of Maryland, Computer Science Dept.
Lines: 27

Since the thing that started this discussion was Whitesmith C, let me
point out yet again that the problem is not that they don't set statics
to zero.  They *do* set statics to zero -- try

	main () { static x; putfmt ("x=%d\n", x); }

and you get zero (I forget if you use putfmt that way, but you probably
understand what I mean).  The problem is that they don't create a
global variable unless you initialize it!  Try

	int var;
	main () { foo (var); }
	foo (n) int n; { }

Compile, and you get:  "Undefined: var.".  If you use

	int var =  ;

it compiles correctly.  But if you don't initialize it it's considered
*external*.

				- Chris
-- 
In-Real-Life:	Chris Torek, Univ of MD Comp Sci
UUCP:		{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:		chris@umcp-cs
ARPA:		chris.umcp-cs@UDel-Relay