struct curiosity

pjcoup pjcoup at
Fri Oct 16 18:31:50 CEST 2009

Yes, this is basically what I expected as well.
I would have expected some size that you can coax gcc to give, either
12 (as here), or 10 (with directives).
Thanks to everyone for the responses!


On Oct 16, 4:30 am, Peter Otten <__pete... at> wrote:
> I would have expected "native size and alignment" (as stated in the
> documentation) to mean that I can read the output of struct.pack("bhhhhb")
> into a C
> struct {
>   char a;
>   short b1, b2, b3, b4;
>   char c
> }
> but that has a size of 12 bytes on my 64 bit Ubuntu.
> Peter

More information about the Python-list mailing list