papi/papi-configure-c99-2.patch

56 lines
2.0 KiB
Diff

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.
Submitted upstream: <https://github.com/icl-utk-edu/papi/pull/142>
diff --git a/src/configure b/src/configure
index 8ce0047d803bd641..f66dc5fb161916c4 100755
--- a/src/configure
+++ b/src/configure
@@ -5232,6 +5232,7 @@ else
res1 = (i == (int)arg);
else
res2 = (i == (int)arg);
+ return NULL;
}
__thread int i;
int main () {
@@ -5360,7 +5361,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 cb0a4b59bbed1256..37ff2a98ef85fcfe 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -714,6 +714,7 @@ AC_ARG_WITH(tls,
res1 = (i == (int)arg);
else
res2 = (i == (int)arg);
+ return NULL;
}
__thread int i;
int main () {
@@ -805,7 +806,7 @@ AC_ARG_WITH(virtualtimer,
exit(1);
}
done = 1;
- return j;
+ return (void *) j;
}
int main( int argc, char ** argv ) {