--- a/tests/cancel8.c
+++ b/tests/cancel8.c
@@ -111,7 +111,7 @@
   assert(bag->started == 0);
   bag->started = 1;
 
-  assert((bag->self = pthread_self()) != NULL);
+  assert((bag->self = pthread_self()).p != NULL);
   assert(pthread_kill(bag->self, 0) == 0);
 
   assert(pthread_mutex_lock(&CVLock) == 0);
@@ -192,7 +192,7 @@
       result = (int) PTHREAD_CANCELED;
 #endif
 
-      assert(threadbag[i].self != NULL);
+      assert(threadbag[i].self.p != NULL);
       assert(pthread_kill(threadbag[i].self, 0) == ESRCH);
 
       fail = (result != (int) PTHREAD_CANCELED);