From 08f0d7dfaeb53283ab133e3b7d6f13d03245d88c Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 18 Dec 2023 08:18:50 +0100 Subject: [PATCH] configure: Fix return values in start thread routines Thread start routines must return a void * value, and future compilers refuse to convert integers to pointers with just a warning (the virtualtimer probe). Without this change, the probe always fails to compile with future compilers (such as GCC 14). For the tls probe, return a null pointer for future-proofing, although current and upcoming C compilers do not treat this omission as an error. Updates commit dd11311aadbd06ab6c76d ("configure: fix tls detection"). --- src/configure | 3 ++- src/configure.in | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/configure b/src/configure index 075964c00..7ca891548 100755 --- a/src/configure +++ b/src/configure @@ -5250,6 +5250,7 @@ else res1 = (i == (int)arg); else res2 = (i == (int)arg); + return NULL; } __thread int i; int main () { @@ -5378,7 +5379,7 @@ else exit(1); } done = 1; - return j; + return (void *) j; } int main( int argc, char ** argv ) { diff --git a/src/configure.in b/src/configure.in index 7d95ae1a4..f9b494036 100644 --- a/src/configure.in +++ b/src/configure.in @@ -721,6 +721,7 @@ AC_ARG_WITH(tls, res1 = (i == (int)arg); else res2 = (i == (int)arg); + return NULL; } __thread int i; int main () { @@ -812,7 +813,7 @@ AC_ARG_WITH(virtualtimer, exit(1); } done = 1; - return j; + return (void *) j; } int main( int argc, char ** argv ) {