Skip to content

Commit

Permalink
configure: Fix return values in start thread routines
Browse files Browse the repository at this point in the history
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 dd11311 ("configure: fix tls detection").
  • Loading branch information
fweimer-rh authored and gcongiu committed Dec 18, 2023
1 parent 89e658e commit 08f0d7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -5250,6 +5250,7 @@ else
res1 = (i == (int)arg);
else
res2 = (i == (int)arg);
return NULL;
}
__thread int i;
int main () {
Expand Down Expand Up @@ -5378,7 +5379,7 @@ else
exit(1);
}
done = 1;
return j;
return (void *) j;
}
int main( int argc, char ** argv ) {
Expand Down
3 changes: 2 additions & 1 deletion src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ AC_ARG_WITH(tls,
res1 = (i == (int)arg);
else
res2 = (i == (int)arg);
return NULL;
}
__thread int i;
int main () {
Expand Down Expand Up @@ -812,7 +813,7 @@ AC_ARG_WITH(virtualtimer,
exit(1);
}
done = 1;
return j;
return (void *) j;
}

int main( int argc, char ** argv ) {
Expand Down

0 comments on commit 08f0d7d

Please sign in to comment.