setjmp/longjmp

Clyde W. Hoover clyde at ut-emx.UUCP
Fri Apr 28 01:48:23 AEST 1989


	Well, we ran headlong into that very problem ourselves.  What is going on is that the Encore C compiler puts variables into registers (making the 'register' declaration somewhat superflous).  Upon longjmp, the contents of the registers are restored to what they were at the time of the call to setjmp and since your flag has been stuffed into a register, it is being reset.

	Declaring your flag variable as 'static', should solve your problem, though even that did not work with older versions of the compiler.

	-Clyde Hoover


Shouter-To-Dead-Parrots @ Univ. of Texas Computation Center; Austin, Texas  
	clyde at emx.utexas.edu; ...!cs.utexas.edu!ut-emx!clyde

Tip #268: Don't feel insecure or inferior! Remember, you're ORGANIC!!
	  You could win an argument with almost any rock!



More information about the Comp.std.c mailing list