]> Savannah Git Hosting - gnulib.git/commitdiff
Avoid compiler warnings in some configure tests.
authorBruno Haible <bruno@clisp.org>
Wed, 7 Aug 2024 22:54:03 +0000 (00:54 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 16:22:03 +0000 (18:22 +0200)
* 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
m4/pthread-rwlock.m4
m4/pthread_mutex_timedlock.m4

index 7437e79e704961850aef5c92249abcad3cc012a7..2ad41c38b9262b023c12191f8cc0257cb2c462c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-08-07  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        pthread-rwlock: Fix default wait queue behaviour on glibc/Linux.
index 51d84419c7fbf295788d0450c5b00d3b1570b4e3..cbd08790e1d9cf217ce74e4fc14c8b9b42e8b60e 100644 (file)
@@ -1,5 +1,5 @@
 # pthread-rwlock.m4
-# serial 5
+# 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,
@@ -249,7 +249,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);
     }
index 46b59d793ce1b48a6275530db32a8c2a07187f4a..9b175d54742e981d1f8743120bf96018d25cc102 100644 (file)
@@ -1,5 +1,5 @@
 # pthread_mutex_timedlock.m4
-# serial 5
+# 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,
@@ -28,7 +28,8 @@ AC_DEFUN([gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK],
                  #include <time.h>
                ]],
                [[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],