🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5560

Re: volatile registers, etc

#5560
From: Jerry Schwarz
Date: Fri, 06 Jan 1989 17:23
15 lines
797 bytes
"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
Technical Details
Message-ID: <11070@ulysses.homer.nj.att.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!ulysses!hector!jss
References: <141@bms-at.UUCP> <275@twwells.uucp> <15166@mimsy.UUCP> <9316@ihlpb.ATT.COM> <15276@mimsy.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!ulysses!hector!jss
From: jss@hector.UUCP (Jerry Schwarz)
Newsgroups: comp.std.c
Subject: Re: volatile registers, etc
Message-ID: <11070@ulysses.homer.nj.att.com>
Date: 6 Jan 89 17:23:37 GMT
References: <141@bms-at.UUCP> <275@twwells.uucp> <15166@mimsy.UUCP> <9316@ihlpb.ATT.COM> <15276@mimsy.UUCP>
Sender: netnews@ulysses.homer.nj.att.com
Reply-To: jss@hector.UUCP (Jerry Schwarz)
Organization: AT&T Bell Laboratories
Lines: 15