]> granicus.if.org Git - gc/commitdiff
Eliminate 'cast from int to pointer' warning in GC_exclude_static_roots
authorIvan Maidanski <ivmai@mail.ru>
Tue, 23 Oct 2012 03:57:48 +0000 (07:57 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 23 Oct 2012 10:58:17 +0000 (14:58 +0400)
* mark_rts.c (GC_exclude_static_roots): Cast integer literal to
pointer via word type (to eliminate compiler warning).

mark_rts.c

index 8795a5b505f70222f9409ec1483b7ca7b9ac7a94..7ffe82a6df1bd64d416459576f63b459b05c85af 100644 (file)
@@ -479,7 +479,7 @@ GC_API void GC_CALL GC_exclude_static_roots(void *b, void *e)
     /* Round boundaries (in direction reverse to that of GC_add_roots). */
     b = (void *)((word)b & ~(sizeof(word) - 1));
     e = (void *)(((word)e + (sizeof(word) - 1)) & ~(sizeof(word) - 1));
-    if (0 == e) e = (void *)(~(sizeof(word) - 1)); /* handle overflow */
+    if (0 == e) e = (void *)(word)(~(sizeof(word) - 1)); /* handle overflow */
 
     LOCK();
     GC_exclude_static_roots_inner(b, e);