title: When is memset to 0 nonportable?
body: <p>From <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119#c0" rel="noreferrer">this comment in GCC bug #53119</a>:</p>
  <blockquote>
  <p>In C, <code>{0}</code> is the universal zero initializer equivalent to C++'s <code>{}</code> (the latter being invalid in C). It is necessary to use whenever you want a zero-initialized object of a complete but conceptually-opaque or implementation-defined type. The classic example in the C standard library is <code>mbstate_t</code>:</p>
  <pre><code>mbstate_t state = { 0 }; /* correctly zero-initialized */
  </code></pre>
  <p>versus the common but nonportable:</p>
  <pre><code>mbstate_t state;
  memset(&amp;state, 0, sizeof state);
  </code></pre>
  </blockquote>
  <p>It strikes me as odd that the latter version could be unportable (even for implementation-defined types, the compiler has to know the size). What is the issue here and when is a <code>memset(x, 0, sizeof x)</code> unportable?</p>