title: Union and struct packing problem
body: <p>I'm writing some software where each bit must be exact(it's for the CPU) so __packed is very important. </p>
  
  <pre><code>typedef union{
  uint32_t raw;
  struct{
      unsigned int present:1;
      unsigned int rw:1;
      unsigned int user:1;
      unsigned int dirty:1;
      unsigned int free:7;
      unsigned int frame:20;
  } __packed;
  }__packed page_union_t;
  </code></pre>
  
  <p>that is my structure and union. It does not work however:</p>
  
  <pre><code>page_union_t p; //.....
  //This:
  p.frame=trg_page;
  p.user=user;
  p.rw=rw;
  p.present=present;
  //and this:
  p.raw=trg_page&lt;&lt;12 | user&lt;&lt;2 | rw&lt;&lt;1 | present;
  </code></pre>
  
  <p>should create the same uint32. But they do not create the same thing.</p>
  
  <p>Is there something I can not see that is wrong with my union?</p>