From 094ca53744a0b8970f0b30be35cdd0477b7cdfea Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 23 Mar 2017 03:16:12 +0300 Subject: [PATCH] Fix tools/setjmp_t hang (OS X) * tools/setjmp_t.c (main): Declare "y" static variable as volatile (to prevent reordering/optimization of y++). --- tools/setjmp_t.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/setjmp_t.c b/tools/setjmp_t.c index 987599e..b3bb86d 100644 --- a/tools/setjmp_t.c +++ b/tools/setjmp_t.c @@ -82,7 +82,7 @@ int main(void) unsigned ps = GETPAGESIZE(); jmp_buf b; register int x = (int)strlen("a"); /* 1, slightly disguised */ - static int y = 0; + static volatile int y = 0; sp = (word)(&sp); printf("This appears to be a %s running %s\n", MACH_TYPE, OS_TYPE); -- 2.7.4