Antoine Pitrou <pit...@free.fr> added the comment:

> Why do you say that? If c is -1, then Py_CHARMASK(c) is 255, which is a
> positive integer.

What srid seems to be saying is that chars are unsigned on AIX, and therefore 
Py_CHARMASK() returns -1. Hence his patch proposal.

Of course, it is dubious why EOF is not tested separately rather than passing 
it to Py_ISALNUM(). Micro-optimization? At least a comment should be added.

Also, really, the Py_CHARMASK() macro seems poorly specified. It claims to 
"convert a possibly signed character to a nonnegative int", but this is wrong: 
it doesn't convert to an int at all. Furthermore, it does a cast in one branch 
but not in the other, which can give bad surprises as here.

----------
nosy: +pitrou

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9020>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to