This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: symbol conflict for 'readahead'
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ajrh, amaury.forgeotdarc
Priority: normal Keywords:

Created on 2007-04-16 00:02 by ajrh, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg31797 - (view) Author: ajrh (ajrh) Date: 2007-04-16 00:02
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;

 
msg83307 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-03-08 09:18
If your build process really needs fcntl.h in Python.h, I suggest to 
customize it again and add:

#ifdef Py_BUILD_CORE
#define readahead do_readahead
#endif
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44851
2009-03-08 09:18:51amaury.forgeotdarcsetstatus: open -> closed
resolution: not a bug
messages: + msg83307
nosy: + amaury.forgeotdarc
2007-04-16 00:02:34ajrhcreate