On Thu, Sep 21, 2006 at 10:23:54PM -0700, Neal Norwitz wrote: > 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; > }
Consider me blushing even harder for denying the power of the buildbot (and against all evidence). Yikes, didn't any other tests trigger this? sprat:~/src/python-head# find ./ -name '*.c' | xargs grep '%zd' | wc -l 65 -Jack _______________________________________________ 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