Old bug in longobject.c + fix

Duncan Booth duncan at NOSPAMrcp.co.uk
Tue Aug 20 09:49:13 CEST 2002

"Jochen Küpper" <jochen at jochen-kuepper.de> wrote in 
news:mailman.1029821790.7317.python-list at python.org:

> Duncan> On many systems you can expect the C types unsigned short to
> Duncan> be 16 bits, unsigned int 32 bits and unsigned long 32 bits.
> Duncan> When this is the case, the cast has no detectable effect.
> Duncan> Therefore on most systems the bug is completely undetectable.
> But then there are systems around for ages where unsigned long is 64
> bit... And python seems to run happily on them:))

Yes, but in the words of another poster, I thought it was 'pretty damn 
obvious' that the code worked when int or long was 64 bit, so I didn't 
bother to mention that fact. :-)

Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

More information about the Python-list mailing list