From 7645a1b85b1cc02ff5fc960f5d5e042c8bd16e97 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 8 Aug 2024 00:54:03 +0200 Subject: [PATCH] Avoid compiler warnings in some configure tests. * m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): Allocate more room for local array 'name'. * m4/pthread_mutex_timedlock.m4 (gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK): Don't pass a NULL pointer to pthread_mutex_timedlock. --- ChangeLog | 8 ++++++++ m4/pthread-rwlock.m4 | 4 ++-- m4/pthread_mutex_timedlock.m4 | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f656f3b77..cc14fe592d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-08-07 Bruno Haible + + Avoid compiler warnings in some configure tests. + * m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): Allocate more room for local + array 'name'. + * m4/pthread_mutex_timedlock.m4 (gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK): Don't + pass a NULL pointer to pthread_mutex_timedlock. + 2024-08-07 Bruno Haible pthread-rwlock: Fix default wait queue behaviour on glibc/Linux. diff --git a/m4/pthread-rwlock.m4 b/m4/pthread-rwlock.m4 index 496a897079..56dc53eed7 100644 --- a/m4/pthread-rwlock.m4 +++ b/m4/pthread-rwlock.m4 @@ -1,4 +1,4 @@ -# pthread-rwlock.m4 serial 5 +# pthread-rwlock.m4 serial 6 dnl Copyright (C) 2019-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -248,7 +248,7 @@ do_test (const char *rw_string) char **names = (char **) malloc (n * sizeof (char *)); for (size_t i = 0; i < n; i++) { - char name[10]; + char name[12]; sprintf (name, "%c%u", rw_string[i], (unsigned int) (i+1)); names[i] = strdup (name); } diff --git a/m4/pthread_mutex_timedlock.m4 b/m4/pthread_mutex_timedlock.m4 index dda6f5889c..f8e43f47ab 100644 --- a/m4/pthread_mutex_timedlock.m4 +++ b/m4/pthread_mutex_timedlock.m4 @@ -1,4 +1,4 @@ -# pthread_mutex_timedlock.m4 serial 3.1 +# pthread_mutex_timedlock.m4 serial 3.2 dnl Copyright (C) 2019-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -27,7 +27,8 @@ AC_DEFUN([gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK], #include ]], [[pthread_mutex_t lock; - return pthread_mutex_timedlock (&lock, (struct timespec *) 0); + struct timespec ts = { 0 }; + return pthread_mutex_timedlock (&lock, &ts); ]]) ], [gl_cv_func_pthread_mutex_timedlock_in_LIBMULTITHREAD=yes], -- 2.39.5