Issue 1701192: symbol conflict for 'readahead' (original) (raw)
I'm encountering the error below with python 2.5 on current Debian x86.
src/python-2.5.1c1/Objects/fileobject.c:1845: error: conflicting types for 'readahead' /usr/include/bits/fcntl.h:187: error: previous declaration of 'readahead' was here
It may be that's it's provoked only by my slightly custom embedded build process - perhaps the standard build does not include fcntl.h while compiling this file.
A fix is trivial - just to rename the static readahead function to something else, e.g. as below.
Rgds
A
====================================
--- fileobject.c.Orig 2007-04-15 19:47:35.000000000 -0400 +++ fileobject.c 2007-04-15 19:49:11.000000000 -0400 @@ -1841,7 +1841,7 @@ (unless at EOF) and no more than bufsize. Returns negative value on error, will set MemoryError if bufsize bytes cannot be allocated. */ static int -readahead(PyFileObject *f, int bufsize) +do_readahead(PyFileObject *f, int bufsize) { Py_ssize_t chunksize;
@@ -1887,7 +1887,7 @@ Py_ssize_t len;
if (f->f_buf == NULL)
if (readahead(f, bufsize) < 0)
if (do_readahead(f, bufsize) < 0) return NULL;