volatile registers, etc

Jerry Schwarz jss at hector.UUCP
Sat Jan 7 03:23:37 AEST 1989


"volatile register" has a use.  Consider

void f() {
	jmp_buf env ;
	volatile register int x = 1 ; 
	if ( setjmp(b) ) { 
		printf("%d",x) ; 
			/* Guaranteed to print 1 
			 * because x is volatile */
		} 
	...
	}

Jerry Schwarz
AT&T Bell Labs, Murray Hill



More information about the Comp.std.c mailing list