From: Ivan Maidanski Date: Fri, 1 Jul 2016 07:41:16 +0000 (+0300) Subject: Fix 'arg parameter might be clobbered by setjmp' compiler warning X-Git-Tag: v7.4.6~268 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c87595187e33458cf1d0a9b343cab32e0577301;p=gc Fix 'arg parameter might be clobbered by setjmp' compiler warning (Apply squashed commit of 8ffc3db and 65b50c0 from 'master' branch.) * mach_dep.c (GC_with_callee_saves_pushed): Make "arg" parameter volatile (to prevent it from potential clobbering). * include/private/gc_priv.h (GC_with_callee_saves_pushed): Add volatile for arg (to match the function definition). --- diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 380bbf3a..59f88112 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -1611,7 +1611,7 @@ GC_EXTERN void (*GC_push_typed_structures)(void); /* the typed allocation support if unused. */ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *), - ptr_t arg); + volatile ptr_t arg); #if defined(SPARC) || defined(IA64) /* Cause all stacked registers to be saved in memory. Return a */ diff --git a/mach_dep.c b/mach_dep.c index 9c95e698..038fa85e 100644 --- a/mach_dep.c +++ b/mach_dep.c @@ -211,7 +211,7 @@ /* are somewhere on the stack, and then call fn(arg, ctxt). */ /* ctxt is either a pointer to a ucontext_t we generated, or NULL. */ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *), - ptr_t arg) + volatile ptr_t arg) { volatile int dummy; void * context = 0;