[Pyrex] A riddle
Josiah Carlson
jcarlson at uci.edu
Tue Apr 18 21:48:11 CEST 2006
Tomasz Primke <tprimke at interia.pl> wrote:
> Well, I think I have finally find that *.* bug.
>
> My friend told me, that in C the assumption
>
> sizeof( some struct ) == sum of sizeof( all struct's attributes )
>
> is not always met. The sum of struct's attributes sizes must be rounded up
> to 4. So I changed the "size" C function code to:
Depending on your compiler and platform, it may be doing 8-byte
alignment in structs. A recent bug with the Windows socket module in
Python was caused by a compiler flag mismatch, resulting in alignment
mismatching between the library itself, and where Python expected it to
be.
- Josiah
More information about the Pyrex
mailing list