* mark_rts.c (GC_approx_sp): Use volatile to avoid common
warning.
+2008-10-25 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
+ * mark_rts.c (GC_approx_sp): Use volatile to avoid common
+ warning.
+
2008-10-25 Hans Boehm <Hans.Boehm@hp.com>
* dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument
order.
ptr_t GC_approx_sp(void)
{
- volatile word dummy;
-
- dummy = 42; /* Force stack to grow if necessary. Otherwise the */
+ volatile word sp;
+ sp = (word)&sp;
+ /* Also force stack to grow if necessary. Otherwise the */
/* later accesses might cause the kernel to think we're */
/* doing something wrong. */
-# ifdef _MSC_VER
-# pragma warning(disable:4172)
-# endif
- /* Ignore "function returns address of local variable" warning. */
- return((ptr_t)(&dummy));
-# ifdef _MSC_VER
-# pragma warning(default:4172)
-# endif
+
+ return((ptr_t)sp);
}
/*