Fix 'cast to pointer from integer' warning in GC_on_thread_event (64-bit)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 9 Sep 2015 20:55:37 +0000 (23:55 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 9 Sep 2015 20:55:37 +0000 (23:55 +0300)
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Cast thread_id
to pointer via word type on passing to GC_on_thread_event; add comment.

pthread_stop_world.c

index c6d4915..84b787c 100644 (file)
@@ -529,7 +529,8 @@ STATIC int GC_suspend_all(void)
                 case 0:
                     if (GC_on_thread_event)
                       GC_on_thread_event(GC_EVENT_THREAD_SUSPENDED,
-                                         (void *)thread_id);
+                                         (void *)(word)thread_id);
+                                /* Note: thread_id might be truncated.  */
                     break;
                 default:
                     ABORT_ARG1("pthread_kill failed at suspend",
@@ -866,7 +867,7 @@ GC_INNER void GC_start_world(void)
                 case 0:
                     if (GC_on_thread_event)
                       GC_on_thread_event(GC_EVENT_THREAD_UNSUSPENDED,
-                                         (void *)thread_id);
+                                         (void *)(word)thread_id);
                     break;
                 default:
                     ABORT_ARG1("pthread_kill failed at resume",