Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!virtech!cpcahil
From: cpcahil@virtech.UUCP (Conor P. Cahill)
Newsgroups: comp.lang.c
Subject: Re: Declaration within a loop.
Summary: what about register variables
Message-ID: <1200@virtech.UUCP>
Date: 28 Sep 89 00:06:09 GMT
References: <2085@hydra.gatech.EDU> <30174@news.Think.COM> <559@crdos1.crd.ge.COM>
Distribution: usa
Organization: Virtual Technologies Inc
Lines: 23

In article <559@crdos1.crd.ge.COM>, davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) writes:
>   Most C compilers allocate space on the stack for this when the
> procedure is entered. It therefore is not a practical thing to do to
> save space. The most common use is to correct for having forgotten to
> declare a variable at the start of a procedure.


There are two reasons that I will normally use for justifying variable
declarations and neither of them are to save space.

The first is #define macros. For example:

	#define	DEBUG(key,msg) {char buf[512];.... }

The second is to try to segregate the use of register variables.  I'm not
too sure this really has an effect in all compilers, but at least it gives
it a chance.

-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+