[Biopython-dev] [Bug 2609] Gcc 4.3.2 'initialization from	incompatible pointer type' warning with triemodule.c
    bugzilla-daemon at portal.open-bio.org 
    bugzilla-daemon at portal.open-bio.org
       
    Tue Nov 18 18:35:25 UTC 2008
    
    
  
http://bugzilla.open-bio.org/show_bug.cgi?id=2609
------- Comment #7 from biopython-bugzilla at maubp.freeserve.co.uk  2008-11-18 13:35 EST -------
(In reply to comment #6)
> Still the same warning for Python 2.5 and 2.6:
> 
> Bio/triemodule.c: In function â_write_value_to_handleâ:
> Bio/triemodule.c:498: warning: passing argument 3 of
> âPyString_AsStringAndSizeâ from incompatible pointer type
It looks like PyString_AsStringAndSize will expect a Py_ssize_t length, and not
just an int length.  Suggested patch:
Index: triemodule.c
===================================================================
RCS file: /home/repository/biopython/biopython/Bio/triemodule.c,v
retrieving revision 1.7
diff -r1.7 triemodule.c
486a487,489
> #if PY_VERSION_HEX < 0x02050000
>     Py_ssize_t length;
> #else
487a491
> #endif
i.e. in function  _write_value_to_handle, at line 486 replace this:
    int length;
with this:
#if PY_VERSION_HEX < 0x02050000
    Py_ssize_t length;
#else
    int length;
#endif
This still compiles for me on Python 2.5.2 with gcc 4.0.1 on a Mac.
-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
    
    
More information about the Biopython-dev
mailing list