diff --git a/Misc/NEWS.d/next/Build/2024-09-11-16-06-42.gh-issue-123917.JuZl0r.rst b/Misc/NEWS.d/next/Build/2024-09-11-16-06-42.gh-issue-123917.JuZl0r.rst new file mode 100644 index 00000000000000..4cf4a177f1513f --- /dev/null +++ b/Misc/NEWS.d/next/Build/2024-09-11-16-06-42.gh-issue-123917.JuZl0r.rst @@ -0,0 +1,2 @@ +Fix the check for the ``crypt()`` function in the configure script. Patch by +Paul Smith and Victor Stinner. diff --git a/configure b/configure index 173674073ca51e..1c75810d9e8c4b 100755 --- a/configure +++ b/configure @@ -22041,16 +22041,18 @@ else $as_nop #include #endif #include + volatile void *func; int main (void) { #ifdef HAVE_CRYPT_R - void *x = crypt_r; + func = crypt_r; #else - void *x = crypt; + func = crypt; #endif + return (func != NULL); ; return 0; diff --git a/configure.ac b/configure.ac index f22e71f46fea5e..d0d54050286cd8 100644 --- a/configure.ac +++ b/configure.ac @@ -5237,12 +5237,14 @@ WITH_SAVE_ENV([ #include #endif #include + volatile void *func; ], [ #ifdef HAVE_CRYPT_R - void *x = crypt_r; + func = crypt_r; #else - void *x = crypt; + func = crypt; #endif + return (func != NULL); ]) ], [ac_cv_crypt_crypt=yes], [ac_cv_crypt_crypt=no]) ])