According to MSDN , the command /Zpdefaults to 8, which means using 64-bit alignment boundaries. I have always assumed that for 32-bit applications, the MSVC compiler will use 32-bit boundaries. For instance:
struct Test
{
char foo;
int bar;
};
The compiler will execute it as follows:
struct Test
{
char foo;
char padding[3];
int bar;
};
So, since it is /Zp8used by default, does this mean that my pad is 7 + 4 bytes using the same example above:
struct Test
{
char foo;
char padding1[7];
int bar;
char padding2[4];
};
It's a little funny, isn't it? I do not understand? Why such a great addition is used, it seems like a waste of space. Most types on a 32-bit system do not even use 64-bit systems, so most variables will be indented (possibly more than 80%).