Message29171
Logged In: YES
user_id=31435
> Based on the other bug I guess that casting an arbitrary
> long to unsigned long is allowed.
Right, C defines the result of casting any integral type to
any unsigned integral type.
> If so, then maybe we could use the following test:
>
> if (sign == '-' && uresult == 0-(unsigned
long)LONG_MIN) {
> result = LONG_MIN;
> }
>
> which states the intention a bit more clearly and
> without the assert().
We could. It's not really clearer to me, given that the
current code is explained in a comment block before
PyOS_strtol(), and I couldn't care less about removing an
assert, so I'm not going to bother. I wouldn't object to
changing it, although "0-" instead of plain unary "-" also
begs for an explanation lest someone delete the "0" because
it looks plain silly. |
|
Date |
User |
Action |
Args |
2007-08-23 14:41:20 | admin | link | issue1521947 messages |
2007-08-23 14:41:20 | admin | create | |
|