Skip to content

Commit 1631d46

Browse files
authored
[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 341f80e)
1 parent bc29f96 commit 1631d46

3 files changed

Lines changed: 45 additions & 43 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a ``configure`` probe that could omit functions such
2+
as :func:`os.fchdir` from builds using ``-Wall -Werror``.

‎configure‎

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ AC_DEFUN([PY_CHECK_FUNC],
6161
[for $1],
6262
[py_var],
6363
[AC_COMPILE_IFELSE(
64-
[AC_LANG_PROGRAM([$2], [void *x=$1])],
64+
[AC_LANG_PROGRAM([$2], [(void)$1])],
6565
[AS_VAR_SET([py_var], [yes])],
6666
[AS_VAR_SET([py_var], [no])])]
6767
)

0 commit comments

Comments
 (0)