MSVC default memory alignment of 8
According to [MSDN][1], the `/Zp` command defaults to 8, which means 64-bit alignment boundaries are used. I have always assumed that for 32-bit applications, the MSVC compiler will use 32-bit boundaries. For example:

    struct Test
    {
       char foo;
       int bar;
    };

The compiler will pad it like so:

    struct Test
    {
       char foo;
       char padding[3];
       int bar;
    };

So, since `/Zp8` is used by default, does that mean my padding becomes 7+4 bytes using the same example above? This is a bit ridiculous isn't it? Am I misunderstanding? Why is such a large padding used, it seems like a waste of space. Most types on a 32-bit system aren't even going to use 64-bits, so the majority of variables would have padding (probably over 80%).


  [1]: http://msdn.microsoft.com/en-us/library/aa273913%28v=vs.60%29.aspx
MSVC default memory alignment of 8
===

According to [MSDN][1], the `/Zp` command defaults to 8, which means 64-bit alignment boundaries are used. I have always assumed that for 32-bit applications, the MSVC compiler will use 32-bit boundaries. For example:

    struct Test
    {
       char foo;
       int bar;
    };

The compiler will pad it like so:

    struct Test
    {
       char foo;
       char padding[3];
       int bar;
    };

So, since `/Zp8` is used by default, does that mean my padding becomes 7+4 bytes using the same example above? This is a bit ridiculous isn't it? Am I misunderstanding? Why is such a large padding used, it seems like a waste of space. Most types on a 32-bit system aren't even going to use 64-bits, so the majority of variables would have padding (probably over 80%).


  [1]: http://msdn.microsoft.com/en-us/library/aa273913%28v=vs.60%29.aspx