]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 28 Aug 2019 17:37:38 +0000 (10:37 -0700)
committerGitHub <noreply@github.com>
Wed, 28 Aug 2019 17:37:38 +0000 (10:37 -0700)
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@users.noreply.github.com>
Lib/distutils/ccompiler.py
Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst [new file with mode: 0644]

index b71d1d39bcda87227165df1c33c925146d6d5807..b70e5e4b5f039fd48f897a80db428d32ab07be7c 100644 (file)
@@ -781,8 +781,9 @@ class CCompiler:
             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 (file)
index 0000000..116a9e4
--- /dev/null
@@ -0,0 +1 @@
+Fix C compiler warning caused by distutils.ccompiler.CCompiler.has_function.