From: Anonymous Maarten <madebr@users.noreply.github.com>
Date: Wed, 28 Aug 2019 17:11:03 +0000 (+0200)
Subject: closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH... 
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55aabee07501e1468082b3237620e4ecd75c5da6;p=python

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
---

diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index 1a411ed111..4cfc6c7065 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -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
index 0000000000..116a9e49dc
--- /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.