title: sizeof struct with pack(push,1)
body: <p>I have struct in qt project:</p>
  
  <pre><code>#pragma pack(push,1)
  struct test1{
      uint8_t a1 : 3;
      uint8_t a2 : 1;
      uint8_t a3 : 3;
      uint8_t a4 : 1;
      uint8_t a5 :3;
      uint8_t a6 : 1;
      uint16_t a7 : 12;
  };
  #pragma pack(pop)
  </code></pre>
  
  <p>Check it sizeof. </p>
  
  <pre><code>qDebug() &lt;&lt; "sizeof(Mi28NE::test1)" &lt;&lt; sizeof(Mi28NE::test1);
  </code></pre>
  
  <p>Result in MinGW compiler:</p>
  
  <pre><code>&gt;&gt; sizeof(Mi28NE::test1) 3
  </code></pre>
  
  <p>Result in MSVC compiler:</p>
  
  <pre><code>&gt;&gt; sizeof(Mi28NE::test1) 4
  </code></pre>
  
  <p>Why?</p>