From 5fa28823f16a6dc4ad42e7a76f467b5c9686ce70 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 4 Oct 2019 12:18:05 -0400 Subject: [PATCH] m4: sync ax_pthread.m4 with autoconf archive MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sync with [1]. In particular, this lets us configure with -Wunused-but-set-parameter. [1] https://raw.githubusercontent.com/autoconf-archive/autoconf-archive/62e8491dbc174113a04fe910cad1e92e8a9e2164/m4/ax_pthread.m4 Signed-off-by: Simon Marchi Change-Id: Id9a6eb7cd0b8c7597ae6abb5587078afdaa420f6 Signed-off-by: Jérémie Galarneau --- m4/ax_pthread.m4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index 4920e073b..0300e4ed8 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -82,7 +82,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 25 +#serial 26 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ @@ -371,7 +371,13 @@ for ax_pthread_try_flag in $ax_pthread_flags; do # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif - static void routine(void *a) { a = 0; } + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); -- 2.34.1