[PATCH] fix pointer to int asign in timer_create.

Steven Munroe <[email protected]>
Newsgroups gmane.comp.lib.phil
Message-ID <[email protected]>
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);
nptl36-timer_create-20030424.patch (text/plain, 594 B)
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;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.