title: How to tell gcc to disable padding inside struct?
body: <p>I’m unsure on whether it’s normal or it’s a compiler bug but I have a C struct with lot of members. Among of them, there’s, :</p>
  
  <pre><code>struct list {
      ...  
      ...
      const unsigned char nop=0x90; // 27 bytes since the begining of the structure
      const unsigned char jump=0xeb; // 28 bytes since the begining of the structure
      const unsigned char hlt=0xf4; // 29 bytes since the begining of the structure
      unsigned __int128 i=0xeb90eb90eb90eb90f4f4 // should start at the 30th byte, but get aligned on a 16 byte boundary and starts on the 32th byte instead
      const unsigned char data=0x66; // should start at the 46th byte, but start on the 48th instead.
  }; // end of struct list.
  </code></pre>
  
  <p>I had a hard time to find  out why my program wasn’t working, but I finally found <strong>there’s a 2 bytes gap between <code>hlt</code>and <code>i</code></strong> which is set to 0x0. This means that the <code>i</code> is getting aligned.<br>
  This is very clear when I printf that part of the structure, because with :</p>
  
  <pre><code>for(int i=28;i&lt;35;i++)
      printf("%02hhX",buf[i]);
  </code></pre>
  
  <p>I get <code>EBF40000EB90EB90</code> on the screen.</p>
  
  <p>I tried things like <code>volatile struct list data;</code>in my program, but it didn’t changed the alignment problem.</p>
  
  <p>So is there a <code>#pragma</code> or a <code>__attribute__</code>to tell gcc to not align <code>i</code> inside <code>struct list</code>type ?</p>