On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > > I should leave the tounge-in-cheek bombast to Tim and Frederik, especially > when dealing with what might be an OS & machine specific bug. The next > checkin and re-test will or won't highlight a failure and certainly someone > with a g4 will try it out before 2.5.1 goes out so we'll know if it was a > fluke soonish. The original error was mine, I typed "Size_t" instead of > "Ssize_t" and while my one-char patch might also be wrong (I hope not, I'm > red-faced enough as is) we should find out soon enough.
It looks like %zd of a negative number is treated as an unsigned number on OS X, even though the man page says it should be signed. """ The z modifier, when applied to a d or i conversion, indicates that the argument is of a signed type equivalent in size to a size_t. """ The program below returns -123 on Linux and 4294967173 on OS X. n -- #include <stdio.h> int main() { char buffer[256]; if(sprintf(buffer, "%zd", (size_t)-123) < 0) return 1; printf("%s\n", buffer); return 0; } _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com