register variables in C

Guy Riddle ggr at hudson.UUCP
Mon Mar 19 05:28:31 AEST 1984


Rick Thomas states:

> PCC, at least, enforces this restriction; you cannot apply the '&'
> operator to a register variable.

However, this is not quite true.  Pcc enforces the restriction on
variables declared 'register' that have actually been allocated
to registers and not on those that have been converted to automatic storage.

For example, this program gets an error message:

	main(){
		register a,b,d,c,e,f,g,h,i,j,k,l,m,n,o,p;

		fn(&a);
	}

But this one doesn't:

	main(){
		register a,b,d,c,e,f,g,h,i,j,k,l,m,n,o,p;

		fn(&n);
	}
			=== Guy Riddle == AT&T Bell Laboratories, Piscataway ===



More information about the Comp.lang.c mailing list