Mark Dickinson <dicki...@gmail.com> added the comment:

> For example, I would expect the same padding for 'BT{I}' and 'BI'.

Granted, yes.  But I wouldn't expect the same padding for 'BT{BI}' and 'BBI'.  
'BT{BI}' should match a C struct which itself has an embedded struct.  For C, I 
get the following results on my machine:

#include <stdio.h>

/* corresponds to 'T{BI}' */
typedef struct {
  char y;
  int z;
} A;

/* corresponds to 'BT{BI}' */
typedef struct {
  char x;
  A yz;
} B;

/* corresponds to 'BBI' */
typedef struct {
  char x;
  char y;
  int z;
} C;

int main(void) {
  printf("sizeof(A) = %zu\n", sizeof(A));
  printf("sizeof(B) = %zu\n", sizeof(B));
  printf("sizeof(C) = %zu\n", sizeof(C));
  return 0;
}

/*                                                                              
 
Results on a (64-bit) OS X 10.6 machine:                                        
 
                                                                                
 
sizeof(A) = 8                                                                   
 
sizeof(B) = 12                                                                  
 
sizeof(C) = 8                                                                   
 
*/

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue3132>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to