This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Question + Patch for i386/getcpuclockid



With the current CVS version I get this warning:
../linuxthreads/sysdeps/unix/sysv/linux/i386/getcpuclockid.c:30: warning: comparison of distinct pointer types lacks a cast

gcc complains about this test:
  /* We don't allow any process ID but our own.  */
  if (thread_handle (thread_id) != thread_self ())
    return EPERM;

The types used here are:
static inline pthread_handle thread_handle(pthread_t id)
static inline pthread_descr thread_self (void) __attribute__ ((const));

Is this really correct?  The types are different and I don't see
directly how the contents can be the same.

I propose the appended patch to fix this,
Andreas

2000-05-04  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/i386/getcpuclockid.c
	(pthread_getcpuclockid): Correct test for ourselves.

============================================================
Index: linuxthreads/sysdeps/unix/sysv/linux/i386/getcpuclockid.c
--- linuxthreads/sysdeps/unix/sysv/linux/i386/getcpuclockid.c	2000/04/18 06:35:42	1.3
+++ linuxthreads/sysdeps/unix/sysv/linux/i386/getcpuclockid.c	2000/05/04 12:06:02
@@ -27,7 +27,7 @@
 pthread_getcpuclockid (pthread_t thread_id, clockid_t *clock_id)
 {
   /* We don't allow any process ID but our own.  */
-  if (thread_handle (thread_id) != thread_self ())
+  if (thread_handle (thread_id)->h_descr != thread_self ())
     return EPERM;
 
   /* Store the number.  */

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]