mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
tst-clone3[-internal].c: Add _Atomic to silence Clang
Add _Atomic to futex_wait argument and ctid in tst-clone3[-internal].c to silence Clang error: ../sysdeps/unix/sysv/linux/tst-clone3-internal.c:93:3: error: address argument to atomic operation must be a pointer to _Atomic type ('pid_t *' (aka 'int *') invalid) 93 | wait_tid (&ctid, CTID_INIT_VAL); | ^ ~~~~~ ../sysdeps/unix/sysv/linux/tst-clone3-internal.c:51:21: note: expanded from macro 'wait_tid' 51 | while ((__tid = atomic_load_explicit (ctid_ptr, \ | ^ ~~~~~~~~ /usr/bin/../lib/clang/19/include/stdatomic.h:145:30: note: expanded from macro 'atomic_load_explicit' 145 | #define atomic_load_explicit __c11_atomic_load | ^ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
This commit is contained in:
parent
560cfeb826
commit
d4ee46b0cd
2 changed files with 4 additions and 4 deletions
|
@ -54,7 +54,7 @@ f (void *a)
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
futex_wait (int *futexp, int val)
|
futex_wait (_Atomic int *futexp, int val)
|
||||||
{
|
{
|
||||||
#ifdef __NR_futex
|
#ifdef __NR_futex
|
||||||
return syscall (__NR_futex, futexp, FUTEX_WAIT, val);
|
return syscall (__NR_futex, futexp, FUTEX_WAIT, val);
|
||||||
|
@ -75,7 +75,7 @@ do_test (void)
|
||||||
/* Initialize with a known value. ctid is set to zero by the kernel after the
|
/* Initialize with a known value. ctid is set to zero by the kernel after the
|
||||||
cloned thread has exited. */
|
cloned thread has exited. */
|
||||||
#define CTID_INIT_VAL 1
|
#define CTID_INIT_VAL 1
|
||||||
pid_t ctid = CTID_INIT_VAL;
|
_Atomic pid_t ctid = CTID_INIT_VAL;
|
||||||
pid_t tid;
|
pid_t tid;
|
||||||
|
|
||||||
struct clone_args clone_args =
|
struct clone_args clone_args =
|
||||||
|
|
|
@ -54,7 +54,7 @@ f (void *a)
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
futex_wait (int *futexp, int val)
|
futex_wait (_Atomic int *futexp, int val)
|
||||||
{
|
{
|
||||||
#ifdef __NR_futex
|
#ifdef __NR_futex
|
||||||
return syscall (__NR_futex, futexp, FUTEX_WAIT, val);
|
return syscall (__NR_futex, futexp, FUTEX_WAIT, val);
|
||||||
|
@ -75,7 +75,7 @@ do_test (void)
|
||||||
/* Initialize with a known value. ctid is set to zero by the kernel after the
|
/* Initialize with a known value. ctid is set to zero by the kernel after the
|
||||||
cloned thread has exited. */
|
cloned thread has exited. */
|
||||||
#define CTID_INIT_VAL 1
|
#define CTID_INIT_VAL 1
|
||||||
pid_t ctid = CTID_INIT_VAL;
|
_Atomic pid_t ctid = CTID_INIT_VAL;
|
||||||
pid_t tid;
|
pid_t tid;
|
||||||
|
|
||||||
#if _STACK_GROWS_DOWN
|
#if _STACK_GROWS_DOWN
|
||||||
|
|
Loading…
Add table
Reference in a new issue