mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-42598: Fix implicit function declarations in configure (GH-23690) (GH-23756)
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 674fa0a740
)
Co-authored-by: Joshua Root <jmr@macports.org>
This commit is contained in:
parent
be9e4402db
commit
3dcdbdeb48
3 changed files with 16 additions and 12 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
Fix implicit function declarations in configure which could have resulted in
|
||||||
|
incorrect configuration checks. Patch contributed by Joshua Root.
|
13
configure
vendored
13
configure
vendored
|
@ -11072,10 +11072,10 @@ else
|
||||||
main() {
|
main() {
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
pthread_t id;
|
pthread_t id;
|
||||||
if (pthread_attr_init(&attr)) exit(-1);
|
if (pthread_attr_init(&attr)) return (-1);
|
||||||
if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
|
if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1);
|
||||||
if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
|
if (pthread_create(&id, &attr, foo, NULL)) return (-1);
|
||||||
exit(0);
|
return (0);
|
||||||
}
|
}
|
||||||
_ACEOF
|
_ACEOF
|
||||||
if ac_fn_c_try_run "$LINENO"; then :
|
if ac_fn_c_try_run "$LINENO"; then :
|
||||||
|
@ -15083,7 +15083,7 @@ else
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
/* Success: exit code 0 */
|
/* Success: exit code 0 */
|
||||||
exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
|
return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
@ -15464,7 +15464,7 @@ else
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
exit(((-1)>>3 == -1) ? 0 : 1);
|
return (((-1)>>3 == -1) ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
@ -15934,6 +15934,7 @@ else
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
13
configure.ac
13
configure.ac
|
@ -3313,10 +3313,10 @@ if test "$posix_threads" = "yes"; then
|
||||||
main() {
|
main() {
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
pthread_t id;
|
pthread_t id;
|
||||||
if (pthread_attr_init(&attr)) exit(-1);
|
if (pthread_attr_init(&attr)) return (-1);
|
||||||
if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
|
if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1);
|
||||||
if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
|
if (pthread_create(&id, &attr, foo, NULL)) return (-1);
|
||||||
exit(0);
|
return (0);
|
||||||
}]])],
|
}]])],
|
||||||
[ac_cv_pthread_system_supported=yes],
|
[ac_cv_pthread_system_supported=yes],
|
||||||
[ac_cv_pthread_system_supported=no],
|
[ac_cv_pthread_system_supported=no],
|
||||||
|
@ -4725,7 +4725,7 @@ then
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
/* Success: exit code 0 */
|
/* 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],
|
[ac_cv_wchar_t_signed=yes],
|
||||||
|
@ -4847,7 +4847,7 @@ AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
|
||||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
exit(((-1)>>3 == -1) ? 0 : 1);
|
return (((-1)>>3 == -1) ? 0 : 1);
|
||||||
}
|
}
|
||||||
]])],
|
]])],
|
||||||
[ac_cv_rshift_extends_sign=yes],
|
[ac_cv_rshift_extends_sign=yes],
|
||||||
|
@ -4994,6 +4994,7 @@ AC_MSG_CHECKING(for broken poll())
|
||||||
AC_CACHE_VAL(ac_cv_broken_poll,
|
AC_CACHE_VAL(ac_cv_broken_poll,
|
||||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue