Author ncopa
Recipients ncopa
Date 2014-02-11.12:20:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392121208.86.0.742222636486.issue20594@psf.upfronthosting.co.za>
In-reply-to
Content
This happens when building with musl libc:

./Modules/posixmodule.c:7849:1: error: conflicting types for 'posix_close'
 posix_close(PyObject *self, PyObject *args)
 ^
In file included from Include/Python.h:36:0,
                 from ./Modules/posixmodule.c:28:
/usr/include/unistd.h:38:5: note: previous declaration of 'posix_close' was here
 int posix_close(int, int);
     ^
Makefile:1511: recipe for target 'Modules/posixmodule.o' failed
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....


Apparently 'posix_close' has made it to the POSIX standard so that name should be avoided in python's posix module.c.
https://sourceware.org/ml/glibc-bugs/2013-12/msg00099.html

Fix is trivial:
--- ./Modules/posixmodule.c.orig
+++ ./Modules/posixmodule.c
@@ -7846,7 +7846,7 @@
 Close a file descriptor (for low level IO).");
 
 static PyObject *
-posix_close(PyObject *self, PyObject *args)
+posix_closex(PyObject *self, PyObject *args)
 {
     int fd, res;
     if (!PyArg_ParseTuple(args, "i:close", &fd))
@@ -11262,7 +11262,7 @@
     {"open",            (PyCFunction)posix_open,\
                         METH_VARARGS | METH_KEYWORDS,
                         posix_open__doc__},
-    {"close",           posix_close, METH_VARARGS, posix_close__doc__},
+    {"close",           posix_closex, METH_VARARGS, posix_close__doc__},
     {"closerange",      posix_closerange, METH_VARARGS, posix_closerange__doc__},
     {"device_encoding", device_encoding, METH_VARARGS, device_encoding__doc__},
     {"dup",             posix_dup, METH_VARARGS, posix_dup__doc__},
History
Date User Action Args
2014-02-11 12:20:08ncopasetrecipients: + ncopa
2014-02-11 12:20:08ncopasetmessageid: <1392121208.86.0.742222636486.issue20594@psf.upfronthosting.co.za>
2014-02-11 12:20:08ncopalinkissue20594 messages
2014-02-11 12:20:08ncopacreate