]> granicus.if.org Git - gc/commitdiff
Fix 'arg parameter might be clobbered by setjmp' compiler warning
authorIvan Maidanski <ivmai@mail.ru>
Fri, 1 Jul 2016 07:41:16 +0000 (10:41 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 30 Jul 2016 08:09:25 +0000 (11:09 +0300)
(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).

include/private/gc_priv.h
mach_dep.c

index 380bbf3a7edc65bd84cfbaaf89dbf3ee3295b54a..59f8811281a24705b099ee92fec3b50672f08a99 100644 (file)
@@ -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       */
index 9c95e698137d60c6ac2a33318e458b9d7715c90a..038fa85e6a2d1321bd62ea2501ec2b67850101b1 100644 (file)
 /* 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;