summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-12-13 22:01:59 (GMT)
committerGitHub <noreply@github.com>2020-12-13 22:01:59 (GMT)
commit9feda9f871498463fe502d63204cf9cd6c1f4706 (patch)
treeec4f28ff778858749690db7ff8c9114112dd4069 /configure.ac
parent150b9bf3e9bddb825c60465194a4b2b51c32ab67 (diff)
downloadcpython-9feda9f871498463fe502d63204cf9cd6c1f4706.zip
cpython-9feda9f871498463fe502d63204cf9cd6c1f4706.tar.gz
cpython-9feda9f871498463fe502d63204cf9cd6c1f4706.tar.bz2
bpo-42598: Fix implicit function declarations in configure (GH-23690) (GH-23757)
This is invalid in C99 and later and is an error with some compilers (e.g. clang in Xcode 12), and can thus cause configure checks to produce incorrect results. (cherry picked from commit 674fa0a740151e0416c9383f127b16014e805990) Co-authored-by: Joshua Root <jmr@macports.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 7 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 6c8fd5a..c93ba0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3210,10 +3210,10 @@ if test "$posix_threads" = "yes"; then
main() {
pthread_attr_t attr;
pthread_t id;
- if (pthread_attr_init(&attr)) exit(-1);
- if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
- if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
- exit(0);
+ if (pthread_attr_init(&attr)) return (-1);
+ if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1);
+ if (pthread_create(&id, &attr, foo, NULL)) return (-1);
+ return (0);
}]])],
[ac_cv_pthread_system_supported=yes],
[ac_cv_pthread_system_supported=no],
@@ -4616,7 +4616,7 @@ then
int main()
{
/* Success: exit code 0 */
- exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
+ return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
}
]])],
[ac_cv_wchar_t_signed=yes],
@@ -4709,7 +4709,7 @@ AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main()
{
- exit(((-1)>>3 == -1) ? 0 : 1);
+ return (((-1)>>3 == -1) ? 0 : 1);
}
]])],
[ac_cv_rshift_extends_sign=yes],
@@ -4856,6 +4856,7 @@ AC_MSG_CHECKING(for broken poll())
AC_CACHE_VAL(ac_cv_broken_poll,
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <poll.h>
+#include <unistd.h>
int main()
{