MinGW and packed struct alignment using C++11
问题 For the below structure, the actual (with no padding) size of the structure is 54. On a 64-bit (Windows 7) machine with MinGW (GCC) 4.8.1 x86_64, I get sizeof(BMPHeader) as 56, which is understandable. As per the requirement of the BMP file format, the structure should've no padding. I've three options (priority ordered): C++11's alignas(1) struct __attribute__ ((packed)) BMPHeader #pragma pack(1) However the last option (with least priority) alone seems to work giving me 54. Is this a bug in