oohmail wrote:
> typedef struct A_TAG A;
> struct A_TAG
> {
> short type ;
> long file;
> ..........
> } ;
>
>
> A a ;
> A *p_a ;
>
> p_a = &a ;
>
> when &a address is 100 ,the sizeof a.type is 2 , so the p_a->file address
> should be 100+2 = 102 ,but I found it is 104 ,No, you are wrong. The compiler adds two extra bytes as padding, so that the 32bit field "file" is aligned on a 32bit boundary. This is how all common compilers behave. cheers simon
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Tinycc-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/tinycc-devel
