[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] configure: Fix for running with --enable-werror on macOS

From: Thomas Huth
Subject: [PATCH] configure: Fix for running with --enable-werror on macOS
Date: Thu, 16 Jul 2020 07:56:55 +0200

The configure script currently refuses to succeed when run on macOS
with --enable-werror:

 ERROR: configure test passed without -Werror but failed with -Werror.

The information in config.log indicates:

 config-temp/qemu-conf.c:3:55: error: control reaches end of non-void
 function [-Werror,-Wreturn-type]
 static void *f(void *p) { pthread_setname_np("QEMU"); }
And indeed, the return statement is missing here.

Fixes: 479a57475e ("util: Implement debug-threads for macOS")
Signed-off-by: Thomas Huth <thuth@redhat.com>
 Note: There is another issue with --enable-werror on macOS, with the
       atomic64, which I haven't quite figured out yet, so compiling
       with --enable-werror is still not working there.

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index b751c853f5..e93836aaae 100755
--- a/configure
+++ b/configure
@@ -4198,7 +4198,7 @@ pthread_setname_np_wo_tid=no
 cat > $TMPC << EOF
 #include <pthread.h>
-static void *f(void *p) { pthread_setname_np("QEMU"); }
+static void *f(void *p) { pthread_setname_np("QEMU"); return NULL; }
 int main(void)
     pthread_t thread;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]