Hello!

Consider the following simple code.

#pragma pack(2)
struct TEST{
        char    x1;
        int     x2;     
};
#pragma pack()
main()
{
        struct TEST     t;
        printf("%d\n", sizeof(t));
}

When I compile with "gcc" ,the output is 6.But the output is 5 when using "-fpack-struct" to build,and the "#pragma pack(2)" seems to be invalid.What is the reason?
Is there anyway to combine them?If I want to modify the gcc source code,what should I do?


Thanks in advanced,
Diterlish

_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/




Reply via email to