Quiet a warning about casting an int to a pointer of different size
authorPhil Miller <mille121@illinois.edu>
Wed, 4 May 2011 23:35:30 +0000 (18:35 -0500)
committerPhil Miller <mille121@illinois.edu>
Wed, 4 May 2011 23:35:30 +0000 (18:35 -0500)
Widen the integer argument to pointer-width first, and then cast it to
a pointer.

src/conv-core/cpthreads.c

index 0df285cc08e3f57e356abafb593894e41e972109..ae37ad1eeb1dc72063868fa66604e982c13eea3a 100644 (file)
@@ -595,9 +595,10 @@ void Cpthread_start_main(mainfn fn, int argc, char **argv)
 {
   Cpthread_t pt;
   Cpthread_attr_t attrib;
+  CmiIntPtr pargc = argc;
   if (CmiMyRank()==0) {
     Cpthread_attr_init(&attrib);
     Cpthread_attr_setdetachstate(&attrib, 1);
-    Cpthread_create3(&pt, &attrib, (voidfn)fn, (void *)argc, argv, 0);
+    Cpthread_create3(&pt, &attrib, (voidfn)fn, (void *)pargc, argv, 0);
   }
 }