[issue3642] Objects/obmalloc.c:529: warning: comparison is always false due to limited range of data type

Martin v. Löwis report at bugs.python.org
Mon Aug 25 06:50:35 CEST 2008


Martin v. Löwis <martin at v.loewis.de> added the comment:

> In my humble opinion it should be safe to limit the amount of arenas to
> UINT_MAX instead of PY_SIZE_MAX. 4,294,967,295 arenas should be more
> than sufficient for the next decade or two. Do you concur?

It is certainly reasonable to limit arenas to uint. Still, the test
for SIZE_MAX must remain: it doesn't test whether numarenas overflows,
but whether numarenas*sizeof(*arenas) overflows as a parameter for
realloc. As the parameter for realloc is size_t (per C spec), the
overflow test needs to use PY_SIZE_MAX.

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


More information about the Python-bugs-list mailing list