summaryrefslogtreecommitdiff
path: root/mark_rts.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2008-10-26 06:22:45 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:43 +0200
commite209cfd18124d3900db610392b85497351793511 (patch)
treeb031513fd8fdec88387bc5a6f1fa8f0b4751c06f /mark_rts.c
parent264314ca474de56d367ec3c07d5fad25c27df383 (diff)
2008-10-25 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* mark_rts.c (GC_approx_sp): Use volatile to avoid common warning.
Diffstat (limited to 'mark_rts.c')
-rw-r--r--mark_rts.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/mark_rts.c b/mark_rts.c
index 5bb5639..2b8b738 100644
--- a/mark_rts.c
+++ b/mark_rts.c
@@ -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);
}
/*