This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 07/10] C11 threads: Fix thrd_t / pthread_t compatibility assertion
LGTM with a small nit below.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
On 14/01/2020 15:52, Samuel Thibault wrote:
> ---
> nptl/thrd_create.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/nptl/thrd_create.c b/nptl/thrd_create.c
> index 8474e234c9..fe08e22973 100644
> --- a/nptl/thrd_create.c
> +++ b/nptl/thrd_create.c
> @@ -21,8 +21,8 @@
> int
> thrd_create (thrd_t *thr, thrd_start_t func, void *arg)
> {
> - _Static_assert (sizeof (thr) == sizeof (pthread_t),
> - "sizeof (thr) != sizeof (pthread_t)");
> + _Static_assert (sizeof (*thr) == sizeof (pthread_t),
> + "sizeof (*thr) != sizeof (pthread_t)");
>
> int err_code = __pthread_create_2_1 (thr, ATTR_C11_THREAD,
> (void* (*) (void*))func, arg);
>
I think it is better to use the type direct as other C11 implementation,
_Static_assert (sizeof (thrd_t) == sizeof (pthread_t), ...).