register variables

Chris Torek chris at umcp-cs.UUCP
Tue Jun 25 02:39:52 AEST 1985


Ken Arnold makes a good point here:

> You have an infinite number of registers.  No, seriously, this is the
> way to think about it.  You should declare EVERYTHING which you don't
> have to take the address of to be a register. [...] Just be somewhat
> careful to declare things in the order you care about.

I have to admit to getting into the sloppy habit of stopping after
six register declarations.  But that's not why I'm writing this.
. . what I really want to do is make another point here, and that
is that you should declare register variables before ordinary
variables (in general), since some machines (Pyramids) ignore the
word ``register'' and just put the first N (12) variables in
registers.  (Such a machine must, of course, be able to take the
address of a register.)

Also (last point---I promise!), to C compiler writers: please don't
parse the list of declarations and then perform the declarations in
reverse order!
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Comp.lang.c mailing list