[Python-checkins] closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15560)
Miss Islington (bot)
webhook-mailer at python.org
Wed Aug 28 13:36:22 EDT 2019
https://github.com/python/cpython/commit/0229b56d8c0cb65b8ad789e69dcd281fd92a6d96
commit: 0229b56d8c0cb65b8ad789e69dcd281fd92a6d96
branch: 2.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-08-28T10:36:18-07:00
summary:
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15560)
https://bugs.python.org/issue37965
https://bugs.python.org/issue37965
Automerge-Triggered-By: @benjaminp
(cherry picked from commit 55aabee07501e1468082b3237620e4ecd75c5da6)
Co-authored-by: Anonymous Maarten <madebr at users.noreply.github.com>
files:
A Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst
M Lib/distutils/ccompiler.py
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index 88a910c6810f..3a7b5b84e1a8 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -748,8 +748,9 @@ def has_function(self, funcname, includes=None, include_dirs=None,
for incl in includes:
f.write("""#include "%s"\n""" % incl)
f.write("""\
-main (int argc, char **argv) {
+int main (int argc, char **argv) {
%s();
+ return 0;
}
""" % funcname)
finally:
diff --git a/Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst b/Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst
new file mode 100644
index 000000000000..116a9e49dccc
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst
@@ -0,0 +1 @@
+Fix C compiler warning caused by distutils.ccompiler.CCompiler.has_function.
More information about the Python-checkins
mailing list