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: Incorrect type in PyDict_Next() example code
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: georg.brandl, jasonevans, nnorwitz
Priority: normal Keywords:

Created on 2007-01-05 23:15 by jasonevans, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg30934 - (view) Author: Jason Evans (jasonevans) Date: 2007-01-05 23:15
In the PyDict_Next() documentation, there are two example snippets of code.  In both snippets, the line:

    int pos = 0;

should instead be:

    ssize_t pos = 0;

or perhaps:

    Py_ssize_t pos = 0;

On an LP64 system, the unfixed snippets will cause a compiler warning due to size mismatch between int and ssize_t.

Using Python 2.5 on RHEL WS 4, x86_64.
msg30935 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-01-17 21:20
Yep, it has to be Py_ssize_t. Fixed in rev. 53477, 53478 (2.5).
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44418
2007-01-05 23:15:47jasonevanscreate