title: Are there any guarantees about C struct packing?
body: <p>Are there <strong>any</strong> guarantees regarding packing of structs in C?</p>
  
  <p>Just as an example, provided that <code>sizeof(double) == 8</code>, is it guaranteed that <code>sizeof(struct { double x, y; }) == 16</code>?</p>
  
  <p>I am aware that the intention behind this question conflicts with strict aliasing rules, therefore assume strict aliasing is disabled, e.g. in the case of gcc with <code>-fno-strict-aliasing</code>.</p>
  
  <p>To avoid any further speculations: The intention is knowing about compatibility of a struct with its explicitly packed counterpart. Note that aliasing is relevant even in the following case: <a href="https://stackoverflow.com/q/19804655/563940">Are C-structs with the same members types guaranteed to have the same layout in memory?
  </a>. No need to worry about me wanting to access single bytes.</p>