https://github.com/python/cpython/commit/1631d46bea2332c0d28477e1876209ac01c1f4e2
commit: 1631d46bea2332c0d28477e1876209ac01c1f4e2
branch: 3.15
author: Vasiliy Kiryanov <[email protected]>
committer: vstinner <[email protected]>
date: 2026-11-05T00:32:58Z
summary:
[3.15] gh-75929: Fix configure function checks under -Wall -Werror (GH-161343)
(#161371)
Use `(void)$1` in `PY_CHECK_FUNC` instead of declaring an unused
variable. The unused-variable warning caused configure to report
declared functions such as `fchdir` as missing.
(cherry picked from commit 341f80e81a185c48ebbb2c0115401edf99f59baa)
files:
A Misc/NEWS.d/next/Build/2026-11-04-14-37-13.gh-issue-75929.nELdwE.rst
M configure
M configure.ac
diff --git
a/Misc/NEWS.d/next/Build/2026-11-04-14-37-13.gh-issue-75929.nELdwE.rst
b/Misc/NEWS.d/next/Build/2026-11-04-14-37-13.gh-issue-75929.nELdwE.rst
new file mode 100644
index 000000000000000..8ec7f8a0147399f
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2026-11-04-14-37-13.gh-issue-75929.nELdwE.rst
@@ -0,0 +1,2 @@
+Fix a ``configure`` probe that could omit functions such
+as :func:`os.fchdir` from builds using ``-Wall -Werror``.
diff --git a/configure b/configure
index 0c195027c4a309c..dfafbf56835bb21 100755
--- a/configure
+++ b/configure
@@ -16264,7 +16264,7 @@ else case e in #(
int
main (void)
{
-void *x=ffi_prep_cif_var
+(void)ffi_prep_cif_var
;
return 0;
}
@@ -16305,7 +16305,7 @@ else case e in #(
int
main (void)
{
-void *x=ffi_prep_closure_loc
+(void)ffi_prep_closure_loc
;
return 0;
}
@@ -16346,7 +16346,7 @@ else case e in #(
int
main (void)
{
-void *x=ffi_closure_alloc
+(void)ffi_closure_alloc
;
return 0;
}
@@ -21217,7 +21217,7 @@ else case e in #(
int
main (void)
{
-void *x=strerror_r
+(void)strerror_r
;
return 0;
}
@@ -21260,7 +21260,7 @@ else case e in #(
int
main (void)
{
-void *x=pthread_attr_get_np
+(void)pthread_attr_get_np
;
return 0;
}
@@ -21383,7 +21383,7 @@ else case e in #(
int
main (void)
{
-void *x=chroot
+(void)chroot
;
return 0;
}
@@ -21424,7 +21424,7 @@ else case e in #(
int
main (void)
{
-void *x=link
+(void)link
;
return 0;
}
@@ -21465,7 +21465,7 @@ else case e in #(
int
main (void)
{
-void *x=symlink
+(void)symlink
;
return 0;
}
@@ -21506,7 +21506,7 @@ else case e in #(
int
main (void)
{
-void *x=fchdir
+(void)fchdir
;
return 0;
}
@@ -21547,7 +21547,7 @@ else case e in #(
int
main (void)
{
-void *x=fsync
+(void)fsync
;
return 0;
}
@@ -21588,7 +21588,7 @@ else case e in #(
int
main (void)
{
-void *x=fdatasync
+(void)fdatasync
;
return 0;
}
@@ -21652,7 +21652,7 @@ else case e in #(
int
main (void)
{
-void *x=epoll_create
+(void)epoll_create
;
return 0;
}
@@ -21693,7 +21693,7 @@ else case e in #(
int
main (void)
{
-void *x=epoll_create1
+(void)epoll_create1
;
return 0;
}
@@ -21739,7 +21739,7 @@ else case e in #(
int
main (void)
{
-void *x=kqueue
+(void)kqueue
;
return 0;
}
@@ -21783,7 +21783,7 @@ else case e in #(
int
main (void)
{
-void *x=prlimit
+(void)prlimit
;
return 0;
}
@@ -21825,7 +21825,7 @@ else case e in #(
int
main (void)
{
-void *x=_dyld_shared_cache_contains_path
+(void)_dyld_shared_cache_contains_path
;
return 0;
}
@@ -21874,7 +21874,7 @@ else case e in #(
int
main (void)
{
-void *x=memfd_create
+(void)memfd_create
;
return 0;
}
@@ -21920,7 +21920,7 @@ else case e in #(
int
main (void)
{
-void *x=eventfd
+(void)eventfd
;
return 0;
}
@@ -21966,7 +21966,7 @@ else case e in #(
int
main (void)
{
-void *x=timerfd_create
+(void)timerfd_create
;
return 0;
}
@@ -22014,7 +22014,7 @@ else case e in #(
int
main (void)
{
-void *x=ctermid_r
+(void)ctermid_r
;
return 0;
}
@@ -22153,7 +22153,7 @@ else case e in #(
int
main (void)
{
-void *x=getpagesize
+(void)getpagesize
;
return 0;
}
@@ -23876,7 +23876,7 @@ else case e in #(
int
main (void)
{
-void *x=hstrerror
+(void)hstrerror
;
return 0;
}
@@ -23917,7 +23917,7 @@ else case e in #(
int
main (void)
{
-void *x=getservbyname
+(void)getservbyname
;
return 0;
}
@@ -23958,7 +23958,7 @@ else case e in #(
int
main (void)
{
-void *x=getservbyport
+(void)getservbyport
;
return 0;
}
@@ -23999,7 +23999,7 @@ else case e in #(
int
main (void)
{
-void *x=gethostbyname
+(void)gethostbyname
;
return 0;
}
@@ -24040,7 +24040,7 @@ else case e in #(
int
main (void)
{
-void *x=gethostbyaddr
+(void)gethostbyaddr
;
return 0;
}
@@ -24081,7 +24081,7 @@ else case e in #(
int
main (void)
{
-void *x=getprotobyname
+(void)getprotobyname
;
return 0;
}
@@ -24130,7 +24130,7 @@ else case e in #(
int
main (void)
{
-void *x=inet_aton
+(void)inet_aton
;
return 0;
}
@@ -24176,7 +24176,7 @@ else case e in #(
int
main (void)
{
-void *x=inet_ntoa
+(void)inet_ntoa
;
return 0;
}
@@ -24222,7 +24222,7 @@ else case e in #(
int
main (void)
{
-void *x=inet_pton
+(void)inet_pton
;
return 0;
}
@@ -24268,7 +24268,7 @@ else case e in #(
int
main (void)
{
-void *x=getpeername
+(void)getpeername
;
return 0;
}
@@ -24314,7 +24314,7 @@ else case e in #(
int
main (void)
{
-void *x=getsockname
+(void)getsockname
;
return 0;
}
@@ -24360,7 +24360,7 @@ else case e in #(
int
main (void)
{
-void *x=accept
+(void)accept
;
return 0;
}
@@ -24406,7 +24406,7 @@ else case e in #(
int
main (void)
{
-void *x=bind
+(void)bind
;
return 0;
}
@@ -24452,7 +24452,7 @@ else case e in #(
int
main (void)
{
-void *x=connect
+(void)connect
;
return 0;
}
@@ -24498,7 +24498,7 @@ else case e in #(
int
main (void)
{
-void *x=listen
+(void)listen
;
return 0;
}
@@ -24544,7 +24544,7 @@ else case e in #(
int
main (void)
{
-void *x=recvfrom
+(void)recvfrom
;
return 0;
}
@@ -24590,7 +24590,7 @@ else case e in #(
int
main (void)
{
-void *x=sendto
+(void)sendto
;
return 0;
}
@@ -24636,7 +24636,7 @@ else case e in #(
int
main (void)
{
-void *x=setsockopt
+(void)setsockopt
;
return 0;
}
@@ -24682,7 +24682,7 @@ else case e in #(
int
main (void)
{
-void *x=socket
+(void)socket
;
return 0;
}
@@ -24730,7 +24730,7 @@ else case e in #(
int
main (void)
{
-void *x=setgroups
+(void)setgroups
;
return 0;
}
@@ -26436,7 +26436,7 @@ else case e in #(
int
main (void)
{
-void *x=socketpair
+(void)socketpair
;
return 0;
}
diff --git a/configure.ac b/configure.ac
index b9e175abd899217..8a74fd8a9bf70ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,7 @@ AC_DEFUN([PY_CHECK_FUNC],
[for $1],
[py_var],
[AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([$2], [void *x=$1])],
+ [AC_LANG_PROGRAM([$2], [(void)$1])],
[AS_VAR_SET([py_var], [yes])],
[AS_VAR_SET([py_var], [no])])]
)
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]