In defense of C

G.TOMASEVICH grt at hocda.UUCP
Wed Feb 29 04:18:15 AEST 1984


The comments concerning non-automatic reuse of automatic variables with
nonoverlapping domains reminded me that one can reuse register variables.
I don't know if this applies to non-register automatics and would be
interested in finding out.  One can create blocks, as in ALGOL, with curly
braces, in which registers are re-used, according to what I have seen in
PDP assembly translation of C.  Example:

func(a)
{
	register int i, j;
	switch(a) {
	case 0:
	    {
	    register int x;
	    ...
	    break;
	    }
	case 1:
	    {
	    register int y;
	    ...
	    break;
	    }
	}
}

The variables 'x' and 'y' are assigned to the same register.  How much
of this ALGOL type blocking exists in C?  Can someone point me to any
references?  (How big is a pointer to a document? :-) )



More information about the Comp.unix.wizards mailing list