]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Fix Wincompatible-pointer-types on clang
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 17 Oct 2025 19:12:41 +0000 (16:12 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 21 Oct 2025 12:24:06 +0000 (09:24 -0300)
clang 18 issues:

pthread_join_common.c:32:3: error: incompatible pointer types passing 'struct pthread **' to parameter of type 'void **' [-Werror,-Wincompatible-pointer-types]
   32 |   atomic_compare_exchange_weak_acquire (&arg, &self, NULL);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/atomic.h:188:39: note: expanded from macro 'atomic_compare_exchange_weak_acquire'
  188 |   __atomic_compare_exchange_n ((mem), (expected), (desired), 1,

Use a void * type instead.

Reviewed-by: Sam James <sam@gentoo.org>
nptl/pthread_join_common.c

index ff389bf599e99d7b1f97697093c6108d278ae094..9109b62276bee2974203ba6d2f695d86443ececb 100644 (file)
@@ -28,7 +28,7 @@ cleanup (void *arg)
   /* If we already changed the waiter ID, reset it.  The call cannot
      fail for any reason but the thread not having done that yet so
      there is no reason for a loop.  */
-  struct pthread *self = THREAD_SELF;
+  void *self = THREAD_SELF;
   atomic_compare_exchange_weak_acquire (&arg, &self, NULL);
 }