[Python-Dev] test_itertools fails for trunk on x86 OS X machine

Ronald Oussoren ronaldoussoren at mac.com
Fri Sep 22 11:40:41 CEST 2006

On Friday, September 22, 2006, at 08:38AM, Neal Norwitz <nnorwitz at gmail.com> wrote:

>On 9/21/06, Tim Peters <tim.peters at gmail.com> wrote:
>> Well, to be strictly anal, while the result of
>>     (size_t)-123
>> is defined, the result of casting /that/ back to a signed type of the
>> same width is not defined.  Maybe your compiler was "doing you a
>> favor" ;-)
>I also tried with a cast to an ssize_t and replacing %zd with an %zi.
>None of them make a difference; all return an unsigned value.  This is
>with powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 20041026 (Apple
>Computer, Inc. build 4061).  Although i would expect the issue is in
>the std C library rather than the compiler.
>Forcing PY_FORMAT_SIZE_T to be "l" instead of "z" fixes this problem.
>BTW, this is the same issue on Mac OS X:
>>>> struct.pack('=b', -599999)
>__main__:1: DeprecationWarning: 'b' format requires 4294967168 <= number <= 127

Has anyone filed a bug at bugreport.apple.com about this (that is '%zd' not behaving as the documentation says it should behave)? I'll file a bug (as well), but the more people tell Apple about this the more likely it is that someone will fix this.


>Python-Dev mailing list
>Python-Dev at python.org
>Unsubscribe: http://mail.python.org/mailman/options/python-dev/ronaldoussoren%40mac.com

More information about the Python-Dev mailing list