From 403d2f839b6b0b4ed2327411002cc1d6ba3fceca Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 23 Mar 2017 11:09:40 +0300 Subject: [PATCH] Use sigsetjmp() in setjmp_t tool if available * tools/setjmp_t.c (main): Replace jmp_buf, setjmp(), longjmp() to JMP_BUF, SETJMP(), LONGJMP(), respectively; cast result of SETJMP() to void type. --- tools/setjmp_t.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/setjmp_t.c b/tools/setjmp_t.c index b3bb86d..2b4c4dc 100644 --- a/tools/setjmp_t.c +++ b/tools/setjmp_t.c @@ -80,7 +80,7 @@ int main(void) { volatile word sp; unsigned ps = GETPAGESIZE(); - jmp_buf b; + JMP_BUF b; register int x = (int)strlen("a"); /* 1, slightly disguised */ static volatile int y = 0; @@ -109,7 +109,7 @@ int main(void) x = 2*x-1; printf("\n"); x = 2*x-1; - setjmp(b); + (void)SETJMP(b); if (y == 1) { if (x == 2) { printf("Setjmp-based generic mark_regs code probably won't work.\n"); @@ -123,7 +123,7 @@ int main(void) } y++; x = 2; - if (y == 1) longjmp(b,1); + if (y == 1) LONGJMP(b, 1); printf("Some GC internal configuration stuff: \n"); printf("\tWORDSZ = %lu, ALIGNMENT = %d, GC_GRANULE_BYTES = %d\n", (unsigned long)WORDSZ, ALIGNMENT, GC_GRANULE_BYTES); -- 2.7.4