title: Function arguments alignment in C
body: <p>The array in procedure breaking procedure arguments alignment.
  Having a following code:</p>
  <pre><code>void _func(unsigned long cnt, int* adr, ...){
      char a[1];
      printf(&quot;cnt: %p, adr: %p\n&quot;, &amp;cnt, &amp;adr);
  }
  
  int main(void){
      _func(0, (int*)1, 2, 3, 4, 5);
      return 0;
  }
  </code></pre>
  <p>... that is compiled with</p>
  <p><code>gcc -m32 -O0 main.c</code></p>
  <p>and it outputs this:</p>
  <pre class="lang-none prettyprint-override"><code>cnt: 0xff911960, adr: 0xff91193c
  </code></pre>
  <p>which is 36 (0x24) bytes difference. And the question is <strong>why</strong> it is? Isn't is should be <code>sizeof(cnt)</code>?</p>
  <p>But if I  remove <code>char a[1]</code> or add <code>-O2</code> flag, the difference would be 4 bytes (as usual).</p>
  <p>What causes this behavior?</p>
  <p>PS: on compiler explorer website, the offset is 4 bytes all the time.</p>