[pypy-issue] Issue #2589: PyFile_FromFile, fclose(void *arg3) might need to be int (*close)(FILE*) (pypy/pypy)

Alex Kashirin issues-reply at bitbucket.org
Wed Jun 21 08:19:27 EDT 2017


New issue 2589: PyFile_FromFile, fclose(void *arg3) might need to be int (*close)(FILE*)
https://bitbucket.org/pypy/pypy/issues/2589/pyfile_fromfile-fclose-void-arg3-might

Alex Kashirin:

The issue happens with pydoop
pypy_pip install pydoop

the fclose(*arg3) looks like need to be int (*close)(FILE*)

```
#!C

   building 'pydoop.sercore' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    creating build/temp.linux-x86_64-2.7/src/serialize
    cc -pthread -DNDEBUG -O2 -fPIC -I/opt/pypy2/include -c src/serialize/protocol_codec.cc -o build/temp.linux-x86_64-2.7/src/serialize/protocol_codec.o -Wno-write-strings -O3
    src/serialize/protocol_codec.cc: In function PyObject* util_fdopen(PyObject*, PyObject*):
    src/serialize/protocol_codec.cc:424:54: error: invalid conversion from int (*)(FILE*) {aka int (*)(_IO_FILE*)} to void* [-fpermissive]
       return PyFile_FromFile(fp, "<fdopen>", mode, fclose);
                                                                                         ^
    In file included from /opt/pypy2/include/Python.h:141:0,
                     from src/serialize/protocol_codec.cc:20:
    /opt/pypy2/include/pypy_decl.h:270:25: note:   initializing argument 4 of PyObject* PyPyFile_FromFile(FILE*, const char*, const char*, void*)
     #define PyFile_FromFile PyPyFile_FromFile
                                             ^
    /opt/pypy2/include/pypy_decl.h:271:24: note: in expansion of macro PyFile_FromFile
     PyAPI_FUNC(PyObject *) PyFile_FromFile(FILE *arg0, const char *arg1, const char *arg2, void *arg3);
                            ^~~~~~~~~~~~~~~
    error: command 'cc' failed with exit status 1
```

Thank You,
Kashirin Alex




More information about the pypy-issue mailing list