[issue22156] Fix compiler warnings

Vajrasky Kok report at bugs.python.org
Thu Aug 7 16:33:39 CEST 2014


Vajrasky Kok added the comment:

Victor, your patch fixes most of the pesky warnings. However you left one warning left (at least in Mac OS X 10.9.4).

Objects/unicodeobject.c:4831:43: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
    if (PY_SSIZE_T_MAX /  sizeof(wchar_t) < (size + 1))
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~

Maybe we can fix it by doing this:
    if (PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(wchar_t) < (size + 1))
        return NULL;

----------
nosy: +vajrasky

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22156>
_______________________________________


More information about the Python-bugs-list mailing list