summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/distutils/ccompiler.py3
-rw-r--r--Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst1
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index 1a411ed..4cfc6c7 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 0000000..116a9e4
--- /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.