[issue7788] segfault when deleting from a list using slice with very big `step' value

Marcin Bachry report at bugs.python.org
Thu Feb 4 10:52:49 CET 2010


Marcin Bachry <hegel666 at gmail.com> added the comment:

I had odd problems matching line numbers reported by Windows compiler
to actual sources, so I used "gcc -Wextra" to produce (even more)
signedness warnings against Python 2.x r77957:

  listobject.c:132: warning: comparison between signed and unsigned integer expressions
  listobject.c:1435: warning: comparison between signed and unsigned integer expressions
  listobject.c:2639: warning: comparison between signed and unsigned integer expressions
  listobject.c:2655: warning: comparison between signed and unsigned integer expressions
  listobject.c:2661: warning: comparison between signed and unsigned integer expressions
  listobject.c:2670: warning: comparison between signed and unsigned integer expressions
  bytearrayobject.c:708: warning: comparison between signed and unsigned integer expressions
  bytearrayobject.c:716: warning: comparison between signed and unsigned integer expressions
  bytearrayobject.c:920: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:745: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:751: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:835: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:890: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:1228: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:1310: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:1326: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:1389: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:1450: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:1807: warning: comparison between signed and unsigned integer expressions
  arraymodule.c:1814: warning: comparison between signed and unsigned integer expressions

Most of them are due to comparisons between "size_t" variables and
Py_SIZE() macro which points to signed "ob_size" member of type
structure.  Because the sequence types above don't hold negative
numbers in "ob_size", I think we can silence the warnings by doing
explicit casts to "size_t".  Or we can ignore the warnings in
buildbot.  What do you think?

----------

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


More information about the Python-bugs-list mailing list