[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] fix pointer to int asign in timer_create.



In sysdeps/pthread/timer_create.c there is an assignment:

newtimer->event.sigev_value.sival_int = timer_ptr2id (newtimer);

Where timer_ptr2id generates a (void *) cast. This generates an "assignment makes integer from pointer" warning. This will cause truncation on 64-bit systems. Shouldn't this be:

newtimer->event.sigev_value.sival_ptr = timer_ptr2id (newtimer);


diff -urN nptl-0.36/nptl/sysdeps/pthread/timer_create.c libc23/nptl/sysdeps/pthread/timer_create.c
--- nptl-0.36/nptl/sysdeps/pthread/timer_create.c	2003-03-02 23:26:57.000000000 -0600
+++ libc23/nptl/sysdeps/pthread/timer_create.c	2003-04-24 11:09:04.000000000 -0500
@@ -81,7 +81,7 @@
     {
       newtimer->event.sigev_notify = SIGEV_SIGNAL;
       newtimer->event.sigev_signo = SIGALRM;
-      newtimer->event.sigev_value.sival_int = timer_ptr2id (newtimer);
+      newtimer->event.sigev_value.sival_ptr = timer_ptr2id (newtimer);
       newtimer->event.sigev_notify_function = 0;
     }
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]