]> granicus.if.org Git - gc/commitdiff
2008-10-25 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
authorhboehm <hboehm>
Sun, 26 Oct 2008 05:22:45 +0000 (05:22 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:43 +0000 (21:06 +0400)
* mark_rts.c (GC_approx_sp): Use volatile to avoid common
warning.

ChangeLog
mark_rts.c

index 1257f168fd2963e1e0fdaa5ddeb6fda88022aa01..2bcf2ee362d743aad036bf62b7f02fb684ab0347 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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.
index 5bb5639e97d615c5a9b91aebbceff2c2ec1db509..2b8b738205bf100a020fd41d7e8afe50966c30dd 100644 (file)
@@ -353,19 +353,13 @@ GC_bool GC_is_tmp_root(ptr_t p)
 
 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);
 }
 
 /*