Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!cca!mirror!prism!billc
From: billc@prism.UUCP
Newsgroups: comp.lang.c
Subject: Re: Motivation behind a particular piec
Message-ID: <236100007@prism>
Date: Wed, 25-Nov-87 10:54:00 EST
Article-I.D.: prism.236100007
Posted: Wed Nov 25 10:54:00 1987
Date-Received: Sun, 29-Nov-87 10:16:47 EST
References: <981@gumby.UUCP>
Lines: 36
Nf-ID: #R:gumby.UUCP:-98100:prism:236100007:000:1185
Nf-From: prism.UUCP!billc    Nov 25 10:54:00 1987


>    I do not understand the motivation behind a following declaration
>    found in the sources of cpp.
> 
>      #define STATIC
> 
>      Then there are various declartions of the sort
>      STATIC char ch.
> 
>     If STATIC is defined to be null, why would one use it in declarations ?
	
	I admit, this does look unusual.  What you usually see is the
	following:

	#ifdef DEBUG
	#define STATIC
	#else
	#define STATIC static
	#endif

	That way, the run version of the program has the variables
	declared static, while the debug version has them global, which
	on many debuggers makes their values easier to obtain.

	I realize I answered a different question than the one you
	asked, but I suspect the two are related.  It seems that you may
	have a set of code which was half-heartedly trying to do this,
	but was never fully implemented, or perhaps it was found that the
	code needed to have global rather than static declarations for the
	STATIC-ly defined variables.  Either way, the code is a bit sloppy,
	in my opinion.  (Pleas flame me by mail rather than here if I'm
	wrong! :-)


Bill C.		billc@mirror.TMC.COM
		{mit-eddie, ihnp4, wjh12, cca, cbosgd, seismo}!mirror!billc